2023-02-22
业务功能完善
This commit is contained in:
@@ -6,14 +6,14 @@ Vue.use(Vuex)
|
||||
const store = new Vuex.Store({
|
||||
state: {
|
||||
hasLogin: false,
|
||||
userInfo:''
|
||||
userInfo: ''
|
||||
},
|
||||
mutations: {
|
||||
login(state, provider) {
|
||||
console.log(provider);
|
||||
if (provider && provider!=undefined){
|
||||
state.hasLogin = true;
|
||||
uni.setStorage({//缓存用户登陆状态
|
||||
console.log(provider);
|
||||
if (provider && provider != undefined) {
|
||||
state.hasLogin = true;
|
||||
uni.setStorage({ //缓存用户登陆状态
|
||||
key: 'userInfo',
|
||||
data: provider.userInfo
|
||||
})
|
||||
@@ -26,8 +26,8 @@ const store = new Vuex.Store({
|
||||
state.hasLogin = false;
|
||||
state.userInfo = '';
|
||||
uni.removeStorage({
|
||||
key: 'userInfo'
|
||||
})
|
||||
key: 'userInfo'
|
||||
})
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
|
||||
Reference in New Issue
Block a user