| | |
| | | "@typescript-eslint/parser": "^5.8.1", |
| | | "@vitejs/plugin-vue": "^1.2.4", |
| | | "@vue/compiler-sfc": "^3.0.5", |
| | | "cesium": "^1.108.0", |
| | | "cesium": "1.108.0", |
| | | "crypto-js": "^4.1.1", |
| | | "eslint": "^7.30.0", |
| | | "eslint-config-standard": "^16.0.3", |
| | |
| | | maximumLevel: 50, |
| | | }) |
| | | const dimension = ref(3) |
| | | const store = useMyStore() |
| | | let store = null |
| | | const _init = () => { |
| | | store = useMyStore() |
| | | |
| | | // Cesium Token |
| | | const cesiumToken = import.meta.env.VITE_CESIUM_TOKEN |
| | | Cesium.Ion.defaultAccessToken = cesiumToken |
| | |
| | | import { ELocalStorageKey, ERouterName } from './types/enums' |
| | | import router from '/@/router/index' |
| | | |
| | | const whiteList = ['/' + ERouterName.LOGIN] // 设置白名单 |
| | | const whiteList = ['/' + ERouterName.LOGIN, '/' + ERouterName.PILOT] // 设置白名单 |
| | | |
| | | router.beforeEach(async (to, from, next) => { |
| | | // 确定用户是否已登录过,存在Token |
| | |
| | | }, |
| | | // // 首页 登陆页面 |
| | | { |
| | | path: '/' + ERouterName.PILOT, |
| | | name: ERouterName.PILOT, |
| | | component: () => import('/@/pages/page-pilot/pilot-index.vue') |
| | | }, |
| | | |
| | | { |
| | | path: '/' + ERouterName.LOGIN, |
| | | name: ERouterName.LOGIN, |
| | | component: () => import('/@/pages/page-web/index.vue') |
| | | }, |
| | | |
| | | // members, devices |
| | | { |
| | | path: '/' + ERouterName.HOME, |
| | |
| | | const TokenKey = 'sword-access-token' |
| | | const RefreshTokenKey = 'sword-refresh-token' |
| | | |
| | | export function getToken() { |
| | | return Cookies.get(TokenKey, { path: '/' }) |
| | | export function getToken () { |
| | | return Cookies.get(TokenKey, { path: '/' }) |
| | | } |
| | | |
| | | export function setToken(token : string) { |
| | | return Cookies.set(TokenKey, token, { path: '/' }) |
| | | export function setToken (token : string) { |
| | | return Cookies.set(TokenKey, token, { path: '/' }) |
| | | } |
| | | |
| | | export function getRefreshToken() { |
| | | return Cookies.get(RefreshTokenKey) |
| | | export function getRefreshToken () { |
| | | return Cookies.get(RefreshTokenKey) |
| | | } |
| | | |
| | | export function setRefreshToken(token : string) { |
| | | return Cookies.set(RefreshTokenKey, token) |
| | | export function setRefreshToken (token : string) { |
| | | return Cookies.set(RefreshTokenKey, token) |
| | | } |
| | | |
| | | export function removeToken() { |
| | | return Cookies.remove(TokenKey) |
| | | export function removeToken () { |
| | | return Cookies.remove(TokenKey) |
| | | } |
| | | |
| | | export function removeRefreshToken() { |
| | | return Cookies.remove(RefreshTokenKey) |
| | | } |
| | | export function removeRefreshToken () { |
| | | return Cookies.remove(RefreshTokenKey) |
| | | } |
| | |
| | | const onServerPrefetch: typeof import('vue')['onServerPrefetch'] |
| | | const onUnmounted: typeof import('vue')['onUnmounted'] |
| | | const onUpdated: typeof import('vue')['onUpdated'] |
| | | const onWatcherCleanup: typeof import('vue')['onWatcherCleanup'] |
| | | const provide: typeof import('vue')['provide'] |
| | | const reactive: typeof import('vue')['reactive'] |
| | | const readonly: typeof import('vue')['readonly'] |
| | |
| | | const useAttrs: typeof import('vue')['useAttrs'] |
| | | const useCssModule: typeof import('vue')['useCssModule'] |
| | | const useCssVars: typeof import('vue')['useCssVars'] |
| | | const useId: typeof import('vue')['useId'] |
| | | const useLink: typeof import('vue-router')['useLink'] |
| | | const useModel: typeof import('vue')['useModel'] |
| | | const useRoute: typeof import('vue-router')['useRoute'] |
| | | const useRouter: typeof import('vue-router')['useRouter'] |
| | | const useSlots: typeof import('vue')['useSlots'] |
| | | const useTemplateRef: typeof import('vue')['useTemplateRef'] |
| | | const watch: typeof import('vue')['watch'] |
| | | const watchEffect: typeof import('vue')['watchEffect'] |
| | | const watchPostEffect: typeof import('vue')['watchPostEffect'] |
| | |
| | | // for type re-export |
| | | declare global { |
| | | // @ts-ignore |
| | | export type { Component, ComponentPublicInstance, ComputedRef, InjectionKey, PropType, Ref, VNode, WritableComputedRef } from 'vue' |
| | | export type { Component, ComponentPublicInstance, ComputedRef, DirectiveBinding, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, MaybeRef, MaybeRefOrGetter, VNode, WritableComputedRef } from 'vue' |
| | | import('vue') |
| | | } |