上饶市警务平台后台管理前端
zhongrj
2023-01-12 a855bc6ae27cec13077bae5a137c93b6c4557f30
src/main.js
@@ -7,7 +7,7 @@
import './error'; // 日志
import './cache';//页面缓存
import store from './store';
import {loadStyle} from './util/util'
import { loadStyle } from './util/util'
import * as urls from '@/config/env';
import Element from 'element-ui';
import {
@@ -26,6 +26,24 @@
// 业务组件
import tenantPackage from './views/system/tenantpackage';
import Cookies from 'js-cookie'
// 携带token跳转页面设置
const tokenLength = window.location.href.indexOf('=');
if(tokenLength>0){
  //取“=”之后的token
  let z = window.location.href.substring(tokenLength + 1)
  // 把token存进B系统
  let obj = {
    dataType: typeof (z),
    content: z,
    datetime: new Date().getTime()
  }
  window.localStorage.setItem('saber-token', JSON.stringify(obj));
  Cookies.set('saber-access-token', z)
}
// 注册全局crud驱动
window.$crudCommon = crudCommon;
// 加载Vue拓展