From d91893dbd49538d312e299c1cc507a7792abd7d7 Mon Sep 17 00:00:00 2001 From: yangys <y_ys79@sina.com> Date: 星期日, 14 一月 2024 14:20:25 +0800 Subject: [PATCH] 设备类型假如修改删除 --- 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