From 761197b8d294949c6cceea9df442a3d9ca0f1b63 Mon Sep 17 00:00:00 2001 From: XiaoXinPro 14 IAH5R <568170040@qq.com> Date: Wed, 25 Oct 2023 17:19:10 +0800 Subject: [PATCH 1/2] upload --- .env.development | 2 +- src/layout/index.vue | 10 +-- src/router/index.ts | 100 ++++---------------------- src/types/auto-imports.d.ts | 2 - src/utils/request copy.js | 67 ----------------- src/views/mangage/keyCheck.vue | 128 +++++++++++++++++++++++++++++++++ 6 files changed, 148 insertions(+), 161 deletions(-) delete mode 100644 src/utils/request copy.js create mode 100644 src/views/mangage/keyCheck.vue diff --git a/.env.development b/.env.development index a42f23a..93cbbc3 100644 --- a/.env.development +++ b/.env.development @@ -6,5 +6,5 @@ NODE_ENV='development' VITE_APP_TITLE = 'Metavatar-PC' VITE_APP_PORT = 3000 ## VITE_APP_BASE_API = 'https://photo.metavatar.cc/C' -VITE_APP_BASE_API = 'https://test.metavatar.cc/C' +VITE_APP_BASE_API = 'https://mtest.metavatar.cc/A' diff --git a/src/layout/index.vue b/src/layout/index.vue index 3eee778..daac857 100644 --- a/src/layout/index.vue +++ b/src/layout/index.vue @@ -18,28 +18,28 @@ {{ $t("modelMangage.title") }} -
+
{{ $t("businessMangage.title") }}
-
+
{{ $t("keyMangage.title") }}
-
+
{{ $t("priceMangage.title") }}
-
+
@@ -47,7 +47,7 @@
-
+
diff --git a/src/router/index.ts b/src/router/index.ts index 4f168d0..cbd1ad7 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -12,99 +12,27 @@ export const constantRoutes: RouteRecordRaw[] = [ meta: { hidden: true }, name: "login", }, + { path: "/signSucceed", component: () => import("@/views/signSucceed/index.vue"), meta: { hidden: true }, }, - // 创建视频 - { - path: "/", - component: Layout, - redirect: "/createVideo", - children: [ - { - path: "createVideo", - component: () => import("@/views/createVideo/index.vue"), - name: "createVideo", - meta: { - title: "createVideo", - icon: "homepage", - affix: true, - name: "createVideo.title", - }, - }, - ], - }, - // 视频列表 - { - path: "/", - component: Layout, - redirect: "/myCreating", - children: [ - { - path: "myCreating", - component: () => import("@/views/myCreating/index.vue"), - name: "myCreating", - meta: { - title: "myCreating", - icon: "homepage", - affix: true, - name: "myCreating.title", - }, - }, - ], - }, - { - path: "/", - component: Layout, - redirect: "/myStore", - children: [ - { - path: "myStore", - component: () => import("@/views/myStore/index.vue"), - name: "myStore", - meta: { - title: "myStore", - icon: "homepage", - affix: true, - name: "myStore.title", - }, - }, - ], - }, - { - path: "/", - component: Layout, - redirect: "/myAPI", - children: [ - { - path: "myAPI", - component: () => import("@/views/myAPI/index.vue"), - name: "myAPI", - meta: { - title: "myAPI", - icon: "homepage", - affix: true, - name: "API.title", - }, - }, - ], - }, + { path: "/", component: Layout, - redirect: "/moveImg", + redirect: "/model", children: [ { - path: "moveImg", - component: () => import("@/views/moveImg/index.vue"), - name: "moveImg", + path: "model", + component: () => import("@/views/mangage/model.vue"), + name: "model", meta: { - title: "moveImg", + title: "model", icon: "homepage", affix: true, - name: "moveImg.title", + name: "modelMangage.title", }, }, ], @@ -112,17 +40,17 @@ export const constantRoutes: RouteRecordRaw[] = [ { path: "/", component: Layout, - redirect: "/model", + redirect: "/keyCheck", children: [ { - path: "model", - component: () => import("@/views/mangage/model.vue"), - name: "model", + path: "keyCheck", + component: () => import("@/views/mangage/keyCheck.vue"), + name: "keyCheck", meta: { - title: "model", + title: "keyCheck", icon: "homepage", affix: true, - name: "modelMangage.title", + name: "keyMangage.title", }, }, ], diff --git a/src/types/auto-imports.d.ts b/src/types/auto-imports.d.ts index e5c7bdb..9ea2d5d 100644 --- a/src/types/auto-imports.d.ts +++ b/src/types/auto-imports.d.ts @@ -2,7 +2,6 @@ export {} declare global { const EffectScope: typeof import('vue')['EffectScope'] - const ElForm: typeof import('element-plus/es')['ElForm'] const ElMessage: typeof import('element-plus/es')['ElMessage'] const ElMessageBox: typeof import('element-plus/es')['ElMessageBox'] const asyncComputed: typeof import('@vueuse/core')['asyncComputed'] @@ -271,7 +270,6 @@ import { UnwrapRef } from 'vue' declare module 'vue' { interface ComponentCustomProperties { readonly EffectScope: UnwrapRef - readonly ElForm: UnwrapRef readonly ElMessage: UnwrapRef readonly ElMessageBox: UnwrapRef readonly asyncComputed: UnwrapRef diff --git a/src/utils/request copy.js b/src/utils/request copy.js deleted file mode 100644 index 9a13562..0000000 --- a/src/utils/request copy.js +++ /dev/null @@ -1,67 +0,0 @@ -import axios from 'axios' -import router from '@/router/index' -import { ElMessage } from 'element-plus' -// ElMessage -import { userInfoModules } from "@/store/modules/userInfo"; -// import stores from '@/store/index' -import { store } from '@/store/index'; // 因为不是在setup环境而是js中,必须重新初始化加载store -const userInfoPinia = userInfoModules(store); //pinia -// 开发环境需以 "/api" 拼接,其他环境需以 "/C" 拼接 -const env = process.env.NODE_ENV == 'development' ? "/api" : "/C" -// console.log(process.env.NODE_ENV, 'env') - - -/** -* @description:发送Axios请求 -*/ -const request = axios.create({ - baseURL: env, - timeout: 15000 -}) - -// 请求拦截器 -request.interceptors.request.use( - function (config) { - // 给所有授权的请求提供token - const AccessToken = localStorage.getItem("AccessToken") - if (AccessToken) { - config.headers.token = AccessToken - } - return config - }, - function (error) { - // 操作 - return Promise.reject(error) - } -) - -// 响应拦截器 -request.interceptors.response.use( - function (response) { - let code = response.data.code - // 当token无效(过期或损坏)时 1053为未登录 - if (code == 1052 || code == 1053) { - localStorage.removeItem("AccessToken"); - router.push("/login"); - ElMessage.error("登录过期,请重新登录!"); - return - // 弹出错误 - } else if (code != 200) { - if (code == 500) { - ElMessage.error("系统异常,请稍后再试"); - - // 其他错误 - } else { - return Promise.reject(response.data) - } - } else { - // 正常返回 - return response.data - } - - }, - function (error) { - } -) - -export default request \ No newline at end of file diff --git a/src/views/mangage/keyCheck.vue b/src/views/mangage/keyCheck.vue new file mode 100644 index 0000000..0591af1 --- /dev/null +++ b/src/views/mangage/keyCheck.vue @@ -0,0 +1,128 @@ + + + + + + From fe636bfa310af18e0d004ea7479ac222cc1ca381 Mon Sep 17 00:00:00 2001 From: XiaoXinPro 14 IAH5R <568170040@qq.com> Date: Wed, 25 Oct 2023 17:46:16 +0800 Subject: [PATCH 2/2] add --- src/views/mangage/keyCheck.vue | 51 +++++++++++++++++++++++++++++++--- 1 file changed, 47 insertions(+), 4 deletions(-) diff --git a/src/views/mangage/keyCheck.vue b/src/views/mangage/keyCheck.vue index 0591af1..5210b1b 100644 --- a/src/views/mangage/keyCheck.vue +++ b/src/views/mangage/keyCheck.vue @@ -9,10 +9,16 @@ >复制
-
- 密钥状态:{{ showCode }} - {{ showText }} - {{ showText }} +
+ 密钥状态:{{ keyStatus == 1 ? "正常" : "作废" }} + 恢复 + 作废
@@ -70,8 +76,21 @@ const copyKey = () => { }); }; +const keyStatus = ref(""); + +const getStatus = () => { + // 1:正常;2:作废 + const status = 1; + keyStatus.value = status; +}; + +const changeStatus = (num) => { + keyStatus.value = num; +}; + onMounted(() => { getKey(); + getStatus(); }); @@ -123,6 +142,30 @@ onMounted(() => { } } } + .keyStatus { + text-align: center; + font-size: 4vh; + padding: 5vh; + + .success { + color: #ff0000; + margin-left: 2vh; + cursor: pointer; + transition: all 0.3s; + &:hover { + color: #36db43; + } + } + .fail { + color: #36db43; + margin-left: 2vh; + cursor: pointer; + transition: all 0.3s; + &:hover { + color: #ff0000; + } + } + } } }