@@ -18,28 +18,28 @@ | |||
{{ $t("modelMangage.title") }} | |||
</div> | |||
<div class="myRouter-item" @click="router.push('/createVideo')"> | |||
<div class="myRouter-item" @click="router.push('/model')"> | |||
<div class="icon"> | |||
<el-icon><i-ep-edit /></el-icon> | |||
</div> | |||
{{ $t("businessMangage.title") }} | |||
</div> | |||
<div class="myRouter-item" @click="router.push('/createVideo')"> | |||
<div class="myRouter-item" @click="router.push('/keyCheck')"> | |||
<div class="icon"> | |||
<el-icon><i-ep-edit /></el-icon> | |||
</div> | |||
{{ $t("keyMangage.title") }} | |||
</div> | |||
<div class="myRouter-item" @click="router.push('/createVideo')"> | |||
<div class="myRouter-item" @click="router.push('/model')"> | |||
<div class="icon"> | |||
<el-icon><i-ep-edit /></el-icon> | |||
</div> | |||
{{ $t("priceMangage.title") }} | |||
</div> | |||
<div class="myRouter-item" @click="router.push('/createVideo')"> | |||
<div class="myRouter-item" @click="router.push('/model')"> | |||
<div class="icon"> | |||
<el-icon><i-ep-edit /></el-icon> | |||
</div> | |||
@@ -47,7 +47,7 @@ | |||
</div> | |||
<div class="bottomBtx"> | |||
<div class="myRouter-item" @click="router.push('/myAPI')"> | |||
<div class="myRouter-item" @click="router.push('/model')"> | |||
<div class="icon"> | |||
<el-icon><i-ep-DocumentAdd /></el-icon> | |||
</div> | |||
@@ -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", | |||
}, | |||
}, | |||
], | |||
@@ -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 asyncComputed: typeof import('@vueuse/core')['asyncComputed'] | |||
const autoResetRef: typeof import('@vueuse/core')['autoResetRef'] | |||
@@ -270,7 +269,6 @@ import { UnwrapRef } from 'vue' | |||
declare module 'vue' { | |||
interface ComponentCustomProperties { | |||
readonly EffectScope: UnwrapRef<typeof import('vue')['EffectScope']> | |||
readonly ElForm: UnwrapRef<typeof import('element-plus/es')['ElForm']> | |||
readonly ElMessage: UnwrapRef<typeof import('element-plus/es')['ElMessage']> | |||
readonly asyncComputed: UnwrapRef<typeof import('@vueuse/core')['asyncComputed']> | |||
readonly autoResetRef: UnwrapRef<typeof import('@vueuse/core')['autoResetRef']> | |||
@@ -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 |
@@ -0,0 +1,171 @@ | |||
<template> | |||
<div class="page flex justify-around"> | |||
<div class="card"> | |||
<div class="title">密钥管理</div> | |||
<div class="key"> | |||
<span class="text">密钥:{{ showCode }}</span> | |||
<span class="showOrHide" @click="showHideCode">{{ showText }}</span> | |||
<span v-if="showText == '隐藏'" class="copy" @click="copyKey" | |||
>复制</span | |||
> | |||
</div> | |||
<div class="keyStatus"> | |||
<span class="text" | |||
>密钥状态:{{ keyStatus == 1 ? "正常" : "作废" }}</span | |||
> | |||
<span v-if="keyStatus == 1" class="success" @click="changeStatus(2)" | |||
>恢复</span | |||
> | |||
<span v-if="keyStatus == 2" class="fail" @click="changeStatus(1)" | |||
>作废</span | |||
> | |||
</div> | |||
</div> | |||
</div> | |||
</template> | |||
<!-- videoType==1为竖,==2为横 --> | |||
<script setup> | |||
//#region 导入 | |||
import { linkEmits } from "element-plus"; | |||
import { getCurrentInstance } from "vue"; | |||
import { useI18n } from "vue-i18n"; | |||
import { useRoute, useRouter } from "vue-router"; | |||
const route = useRoute(); | |||
const router = useRouter(); | |||
const { locale } = useI18n(); | |||
const lanChange = ref(locale); | |||
const AccessToken = localStorage.getItem("AccessToken"); // 判断有没有登录 | |||
const key = ref("AE0DVHDWMDOURSBCAP"); | |||
const hideCode = ref(""); | |||
const showCode = ref(""); | |||
const showText = ref("查看"); | |||
const getKey = () => { | |||
const len = key.value.length; | |||
let code = ""; | |||
for (let index = 0; index < len; index++) { | |||
code += "*"; | |||
} | |||
hideCode.value = code; | |||
showCode.value = code; | |||
}; | |||
const showHideCode = () => { | |||
if (showText.value == "查看") { | |||
showText.value = "隐藏"; | |||
showCode.value = key.value; | |||
} else { | |||
showText.value = "查看"; | |||
showCode.value = hideCode.value; | |||
} | |||
}; | |||
const copyKey = () => { | |||
navigator.clipboard | |||
.writeText(key.value) | |||
.then(() => { | |||
ElMessage.success("复制成功!"); | |||
}) | |||
.catch(() => { | |||
ElMessage.error("复制失败!"); | |||
}); | |||
}; | |||
const keyStatus = ref(""); | |||
const getStatus = () => { | |||
// 1:正常;2:作废 | |||
const status = 1; | |||
keyStatus.value = status; | |||
}; | |||
const changeStatus = (num) => { | |||
keyStatus.value = num; | |||
}; | |||
onMounted(() => { | |||
getKey(); | |||
getStatus(); | |||
}); | |||
</script> | |||
<style lang="scss" scoped> | |||
.page { | |||
height: calc(100vh - 80px); | |||
// height: calc(100vh - 80px); | |||
background-color: #ffffff; | |||
border-radius: 30px 0 0 0; | |||
overflow: hidden; | |||
.card { | |||
width: 70%; | |||
height: 70%; | |||
background-color: #f8f8f8; | |||
margin-top: 10vh; | |||
border-radius: 5vh; | |||
box-shadow: #0000002e 1px 1px 1px 1px; | |||
.title { | |||
text-align: center; | |||
font-size: 4vh; | |||
padding: 5vh; | |||
} | |||
.key { | |||
text-align: center; | |||
font-size: 4vh; | |||
padding: 5vh; | |||
.copy { | |||
color: #ffffff; | |||
margin-left: 2vh; | |||
cursor: pointer; | |||
transition: all 0.3s; | |||
background-color: #3a57b6; | |||
padding: 0.7vh; | |||
border-radius: 15px; | |||
&:hover { | |||
background-color: #1ceedc; | |||
} | |||
} | |||
.showOrHide { | |||
color: #20b4a8; | |||
margin-left: 2vh; | |||
cursor: pointer; | |||
transition: all 0.3s; | |||
&:hover { | |||
color: #476ad9; | |||
} | |||
} | |||
} | |||
.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; | |||
} | |||
} | |||
} | |||
} | |||
} | |||
</style> |