| | |
| | | import { setStore, getStore, removeStore } from 'utils/store'; |
| | | import website from '@/config/website'; |
| | | import { setStore, getStore, removeStore } from 'utils/store' |
| | | import website from '@/config/website' |
| | | |
| | | const common = { |
| | | state: { |
| | |
| | | }, |
| | | mutations: { |
| | | SET_LANGUAGE: (state, language) => { |
| | | state.language = language; |
| | | state.language = language |
| | | setStore({ |
| | | name: 'language', |
| | | content: state.language, |
| | | }); |
| | | }) |
| | | }, |
| | | SET_COLLAPSE: state => { |
| | | state.isCollapse = !state.isCollapse; |
| | | state.isCollapse = !state.isCollapse |
| | | }, |
| | | SET_IS_MENU: (state, menu) => { |
| | | state.isMenu = menu; |
| | | state.isMenu = menu |
| | | }, |
| | | SET_IS_REFRESH: (state, refresh) => { |
| | | state.isRefresh = refresh; |
| | | state.isRefresh = refresh |
| | | }, |
| | | SET_IS_SEARCH: (state, search) => { |
| | | state.isSearch = search; |
| | | state.isSearch = search |
| | | }, |
| | | SET_FULLSCREN: state => { |
| | | state.isFullScren = !state.isFullScren; |
| | | state.isFullScren = !state.isFullScren |
| | | }, |
| | | SET_LOCK: state => { |
| | | state.isLock = true; |
| | | state.isLock = true |
| | | setStore({ |
| | | name: 'isLock', |
| | | content: state.isLock, |
| | | type: 'session', |
| | | }); |
| | | }) |
| | | }, |
| | | SET_COLOR_NAME: (state, colorName) => { |
| | | state.colorName = colorName; |
| | | state.colorName = colorName |
| | | setStore({ |
| | | name: 'colorName', |
| | | content: state.colorName, |
| | | }); |
| | | }) |
| | | }, |
| | | SET_THEME_NAME: (state, themeName) => { |
| | | state.themeName = themeName; |
| | | state.themeName = themeName |
| | | setStore({ |
| | | name: 'themeName', |
| | | content: state.themeName, |
| | | }); |
| | | }) |
| | | }, |
| | | SET_LOCK_PASSWD: (state, lockPasswd) => { |
| | | state.lockPasswd = lockPasswd; |
| | | state.lockPasswd = lockPasswd |
| | | setStore({ |
| | | name: 'lockPasswd', |
| | | content: state.lockPasswd, |
| | | type: 'session', |
| | | }); |
| | | }) |
| | | }, |
| | | CLEAR_LOCK: state => { |
| | | state.isLock = false; |
| | | state.lockPasswd = ''; |
| | | state.isLock = false |
| | | state.lockPasswd = '' |
| | | removeStore({ |
| | | name: 'lockPasswd', |
| | | type: 'session', |
| | | }); |
| | | }) |
| | | removeStore({ |
| | | name: 'isLock', |
| | | type: 'session', |
| | | }); |
| | | }) |
| | | }, |
| | | }, |
| | | }; |
| | | export default common; |
| | | } |
| | | export default common |