mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-12 11:19:56 +00:00
perf: 优化清除缓存数据
This commit is contained in:
parent
2bebad1112
commit
cdefe9d4a7
19
resources/assets/js/store/actions.js
vendored
19
resources/assets/js/store/actions.js
vendored
@ -630,7 +630,7 @@ export default {
|
|||||||
* @param info
|
* @param info
|
||||||
* @returns {Promise<unknown>}
|
* @returns {Promise<unknown>}
|
||||||
*/
|
*/
|
||||||
saveUserInfo({state, dispatch}, info) {
|
saveUserInfoBase({state, dispatch}, info) {
|
||||||
return new Promise(async resolve => {
|
return new Promise(async resolve => {
|
||||||
const userInfo = $A.cloneJSON(info);
|
const userInfo = $A.cloneJSON(info);
|
||||||
userInfo.userid = $A.runNum(userInfo.userid);
|
userInfo.userid = $A.runNum(userInfo.userid);
|
||||||
@ -653,6 +653,21 @@ export default {
|
|||||||
chatUrl: $A.apiUrl('../api/dialog/msg/sendfiles') + `?token=${state.userToken}`,
|
chatUrl: $A.apiUrl('../api/dialog/msg/sendfiles') + `?token=${state.userToken}`,
|
||||||
});
|
});
|
||||||
//
|
//
|
||||||
|
resolve()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新会员信息
|
||||||
|
* @param state
|
||||||
|
* @param dispatch
|
||||||
|
* @param info
|
||||||
|
* @returns {Promise<unknown>}
|
||||||
|
*/
|
||||||
|
saveUserInfo({state, dispatch}, info) {
|
||||||
|
return new Promise(async resolve => {
|
||||||
|
await dispatch("saveUserInfoBase", info);
|
||||||
|
//
|
||||||
dispatch("getBasicData", null);
|
dispatch("getBasicData", null);
|
||||||
if (state.userId > 0) {
|
if (state.userId > 0) {
|
||||||
state.cacheUserBasic = state.cacheUserBasic.filter(({userid}) => userid !== state.userId)
|
state.cacheUserBasic = state.cacheUserBasic.filter(({userid}) => userid !== state.userId)
|
||||||
@ -851,7 +866,7 @@ export default {
|
|||||||
await $A.IDBSet("cacheEmojis", state.cacheEmojis);
|
await $A.IDBSet("cacheEmojis", state.cacheEmojis);
|
||||||
|
|
||||||
// userInfo
|
// userInfo
|
||||||
dispatch("saveUserInfo", $A.isJson(userInfo) ? userInfo : state.userInfo).then(resolve);
|
dispatch("saveUserInfoBase", $A.isJson(userInfo) ? userInfo : state.userInfo).then(resolve);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
resolve()
|
resolve()
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user