From 10562a6dac1492fe3dda566a800a4fec1f6e3bca Mon Sep 17 00:00:00 2001 From: gaosp <gaosp> Date: 星期日, 14 一月 2024 15:09:34 +0800 Subject: [PATCH] Merge branch 'master' of http://www.beijingsoft.cn:9090/r/mdc-front --- src/store/modules/user.js | 19 ++++++++++++------- 1 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/store/modules/user.js b/src/store/modules/user.js index 26f4fdd..865590e 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -87,10 +87,10 @@ if (data.result === 'SUCCESS') { commit('SET_USER_INFO',data.data) this.dispatch('GetPlanList') - resolve({ code: 1, data: data }) + resolve({ code: 1, result: 'SUCCESS',data: data }) }else { removeToken() - resolve({ code: 0, msg: '鐢变簬鎮ㄩ暱鏃堕棿娌℃湁鎿嶄綔锛岃閲嶆柊鐧诲綍锛�' }) + resolve({ code: 0,result: 'SUCCESS', msg: '鐢变簬鎮ㄩ暱鏃堕棿娌℃湁鎿嶄綔锛岃閲嶆柊鐧诲綍锛�' }) } }).catch(() => { removeToken() @@ -100,11 +100,16 @@ }) }, GetPlanList ({ commit, store }) { - return getPlanList().then(data => { - if (data.result === 'SUCCESS') { - commit('SET_WORKSHOP_LIST', data.data || []) - } - return data + return new Promise((resolve,reject) => { + getPlanList().then(data => { + if (data.result === 'SUCCESS') { + commit('SET_WORKSHOP_LIST', data.data || []) + resolve({ code: 1,result: 'SUCCESS',data: data }) + } + }) + .catch(() => { + reject(error) + }) }) }, // 鐧诲嚭 -- Gitblit v1.9.3