优化
This commit is contained in:
@@ -11,7 +11,8 @@ const state = {
|
||||
setPrintName: uni.getStorageSync('setPrintName') || '',
|
||||
loginName: uni.getStorageSync('loginName') ? uni.getStorageSync('loginName') : '',
|
||||
userInfo: uni.getStorageSync('userInfo') ? uni.getStorageSync('userInfo') : '',
|
||||
saveToken: uni.getStorageSync('saveToken') || ''
|
||||
saveToken: uni.getStorageSync('saveToken') || '',
|
||||
saveIssend: uni.getStorageSync('saveIssend') || ''
|
||||
}
|
||||
const getters = {
|
||||
baseUrl: state => state.baseUrl,
|
||||
@@ -21,7 +22,8 @@ const getters = {
|
||||
setPrintName: state => state.setPrintName,
|
||||
loginName: state => state.loginName,
|
||||
userInfo: state => state.userInfo,
|
||||
saveToken: state => state.saveToken
|
||||
saveToken: state => state.saveToken,
|
||||
saveIssend: state => state.saveIssend
|
||||
}
|
||||
const actions = {
|
||||
setConfig ({commit}, res) {
|
||||
@@ -47,11 +49,16 @@ const actions = {
|
||||
delUserInfo({commit}, res) {
|
||||
uni.removeStorageSync('userInfo')
|
||||
uni.removeStorageSync('saveToken')
|
||||
uni.removeStorageSync('saveIssend')
|
||||
commit(types.DEL_USER_INFO, res)
|
||||
},
|
||||
saveToken({commit}, res) {
|
||||
uni.setStorageSync('saveToken', res)
|
||||
commit(types.SAVE_TOKEN, res)
|
||||
},
|
||||
saveIssend({commit}, res) {
|
||||
uni.setStorageSync('saveIssend', res)
|
||||
commit(types.SAVE_ISSEND, res)
|
||||
}
|
||||
}
|
||||
const mutations = {
|
||||
@@ -74,9 +81,13 @@ const mutations = {
|
||||
[types.DEL_USER_INFO] (state, res) {
|
||||
state.userInfo = res
|
||||
state.saveToken = res
|
||||
state.saveIssend = res
|
||||
},
|
||||
[types.SAVE_TOKEN] (state, res) {
|
||||
state.saveToken = res
|
||||
},
|
||||
[types.SAVE_ISSEND] (state, res) {
|
||||
state.saveIssend = res
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user