init
This commit is contained in:
13
fuintUniapp/core/bootstrap.js
vendored
Normal file
13
fuintUniapp/core/bootstrap.js
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
import store from '@/store'
|
||||
import storage from '@/utils/storage'
|
||||
import { getPlatform } from '@/utils/app'
|
||||
import { ACCESS_TOKEN, USER_ID } from '@/store/mutation-types'
|
||||
|
||||
export default function Initializer() {
|
||||
// 当前运行的终端
|
||||
store.commit('SET_PLATFORM', getPlatform())
|
||||
// 用户认证token
|
||||
store.commit('SET_TOKEN', storage.get(ACCESS_TOKEN))
|
||||
// 当前用户ID
|
||||
store.commit('SET_USER_ID', storage.get(USER_ID))
|
||||
}
|
||||
Reference in New Issue
Block a user