From b7d451c91ec40bee70f23b1e2cf6a8797643faef Mon Sep 17 00:00:00 2001
From: doum <doum>
Date: 星期六, 25 四月 2026 15:18:58 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
app/store/index.js | 30 ++++++++++++++++++++----------
1 files changed, 20 insertions(+), 10 deletions(-)
diff --git a/app/store/index.js b/app/store/index.js
index 9441f1f..2285c39 100644
--- a/app/store/index.js
+++ b/app/store/index.js
@@ -3,30 +3,40 @@
Vue.use(Vuex)
const userInfo = uni.getStorageSync('userInfo');
+const token = uni.getStorageSync('token');
const store = new Vuex.Store({
state: {
- userInfo: userInfo || null // 鐢ㄦ埛淇℃伅
+ userInfo: userInfo || null,
+ token: token || null // token
},
mutations: {
- // 璁剧疆鐢ㄦ埛淇℃伅
setUserInfo(state, val) {
state.userInfo = val
uni.setStorageSync('userInfo', val);
+ },
+ setToken(state, val) {
+ state.token = val
+ uni.setStorageSync('token', val);
+ },
+ clearAll(state) {
+ state.userInfo = null
+ state.token = null
+ uni.clearStorageSync()
}
},
actions: {
// 鑾峰彇鐘舵�侀珮搴�
- getHeight(context) {
- let res = uni.getMenuButtonBoundingClientRect()
- let status = uni.getSystemInfoSync()
- var height = res.height
- let statusbarHeight = status.statusBarHeight
- let navHeight = res.height + (res.top - statusbarHeight) * 2;
- context.commit('setHeight', { statusbarHeight, navHeight, height })
- }
+ // getHeight(context) {
+ // let res = uni.getMenuButtonBoundingClientRect()
+ // let status = uni.getSystemInfoSync()
+ // var height = res.height
+ // let statusbarHeight = status.statusBarHeight
+ // let navHeight = res.height + (res.top - statusbarHeight) * 2;
+ // context.commit('setHeight', { statusbarHeight, navHeight, height })
+ // }
}
})
--
Gitblit v1.9.3