无人机管理后台前端(已迁走)
zrj
2024-08-29 ced3313bad76cf95d86dcf23f25ea3b143e09290
src/main.js
@@ -12,6 +12,9 @@
import '@smallwei/avue/lib/index.css';
import crudCommon from '@/mixins/crud.js';
import { getScreen } from './utils/util';
import { getUrlParams } from './utils/validate'
import { setToken, setRefreshToken } from './utils/auth';
import { setStore } from './utils/store';
import './permission';
import error from './error';
import avueUeditor from 'avue-plugin-ueditor';
@@ -27,6 +30,16 @@
// 业务组件
import tenantPackage from './views/system/tenantpackage.vue';
// 获取url中是否存在token
const urlParams = getUrlParams(window.location.href)
if (urlParams?.token) {
  // 设置cookie和localStorage
  setStore('saber-token', urlParams.token)
  setToken(urlParams.token)
  setRefreshToken(urlParams.token)
}
window.$crudCommon = crudCommon;
window.axios = axios;
const app = createApp(App);