bootstrap.js 429 B

12345678910111213
  1. import store from '@/store'
  2. import storage from '@/utils/storage'
  3. import platform from '@/core/platform'
  4. import { ACCESS_TOKEN, USER_ID } from '@/store/mutation-types'
  5. export default function Initializer() {
  6. // 当前运行的终端
  7. store.commit('SET_PLATFORM', platform)
  8. // 用户认证token
  9. store.commit('SET_TOKEN', storage.get(ACCESS_TOKEN))
  10. // 当前用户ID
  11. store.commit('SET_USER_ID', storage.get(USER_ID))
  12. }