Browse Source

modified: admin-content/src/views/home.vue
modified: admin-content/vue.config.js
modified: admin-frame/src/components/editoritem.vue
modified: admin-frame/vue.config.js
modified: admin-market/src/views/Home.vue

asd123a20 2 years ago
parent
commit
48e0f4b350

+ 2 - 0
admin-content/src/views/home.vue

@@ -175,6 +175,8 @@ export default {
       let res, msg;
       let res, msg;
       // 修改
       // 修改
       if (e._id) {
       if (e._id) {
+        delete e.svip;
+        delete e.isShow;
         res = await this.contentsUpdate(e);
         res = await this.contentsUpdate(e);
         msg = '文章修改成功';
         msg = '文章修改成功';
       } else {
       } else {

+ 2 - 2
admin-content/vue.config.js

@@ -11,8 +11,8 @@ module.exports = {
     },
     },
     proxy: {
     proxy: {
       '/api/': {
       '/api/': {
-        // target: 'http://192.168.0.45:18090'
-        target: 'http://192.168.3.45:18090'
+        target: 'http://192.168.0.45:18090'
+        // target: 'http://192.168.3.45:18090'
       }
       }
     }
     }
   },
   },

+ 1 - 1
admin-frame/src/components/editoritem.vue

@@ -94,7 +94,7 @@ export default {
         };
         };
         const res = await $axios.post(filesUpload, data, null, headers);
         const res = await $axios.post(filesUpload, data, null, headers);
         // insertImgFn 是获取图片 url 后,插入到编辑器的方法
         // insertImgFn 是获取图片 url 后,插入到编辑器的方法
-        const url = res.data.filePath;
+        const url = `http://192.168.0.45:9002${res.data.filePath}`;
         // 上传图片,返回结果,将图片插入到编辑器中
         // 上传图片,返回结果,将图片插入到编辑器中
         insertImgFn(url);
         insertImgFn(url);
       };
       };

+ 2 - 2
admin-frame/vue.config.js

@@ -26,8 +26,8 @@ module.exports = {
         target: 'http://192.168.0.45:18090'
         target: 'http://192.168.0.45:18090'
       },
       },
       '/upload/': {
       '/upload/': {
-        // target: 'http://192.168.3.45:9002'
-        target: 'http://192.168.0.45:18090'
+        target: 'http://192.168.0.45:9002'
+        // target: 'http://192.168.0.45:18090'
       }
       }
     }
     }
   }
   }

+ 10 - 4
admin-market/src/views/Home.vue

@@ -115,6 +115,8 @@ export default {
     async filtereEdit (e) {
     async filtereEdit (e) {
       this.formdata = e;
       this.formdata = e;
       this.title = '修改商品';
       this.title = '修改商品';
+      const item = this.typeList.find(i => i.name == e.type)?.code;
+      this.typeChange(Number(item));
       this.visibleSync = true;
       this.visibleSync = true;
     },
     },
     // 删除
     // 删除
@@ -135,13 +137,16 @@ export default {
     // 商品改变
     // 商品改变
     async goodChange(e) {
     async goodChange(e) {
       const res = await this.goodFetch({ code: this.typeCode, id: e });
       const res = await this.goodFetch({ code: this.typeCode, id: e });
-      const { name, thumbnail } = res;
-      this.$refs.formData.setForm('name', name);
-      this.$refs.formData.setForm('thumbnail', thumbnail);
+      if (res.name) {
+        this.$refs.formData.setForm('name', res.name);
+      } else {
+        this.$refs.formData.setForm('name', res.title);
+      }
+      this.$refs.formData.setForm('thumbnail', res.thumbnail);
     },
     },
     // 表单保存
     // 表单保存
     async formSave (e) {
     async formSave (e) {
-      console.log(e);
+      const item = this.typeList.find(i => i.name == e.type)?.code;
       if (e.isRevise && e?.isRevise == false) {
       if (e.isRevise && e?.isRevise == false) {
         this.$message.warning('未作修改');
         this.$message.warning('未作修改');
         return;
         return;
@@ -150,6 +155,7 @@ export default {
       let res, msg;
       let res, msg;
       // 修改
       // 修改
       if (e._id) {
       if (e._id) {
+        e.type = item;
         res = await this.marketUpdate(e);
         res = await this.marketUpdate(e);
         msg = '商品修改成功';
         msg = '商品修改成功';
       } else {
       } else {