From ced3313bad76cf95d86dcf23f25ea3b143e09290 Mon Sep 17 00:00:00 2001
From: zrj <646384940@qq.com>
Date: Thu, 29 Aug 2024 20:46:42 +0800
Subject: [PATCH] Merge branch 'master' of http://139.196.74.78:10010/r/drone/drone-web-manage

---
 src/main.js |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/src/main.js b/src/main.js
index 09c2e9f..1e6aa65 100644
--- a/src/main.js
+++ b/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);

--
Gitblit v1.9.3