From 10c02576d9a8c2ef2b83da6367011698ba7e1f78 Mon Sep 17 00:00:00 2001 From: chutingting Date: Thu, 9 Nov 2023 18:16:45 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8C=BA=E5=88=86=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apis/home.js | 28 +- src/apis/secretKey.js | 13 + src/layout/index.vue | 45 +- src/router/index.ts | 22 + src/utils/request.js | 12 +- src/views/apiManage/index.vue | 14 +- src/views/apiManage/model.vue | 84 +- src/views/home/index.vue | 44 +- src/views/privatization/index.vue | 10 +- src/views/secretKey/index.vue | 43 + src/views/template/index.vue | 18 +- src/views/video/index.vue | 148 + yarn.lock | 11922 ++++++++++++++-------------- 13 files changed, 6365 insertions(+), 6038 deletions(-) create mode 100644 src/apis/secretKey.js create mode 100644 src/views/secretKey/index.vue create mode 100644 src/views/video/index.vue diff --git a/src/apis/home.js b/src/apis/home.js index dbf6cca..f6f31b2 100644 --- a/src/apis/home.js +++ b/src/apis/home.js @@ -11,6 +11,19 @@ export function getUser() { }) } +/** + * @description:用户角色 + * @param + * @return: + */ +export function localDeployApi() { + return request({ + url: `/localDeploy`, + method: 'get', + }) +} + + /** * @description: api 剩余时长 * @param @@ -33,4 +46,17 @@ export function privateDeployAdminCurrent() { url: `/serviceInfo/privateDeployAdminCurrent`, method: 'get', }) -} \ No newline at end of file +} + +/** + * @description: 视频制作统计 + * @param + * @return: + */ +export function videoListApi(pageNum, pageSize) { + return request({ + url: `/serviceInfo/privateDeployAdminCurrentVideoRecords?pageNum=${pageNum}&pageSize=${pageSize}`, + method: 'get', + }) +} + diff --git a/src/apis/secretKey.js b/src/apis/secretKey.js new file mode 100644 index 0000000..26bb873 --- /dev/null +++ b/src/apis/secretKey.js @@ -0,0 +1,13 @@ + +import request from "@/utils/request.js"; +/** + * @description: 密钥查看 + * @param + * @return: + */ +export function secretKeyApi() { + return request({ + url: `/thirdPartyApi/current`, + method: 'get', + }) +} \ No newline at end of file diff --git a/src/layout/index.vue b/src/layout/index.vue index d18918b..6dfa2df 100644 --- a/src/layout/index.vue +++ b/src/layout/index.vue @@ -21,18 +21,30 @@ 首页 - - - API接入方管理 - - - - 私有化客户管理 - - - - 模版管理 - + + + + API接入方管理 + + + + 私有化客户管理 + + + @@ -98,6 +110,10 @@ const AccessToken = localStorage.getItem("AccessToken"); // 当前语言状态与国际化组件 const { locale } = useI18n(); const lanChange = ref(locale); +const isLogin = ref(false); +const isAdmin = localStorage.getItem("isAdmin") +const localDeploy = localStorage.getItem("localDeploy") + function logout() { const msg = (lanChange.value as string) == "zh-cn" @@ -112,6 +128,7 @@ function logout() { }).then(() => { logoutApi().then(res => { userInfoPinia.loginOut(); + localStorage.clear() router.push(`/login`); }) localStorage.removeItem("AccessToken"); @@ -165,6 +182,9 @@ async function getMenuNavFunc() { try { const res = await getMenuNavApi(); MenuList.value = res.data.menuList; + if (res.code === 200) { + isLogin.value = true + } } catch (error) { console.log(error); } @@ -176,7 +196,6 @@ const showChildrenRouter = ref(""); //#endregion ------------------------------------ -const isLogin = ref(false); diff --git a/src/router/index.ts b/src/router/index.ts index 4ccde17..7ed83b7 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -200,6 +200,28 @@ export const constantRoutes: RouteRecordRaw[] = [ name: "ruleListMangage.title", }, }, + { + path: "/secretKey", + component: () => import("@/views/secretKey/index.vue"), + name: "secretKey", + meta: { + title: "secretKey", + icon: "homepage", + affix: true, + name: "ruleListMangage.title", + }, + }, + { + path: "/video", + component: () => import("@/views/video/index.vue"), + name: "video", + meta: { + title: "video", + icon: "homepage", + affix: true, + name: "ruleListMangage.title", + }, + }, ], } ]; diff --git a/src/utils/request.js b/src/utils/request.js index 2cd74ed..c4e4639 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -28,10 +28,10 @@ request.interceptors.request.use( function (config) { // // 给所有授权的请求提供token - // const AccessToken = localStorage.getItem("AccessToken") - // if (AccessToken) { - // config.headers.token = AccessToken - // } + const AccessToken = localStorage.getItem("AccessToken") + if (AccessToken) { + config.headers.token = AccessToken + } return config }, function (error) { @@ -59,7 +59,7 @@ request.interceptors.response.use( } let code = response.data.code // 当token无效(过期或损坏)时 1053为未登录 - if (code == 1052 || code == 1053) { + if (code == 1052 || code == 1053 || code === 701) { // localStorage.removeItem("AccessToken"); router.push("/login"); // ElMessage.error("登录过期,请重新登录!"); @@ -78,7 +78,7 @@ request.interceptors.response.use( ); // 其他错误 } else { - return Promise.reject(response.data) + return Promise.reject(response.data.message) } } else { // 正常返回 diff --git a/src/views/apiManage/index.vue b/src/views/apiManage/index.vue index c81d489..f37f38a 100644 --- a/src/views/apiManage/index.vue +++ b/src/views/apiManage/index.vue @@ -67,7 +67,7 @@ >查看密钥 {{ scope.row.mallUserInfo ? '修改登录账号' : '新增登录账号'}} 设置时长 - 关联模版 + 关联模版 @@ -143,7 +143,7 @@ - + @@ -171,8 +171,8 @@ - - + +