From 57dcfed4504a3b79de04f13f7bd6dca0e9cef48e Mon Sep 17 00:00:00 2001 From: cwchen <1048842385@qq.com> Date: Wed, 7 Aug 2024 15:13:51 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E9=A2=86=E7=94=A8=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/construction/deviceReceive/index.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/construction/deviceReceive/index.vue b/src/views/construction/deviceReceive/index.vue index a316a55..51455b5 100644 --- a/src/views/construction/deviceReceive/index.vue +++ b/src/views/construction/deviceReceive/index.vue @@ -98,7 +98,7 @@ - + From d8078ba816820bec303424efee985c63f8b43523 Mon Sep 17 00:00:00 2001 From: haozq <1611483981@qq.com> Date: Thu, 8 Aug 2024 08:51:32 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AF=B7=E6=B1=82?= =?UTF-8?q?=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/modules/user.js | 2 +- src/utils/request.js | 7 +++++-- vue.config.js | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/store/modules/user.js b/src/store/modules/user.js index 03c3e94..9dfe2f8 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -106,7 +106,7 @@ const user = { }) }) }, - + // 退出系统 LogOut({ commit, state }) { return new Promise((resolve, reject) => { diff --git a/src/utils/request.js b/src/utils/request.js index 35c956d..b7e5c2c 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -100,7 +100,7 @@ service.interceptors.request.use(config => { if(config.headers['Content-Type']==null || config.headers['Content-Type']==''){ config.headers['Content-Type']='application/json'; - console.warn("请求类型为空"); + console.warn("请求类型为空"); } return config }, error => { @@ -116,8 +116,11 @@ service.interceptors.response.use(res => { const resultData=decryptCBC(res.data.data); res.data=JSON.parse(resultData); } + if(typeof res.data.code=='undefined'){ + res.data= res.data.data + } // 未设置状态码则默认成功状态 - const code = res.data.code || 200; + const code = res.data.code || 200; // 获取错误信息 const msg = errorCode[code] || res.data.msg || errorCode['default'] // 二进制数据则直接返回 diff --git a/vue.config.js b/vue.config.js index e62dc84..bcd4c2a 100644 --- a/vue.config.js +++ b/vue.config.js @@ -35,7 +35,7 @@ module.exports = { proxy: { // detail: https://cli.vuejs.org/config/#devserver-proxy [process.env.VUE_APP_BASE_API]: { - target: `http://127.0.0.1:18080`, + target: `http://127.0.0.1:18080/ljzhgd`, changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API]: ''