1
This commit is contained in:
31
app/store/modules/platform.js
Normal file
31
app/store/modules/platform.js
Normal file
@@ -0,0 +1,31 @@
|
||||
/**
|
||||
* 平台信息状态管理
|
||||
*/
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
currentPlatform: '-',
|
||||
platformLoginStatus: '-',
|
||||
platformLoginStatusColor: '#FF9800',
|
||||
isPlatformLoggedIn: false
|
||||
},
|
||||
mutations: {
|
||||
SET_CURRENT_PLATFORM(state, platform) {
|
||||
state.currentPlatform = platform;
|
||||
},
|
||||
SET_PLATFORM_LOGIN_STATUS(state, { status, color, isLoggedIn }) {
|
||||
state.platformLoginStatus = status;
|
||||
state.platformLoginStatusColor = color || '#FF9800';
|
||||
state.isPlatformLoggedIn = isLoggedIn || false;
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
updatePlatform({ commit }, platform) {
|
||||
commit('SET_CURRENT_PLATFORM', platform);
|
||||
},
|
||||
updatePlatformLoginStatus({ commit }, { status, color, isLoggedIn }) {
|
||||
commit('SET_PLATFORM_LOGIN_STATUS', { status, color, isLoggedIn });
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user