From 38b3dbe5cefa0b0a917dff9fc75d27448ec401a2 Mon Sep 17 00:00:00 2001 From: fangyunong Date: Tue, 8 Jul 2025 20:56:11 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E7=99=BB=E5=BD=95=E4=B8=89=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env | 3 --- .env.development | 2 ++ .env.production | 3 +++ src/main.ts | 8 -------- src/router/index.ts | 2 +- src/views/layout/components/LayoutHeader.vue | 7 +++---- src/views/login/OauthCallBack.vue | 15 ++++++--------- src/views/login/index.vue | 6 +++--- 8 files changed, 18 insertions(+), 28 deletions(-) delete mode 100644 .env create mode 100644 .env.development create mode 100644 .env.production diff --git a/.env b/.env deleted file mode 100644 index 54844f6..0000000 --- a/.env +++ /dev/null @@ -1,3 +0,0 @@ -VITE_API_BASE_URL=http://47.94.224.191:8080 - -VITE_FRONT_DEVELOP=http://localhost:5173 \ No newline at end of file diff --git a/.env.development b/.env.development new file mode 100644 index 0000000..e81618f --- /dev/null +++ b/.env.development @@ -0,0 +1,2 @@ +VITE_API_BASE_URL=http://47.94.224.191:8080 +VITE_FRONTEND_CALLBACK_URL=http://localhost:5173/callback \ No newline at end of file diff --git a/.env.production b/.env.production new file mode 100644 index 0000000..cb31c35 --- /dev/null +++ b/.env.production @@ -0,0 +1,3 @@ +# .env.production (生产环境) +VITE_API_BASE_URL=http://47.94.224.191:8080 +VITE_FRONTEND_CALLBACK_URL=http://47.94.224.191:8080/callback # 或者你的生产环境前端URL \ No newline at end of file diff --git a/src/main.ts b/src/main.ts index cc66531..a1770a4 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,4 +1,3 @@ -import { APP_ID, END_POINT }from '@/utils/secret'; // 样式引入 import "@/assets/styles/reset.scss"; import "@/assets/styles/common.scss"; @@ -12,7 +11,6 @@ import 'vfonts/Lato.css'// 通用字体 import 'vfonts/FiraCode.css'// 等宽字体 import 'virtual:svg-icons-register'; //SVG精灵图册 // 登录授权相关 -import { createLogto, LogtoConfig } from '@logto/vue'; import { createApp } from 'vue' import App from './App.vue'; // 全局组件 @@ -24,12 +22,6 @@ const app = createApp(App); app.component('svg-icon',SvgIcon); //图标组件 app.use(LsComponent); //零枢封装组件 -// 鉴权 -const config: LogtoConfig = { - endpoint: END_POINT, - appId: APP_ID, -}; -app.use(createLogto, config); app.use(pinia); app.use(router); diff --git a/src/router/index.ts b/src/router/index.ts index 14a6efa..5062e49 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -13,7 +13,7 @@ import Dict from '@/views/system/dict/index.vue'; //用户字典 import GlobalSys from '@/views/system/globalSys/index.vue'; //全局参数 import { getToken } from "@/utils/auth"; -const whiteList = ["/callback",'/layout/dict','/layout/globalSys']; +const whiteList = ["/callback"]; const routes: Array = [ { diff --git a/src/views/layout/components/LayoutHeader.vue b/src/views/layout/components/LayoutHeader.vue index 850ede5..a8cc9f8 100644 --- a/src/views/layout/components/LayoutHeader.vue +++ b/src/views/layout/components/LayoutHeader.vue @@ -19,7 +19,7 @@