lrf402788946 4 years ago
parent
commit
9b6c418c23
1 changed files with 7 additions and 2 deletions
  1. 7 2
      src/views/user/chuanzuoye.vue

+ 7 - 2
src/views/user/chuanzuoye.vue

@@ -161,14 +161,19 @@ export default {
         if (this.user.classid) {
           upuri = `${upuri}${this.user.classid}_`;
         }
-        if (this.taskAnswer.lessonname) {
-          upuri = `${upuri}${this.taskAnswer.lessonname}_`;
+        console.log('after classid');
+        if (_.get(this, 'name')) {
+          upuri = `${upuri}${this.name}_`;
         }
+        console.log('after lesson');
         if (this.user.name) {
           upuri = `${upuri}${this.user.name}_`;
         }
+        console.log('after name');
         if (upuri.endsWith('_')) upuri = _.trimEnd(upuri, '_');
+        console.log('after trim');
         upuri = `${upuri}/upload`;
+        console.log(upuri);
         const res = await this.taskUpload({ file, uri: upuri });
         const { uri } = res.data;
         if (uri) this.pic.splice(this.pic.length - 1, 1, { url: uri });