2023-02-23

功能完善
This commit is contained in:
2023-02-23 01:38:38 +08:00
parent ea77790d1b
commit 932ebc04c7
7 changed files with 744 additions and 636 deletions

View File

@@ -6,13 +6,16 @@ Vue.use(Vuex)
const store = new Vuex.Store({
state: {
hasLogin: false,
hasVip: false,
userInfo: ''
},
mutations: {
login(state, provider) {
console.log(provider);
if (provider && provider != undefined) {
console.log("provider",provider);
state.hasLogin = true;
state.hasVip = true;
uni.setStorage({ //缓存用户登陆状态
key: 'userInfo',
data: provider.userInfo
@@ -24,6 +27,7 @@ const store = new Vuex.Store({
},
logout(state) {
state.hasLogin = false;
state.hasVip = false;
state.userInfo = '';
uni.removeStorage({
key: 'userInfo'