From 17160d0cacec834a737f6736a49447d94ec72a73 Mon Sep 17 00:00:00 2001
From: DESKTOP-D85FA51\111 <2831695300@qq.com>
Date: 星期三, 20 一月 2021 15:34:34 +0800
Subject: [PATCH] 修改代码 功能bug

---
 src/apis/coursewareSource/packageManage/index.js        |    3 -
 src/views/coursewareSource/packageManage/SetPass.vue    |    1 
 src/views/coursewareSource/packageManage/SetPackage.vue |    9 ++--
 debug.log                                               |    1 
 src/components/coursewareSource/ButtonUp.vue            |    2 
 src/components/coursewareSource/TextImgUp.vue           |   51 ++++++++++++++++---------
 src/components/course/imgUp.vue                         |   41 +++++++++++---------
 7 files changed, 64 insertions(+), 44 deletions(-)

diff --git a/debug.log b/debug.log
new file mode 100644
index 0000000..38a75ae
--- /dev/null
+++ b/debug.log
@@ -0,0 +1 @@
+[0120/145000.561:ERROR:directory_reader_win.cc(43)] FindFirstFile: 系统找不到指定的路径。 (0x3)
diff --git a/src/apis/coursewareSource/packageManage/index.js b/src/apis/coursewareSource/packageManage/index.js
index 28430df..8d11dd7 100644
--- a/src/apis/coursewareSource/packageManage/index.js
+++ b/src/apis/coursewareSource/packageManage/index.js
@@ -118,7 +118,6 @@
   vocabulary,
   learningBase,
   status,
-  modelArr,
   funArr,
   taskArr
 ) =>
@@ -133,7 +132,7 @@
     vocabulary,
     learningBase,
     status,
-    modelArr,
+
     funArr,
     taskArr,
   });
diff --git a/src/components/course/imgUp.vue b/src/components/course/imgUp.vue
index 884ddc3..7edfeef 100644
--- a/src/components/course/imgUp.vue
+++ b/src/components/course/imgUp.vue
@@ -9,7 +9,7 @@
             :src="
               imgSrc.indexOf('http') >= 0
                 ? imgSrc
-                : 'http://mpfile.anniekids.com' + imgSrc
+                : 'https://resourcecdn.anniekids.com' + imgSrc
             "
             alt=""
           />
@@ -46,6 +46,7 @@
 import moment from "moment";
 import { Utils } from "@/assets/js/utils";
 let utils = new Utils();
+import { mapState } from "vuex";
 export default {
   name: "upload",
   props: ["upDis", "style1"],
@@ -56,12 +57,17 @@
       imgA: "",
       isValidate: false,
       styles: false,
+      host: "",
     };
   },
   created() {
     this.imgSrc = this.upDis;
     this.styles = this.style1 || "";
-    console.log(this.imgSrc, "imgsrc");
+  },
+  computed: {
+    ...mapState("common", {
+      user: (state) => JSON.parse(state.user),
+    }),
   },
   watch: {
     upDis: {
@@ -125,31 +131,30 @@
       // }
     },
     uploadImg(file) {
+      let that = this;
       let imgObj = {
-        timestamp: moment().format("X"),
-        classId: "",
-        status: 0,
-        title: file.name,
-        releaseId: JSON.parse(utils.decrypt(localStorage.getItem("annieUser")))
-          .userId,
-        releaseName: JSON.parse(
-          utils.decrypt(localStorage.getItem("annieUser"))
-        ).mobile,
-        isInside: 0,
-        cid: 0,
-        source: 6,
+        FSource: 13,
+        FStatus: "1",
+        FIntro: "娑堟伅鎺ㄩ��",
+        FUser: that.user.nickName,
+        FUid: that.user.userId,
+        FBusiness: 24,
+        isInside: "1",
+        FTranscoding: "0",
       };
       let formData = utils.fnUploadPara(imgObj, file);
-      this.instance
-        .post("/Api/v1/ImgSet/imgUploadSub", formData)
+      this.uploads
+        .post("api/v1/img/imgUploadSub", formData)
         .then((res) => {
-          let { data, status } = res.data;
-          if (status === 0) {
+          let { code, data } = res.data;
+
+          if (code == 1) {
             let FR = new FileReader();
             FR.readAsDataURL(file);
             FR.onload = () => {
               //this.imgSrc = data.filePath;
               // this.form.userFile = data.filePath;
+              this.host = data.host;
               this.$emit("getPosimg", data);
             };
           }
diff --git a/src/components/coursewareSource/ButtonUp.vue b/src/components/coursewareSource/ButtonUp.vue
index b46138a..53da929 100644
--- a/src/components/coursewareSource/ButtonUp.vue
+++ b/src/components/coursewareSource/ButtonUp.vue
@@ -11,7 +11,7 @@
         >
           <div class="img">
             <img
-              :src="host || 'https://resourcecdn.anniekids.com' + item.imgUrl"
+              :src="(host || 'https://resourcecdn.anniekids.com') + item.imgUrl"
               alt=""
             />
           </div>
diff --git a/src/components/coursewareSource/TextImgUp.vue b/src/components/coursewareSource/TextImgUp.vue
index d49bc67..6e6dc5f 100644
--- a/src/components/coursewareSource/TextImgUp.vue
+++ b/src/components/coursewareSource/TextImgUp.vue
@@ -6,7 +6,15 @@
       <li v-if="imgSrc">
         <div class="item">
           <div class="img">
-            <img v-if="imgSrc" :src="imgSrc ? imgSrc : imgSrc" alt="" />
+            <img
+              v-if="imgSrc"
+              :src="
+                imgSrc.indexOf('http') >= 0
+                  ? imgSrc
+                  : 'https://resourcecdn.anniekids.com' + imgSrc
+              "
+              alt=""
+            />
           </div>
           <img
             src="../../assets/images/deleteImg.png"
@@ -37,6 +45,7 @@
 import { userId, userName } from "@/assets/js/consts";
 import moment from "moment";
 import { Utils } from "@/assets/js/utils";
+import { mapState } from "vuex";
 let utils = new Utils();
 export default {
   name: "upload",
@@ -47,6 +56,7 @@
       imgSrc: "",
       imgA: "",
       isValidate: false,
+      host: "",
     };
   },
   created() {
@@ -63,6 +73,11 @@
       },
       deep: true,
     },
+  },
+  computed: {
+    ...mapState("common", {
+      user: (state) => JSON.parse(state.user),
+    }),
   },
   methods: {
     deleteImg() {
@@ -108,33 +123,31 @@
       // }
     },
     uploadImg(file) {
+      let that = this;
       let imgObj = {
-        timestamp: moment().format("X"),
-        classId: "",
-        status: 0,
-        title: file.name,
-        releaseId: JSON.parse(utils.decrypt(localStorage.getItem("annieUser")))
-          .userId,
-        releaseName: JSON.parse(
-          utils.decrypt(localStorage.getItem("annieUser"))
-        ).mobile,
-        isInside: 0,
-        cid: 0,
-        source: 6,
+        FSource: 13,
+        FStatus: "1",
+        FIntro: "娑堟伅鎺ㄩ��",
+        FUser: that.user.nickName,
+        FUid: that.user.userId,
+        FBusiness: 24,
+        isInside: "1",
+        FTranscoding: "0",
       };
       let formData = utils.fnUploadPara(imgObj, file);
 
-      this.instance
-        .post("/Api/v1/ImgSet/imgUploadSub", formData)
+      this.uploads
+        .post("api/v1/img/imgUploadSub", formData)
         .then((res) => {
-          let { data, status } = res.data;
-          if (status === 0) {
+          let { code, data } = res.data;
+          if (code === 1) {
             let FR = new FileReader();
             FR.readAsDataURL(file);
             FR.onload = () => {
-              this.imgSrc = data;
+              // this.imgSrc = data;
               // this.form.userFile = data.filePath;
-              this.$emit("getPosimg", this.imgSrc);
+              this.host = data.host;
+              this.$emit("getPosimg", data);
             };
           }
         })
diff --git a/src/views/coursewareSource/packageManage/SetPackage.vue b/src/views/coursewareSource/packageManage/SetPackage.vue
index 1b4af57..0912985 100644
--- a/src/views/coursewareSource/packageManage/SetPackage.vue
+++ b/src/views/coursewareSource/packageManage/SetPackage.vue
@@ -492,12 +492,13 @@
     },
     // 鑾峰彇鍥剧墖
     getPosimg(e, index) {
+      console.log(e, "e");
       if (index == 1) {
         this.ruleForm.packageCoverImg = e.filePath;
-        this.ruleForm.httpPackageCoverImg = e.fileUrl;
+        this.ruleForm.httpPackageCoverImg = e.filePath;
       } else {
         this.ruleForm.guidanceImage = e.filePath;
-        this.ruleForm.httPguidanceImage = e.fileUrl;
+        this.ruleForm.httPguidanceImage = e.filePath;
       }
       this.$forceUpdate();
     },
@@ -513,7 +514,7 @@
           value = item.httpImgUrl;
         }
       });
-      console.log(value);
+
       return value;
     },
     // 鍒犻櫎
@@ -531,7 +532,7 @@
       this.ruleForm.funArr.forEach((item) => {
         if (item.modelType == modelType && item.type == type) {
           item.imgUrl = e.filePath;
-          item.httpImgUrl = e.fileUrl;
+          item.httpImgUrl = e.filePath;
         }
       });
       this.$forceUpdate();
diff --git a/src/views/coursewareSource/packageManage/SetPass.vue b/src/views/coursewareSource/packageManage/SetPass.vue
index 5141c54..d0ed9e1 100644
--- a/src/views/coursewareSource/packageManage/SetPass.vue
+++ b/src/views/coursewareSource/packageManage/SetPass.vue
@@ -558,6 +558,7 @@
     // 鑾峰彇鍥剧墖list
     getPosimg(e) {
       this.ruleForm.helpArr.push({ imgUrl: e.filePath });
+      console.log(this.ruleForm.helpArr);
     },
     // 鑾峰彇璇句欢list
     getCourse(data) {

--
Gitblit v1.8.0