diff --git a/src/api/user.ts b/src/api/user.ts index 096b565..d8dd9be 100644 --- a/src/api/user.ts +++ b/src/api/user.ts @@ -251,6 +251,23 @@ export const updateUserUIconfigInfoService = (Data: UserUISettings, token:string }) } +export const getUserTokenCode = (Data) => { + return request.get('/user/get_token_code', { + headers: { + 'Authorization': `Bearer ${Data.token}`, // 使用 Bearer 认证方式 + } + }) +} + +export const getTokenByCode = (Data) => { + let url = '/user/get_token_by_code' + "?code=" + Data.code + return request.get(url, { + headers: { + 'Authorization': `Bearer ${Data.token}`, // 使用 Bearer 认证方式 + } + }) +} + export const fetchUserData = () => { return { diff --git a/src/components/menu.ts b/src/components/menu.ts index 41342de..0482598 100644 --- a/src/components/menu.ts +++ b/src/components/menu.ts @@ -232,6 +232,12 @@ export const menuData: Menus[] = [ index: '/ai-ppt', title: '智能PPT生成', }, + { + id: '59', + icon: 'ChatDotSquare', + index: '/project-select', + title: '项目选择', + }, { id: '6', icon: 'DocumentAdd', diff --git a/src/router/index.ts b/src/router/index.ts index c1f4b45..31eea60 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -87,6 +87,25 @@ const routes: RouteRecordRaw[] = [ component: () => import(/* webpackChunkName: "ai-ppt" */ '../views/system/ai-ppt.vue'), }, + { + path: '/project-select', + name: 'project-select', + meta: { + title: '项目选择', + permiss: '59', + }, + component: () => import(/* webpackChunkName: "project-select" */ '../views/system/project-select.vue'), + + }, + { + path: '/callback', + name: 'callback', + meta: { + title: '回调地址', + noAuth: true, + }, + component: () => import(/* webpackChunkName: "callback" */ '../views/system/callback.vue'), + }, { path: '/gen-prompt', name: 'gen-prompt', diff --git a/src/store/permiss.ts b/src/store/permiss.ts index 4659cf0..46574a0 100644 --- a/src/store/permiss.ts +++ b/src/store/permiss.ts @@ -55,9 +55,10 @@ export const usePermissStore = defineStore("permiss", { "56", //文件管理 "57", //智能ppt生成 "58", //知识库管理 + "59", //项目选择 "71", //用户功能管理 ], - user: ["0", "8", "7", "9", "51" ,"53","55" ,"56", "57", "58", "61", "71"], + user: ["0", "8", "7", "9", "51" ,"53","55" ,"56", "57", "58", "59", "61", "71"], }, }; }, diff --git a/src/views/pages/login.vue b/src/views/pages/login.vue index 973845d..3cab52d 100644 --- a/src/views/pages/login.vue +++ b/src/views/pages/login.vue @@ -82,7 +82,7 @@ import { GetUserInfoService } from "@/api/user"; import { UserToken } from "@/types/user"; import { usePermissStore } from "@/store/permiss"; import Cookies from 'js-cookie'; -import {getThirdPartyUUID,getThirdPartyLoginStatus,getGithubLoginUrl,getQQLoginUrl,getThirdPartyLoginUrl} from "@/api/user"; +import {getThirdPartyUUID,getThirdPartyLoginStatus,getThirdPartyLoginUrl} from "@/api/user"; // 从本地存储获取登录参数 const lgStr = localStorage.getItem("login-param"); const defParam = lgStr ? JSON.parse(lgStr) : null; diff --git a/src/views/system/callback.vue b/src/views/system/callback.vue new file mode 100644 index 0000000..2a71091 --- /dev/null +++ b/src/views/system/callback.vue @@ -0,0 +1,68 @@ + + \ No newline at end of file diff --git a/src/views/system/project-select.vue b/src/views/system/project-select.vue new file mode 100644 index 0000000..8d99285 --- /dev/null +++ b/src/views/system/project-select.vue @@ -0,0 +1,126 @@ + + + + + \ No newline at end of file