sass警告
This commit is contained in:
@@ -93,6 +93,12 @@ export interface RootState {
|
||||
*/
|
||||
showSettings: boolean
|
||||
settingsTab: string
|
||||
|
||||
/**
|
||||
* 邀请码 — 从 URL 参数 invite_code 中提取
|
||||
* 登录成功后自动清空,避免重复发送
|
||||
*/
|
||||
inviteCode: string
|
||||
}
|
||||
|
||||
export default createStore<RootState>({
|
||||
@@ -117,6 +123,7 @@ export default createStore<RootState>({
|
||||
userInfo: null,
|
||||
showSettings: false,
|
||||
settingsTab: 'account',
|
||||
inviteCode: '',
|
||||
},
|
||||
getters: {
|
||||
getAppName: (state) => state.appName,
|
||||
@@ -177,6 +184,9 @@ export default createStore<RootState>({
|
||||
SET_SETTINGS_TAB(state, tab: string) {
|
||||
state.settingsTab = tab
|
||||
},
|
||||
SET_INVITE_CODE(state, code: string) {
|
||||
state.inviteCode = code
|
||||
},
|
||||
},
|
||||
actions: {
|
||||
updateAppName({ commit }, name: string) {
|
||||
@@ -219,6 +229,19 @@ export default createStore<RootState>({
|
||||
commit('SET_ROUTES_LOADED', true)
|
||||
},
|
||||
|
||||
/**
|
||||
* 静默刷新路由菜单数据(不重新注册路由,只更新菜单显示和权限状态)
|
||||
* 每次页面切换时由路由守卫调用,用于更新 accessible 权限信息
|
||||
*/
|
||||
async refreshDynamicMenus({ commit }) {
|
||||
try {
|
||||
const menus = await fetchUserRoutes()
|
||||
commit('SET_DYNAMIC_MENUS', menus)
|
||||
} catch (err) {
|
||||
console.error('[store] 刷新路由菜单数据失败', err)
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 登出:重置状态(不再操作 localStorage,登录状态由 Cookie 管理)
|
||||
* 注意:动态路由不清除,与登录状态无关
|
||||
|
||||
Reference in New Issue
Block a user