ysy před 1 rokem
rodič
revize
5360580ff9

+ 2 - 2
src/api/material/BOM.js

@@ -272,10 +272,10 @@ export async function startAndStop(data) {
 
 export async function bomSubmit(data) {
   const res = await request.post(`/bpm/bom/submit`, data);
-  if (res.data.code == 0) {
+  if (res && res.data.code == 0) {
     return res.data;
   }
-  return Promise.reject(new Error(res.data.message));
+
 }
 
 // 嘉实医药提交

+ 2 - 2
src/utils/request.js

@@ -48,15 +48,15 @@ service.interceptors.request.use(
 service.interceptors.response.use(
   (res) => {
     // token 自动续期
-    if (res.data.code == -1 && res.config?.showErrorToast !== false) {
+    if (Number(res.data.code) == -1 && res.config?.showErrorToast !== false) {
       Message.error(res.data.message);
       return false;
     }
     const token = res.headers[TOKEN_HEADER_NAME.toLowerCase()];
-
     if (token) {
       setToken(token);
     }
+
     return res;
   },
   (error) => {

+ 5 - 2
src/views/material/BOMmanage/detailsPop.vue

@@ -631,8 +631,11 @@
           })
             .then(() => {
               bomSubmit({ businessId: this.currentNodeData.id }).then((res) => {
-                this.$message.success('发布成功');
-                this.getTreeData();
+                if(res.code == 0) {
+                  this.$message.success('发布成功');
+                  this.getTreeData();
+                }
+  
               });
             })
             .catch(() => {});

+ 5 - 2
src/views/material/BOMmanage/index.vue

@@ -247,8 +247,11 @@
           })
             .then(() => {
               bomSubmit({ businessId: row.id }).then((res) => {
-                this.$message.success('发布成功');
-                this.reload();
+                if(res?.code == '0') {
+                  this.$message.success('发布成功');
+                  this.reload();
+                }
+  
               });
             })
             .catch(() => {});

+ 1 - 0
vue.config.js

@@ -33,6 +33,7 @@ module.exports = {
       '/api': {
         // target: 'http://192.168.1.124:50001',
         // target: 'http://192.168.1.147:18086',
+        // target: 'http://192.168.1.176:18086',
         target: 'http://192.168.1.125:18086',
         changeOrigin: true, // 只有这个值为true的情况下 才表示开启跨域
         pathRewrite: {