diff --git a/src/api_mangage/key.js b/src/api_mangage/key.js
new file mode 100644
index 0000000..43829b8
--- /dev/null
+++ b/src/api_mangage/key.js
@@ -0,0 +1,39 @@
+import request from "@/utils/request.js";
+
+
+/**
+ * @description 获取密钥列表
+ * @param {*} (pageNum,pageSize)
+ * @returns data
+ */
+export function keyListApi(pageNum, pageSize) {
+ return request({
+ url: `/thirdPartyApi/page?pageNum=${pageNum}&pageSize=${pageSize}`,
+ method: 'get'
+ })
+}
+
+/**
+ * @description 根据id获取密钥详情
+ * @param {*} (id)
+ * @returns data
+ */
+export function getKeyByIdApi(id) {
+ return request({
+ url: `/thirdPartyApi/get?id=${id}`,
+ method: 'get'
+ })
+}
+
+/**
+ * @description 更改密钥状态
+ * @param {*} (id,status)
+ * @returns data
+ */
+export function updateKeyStatusApi(id, status) {
+ return request({
+ url: `/thirdPartyApi/updateStatus`,
+ method: 'post',
+ data: { id, status }
+ })
+}
\ No newline at end of file
diff --git a/src/lang/package/en.ts b/src/lang/package/en.ts
index 8011723..8beff8f 100644
--- a/src/lang/package/en.ts
+++ b/src/lang/package/en.ts
@@ -226,6 +226,11 @@ export default {
keyMangage: {
title: "Key",
+ list: "Key List",
+ name: "Owner",
+ status: "Status",
+ operations: "Operations",
+ check: "Check",
},
priceMangage: {
diff --git a/src/lang/package/zh-cn.ts b/src/lang/package/zh-cn.ts
index bba6a79..cd6d088 100644
--- a/src/lang/package/zh-cn.ts
+++ b/src/lang/package/zh-cn.ts
@@ -225,6 +225,11 @@ export default {
keyMangage: {
title: "密钥管理",
+ list: "密钥列表",
+ name: "所属人",
+ status: "密钥状态",
+ operations: "操作",
+ check: "查看",
},
priceMangage: {
diff --git a/src/layout/index.vue b/src/layout/index.vue
index afccd79..f13ca26 100644
--- a/src/layout/index.vue
+++ b/src/layout/index.vue
@@ -47,7 +47,7 @@
-
+
{{ $t("keyMangage.title") }}
diff --git a/src/router/index.ts b/src/router/index.ts
index 70ff4ab..92ee18c 100644
--- a/src/router/index.ts
+++ b/src/router/index.ts
@@ -38,6 +38,24 @@ export const constantRoutes: RouteRecordRaw[] = [
],
},
+ {
+ path: "/",
+ component: Layout,
+ redirect: "/keyList",
+ children: [
+ {
+ path: "keyList",
+ component: () => import("@/views/mangage/keyList.vue"),
+ name: "keyList",
+ meta: {
+ title: "keyList",
+ icon: "homepage",
+ affix: true,
+ name: "keyMangage.list",
+ },
+ },
+ ],
+ },
{
path: "/",
component: Layout,
diff --git a/src/types/components.d.ts b/src/types/components.d.ts
index a5771ae..70f8d65 100644
--- a/src/types/components.d.ts
+++ b/src/types/components.d.ts
@@ -14,37 +14,26 @@ declare module '@vue/runtime-core' {
EditPosition: typeof import('./../components/EditPosition.vue')['default']
'EditPosition copy': typeof import('./../components/EditPosition copy.vue')['default']
ElButton: typeof import('element-plus/es')['ElButton']
- ElCard: typeof import('element-plus/es')['ElCard']
ElDialog: typeof import('element-plus/es')['ElDialog']
ElDropdown: typeof import('element-plus/es')['ElDropdown']
ElDropdownItem: typeof import('element-plus/es')['ElDropdownItem']
ElDropdownMenu: typeof import('element-plus/es')['ElDropdownMenu']
- ElForm: typeof import('element-plus/es')['ElForm']
- ElFormItem: typeof import('element-plus/es')['ElFormItem']
ElIcon: typeof import('element-plus/es')['ElIcon']
ElInput: typeof import('element-plus/es')['ElInput']
ElInputNumber: typeof import('element-plus/es')['ElInputNumber']
ElOption: typeof import('element-plus/es')['ElOption']
ElPagination: typeof import('element-plus/es')['ElPagination']
- ElRadio: typeof import('element-plus/es')['ElRadio']
- ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
ElSelect: typeof import('element-plus/es')['ElSelect']
ElSwitch: typeof import('element-plus/es')['ElSwitch']
ElTable: typeof import('element-plus/es')['ElTable']
ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
- ElTag: typeof import('element-plus/es')['ElTag']
ElTooltip: typeof import('element-plus/es')['ElTooltip']
ElUpload: typeof import('element-plus/es')['ElUpload']
GithubCorner: typeof import('./../components/GithubCorner/index.vue')['default']
Hamburger: typeof import('./../components/Hamburger/index.vue')['default']
IconSelect: typeof import('./../components/IconSelect/index.vue')['default']
- IEpCollection: typeof import('~icons/ep/collection')['default']
- IEpDelete: typeof import('~icons/ep/delete')['default']
IEpDocumentAdd: typeof import('~icons/ep/document-add')['default']
IEpEdit: typeof import('~icons/ep/edit')['default']
- IEpPlus: typeof import('~icons/ep/plus')['default']
- IEpRefresh: typeof import('~icons/ep/refresh')['default']
- IEpSearch: typeof import('~icons/ep/search')['default']
LangSelect: typeof import('./../components/LangSelect/index.vue')['default']
MultiUpload: typeof import('./../components/Upload/MultiUpload.vue')['default']
MyLoading: typeof import('./../components/myLoading.vue')['default']
@@ -60,6 +49,5 @@ declare module '@vue/runtime-core' {
}
export interface ComponentCustomProperties {
vInfiniteScroll: typeof import('element-plus/es')['ElInfiniteScroll']
- vLoading: typeof import('element-plus/es')['ElLoadingDirective']
}
}
diff --git a/src/views/mangage/keyCheck.vue b/src/views/mangage/keyCheck.vue
index 5210b1b..abdad3b 100644
--- a/src/views/mangage/keyCheck.vue
+++ b/src/views/mangage/keyCheck.vue
@@ -1,22 +1,47 @@
-
密钥管理
+
密钥详情
- 密钥:{{ showCode }}
+ {{ $t("keyMangage.name") }}:{{ name }}
+
+
+
+ appId:{{ showCode }}
{{ showText }}
- 复制
-
-
密钥状态:{{ keyStatus == 1 ? "正常" : "作废" }}
+
+
appKey:{{ showCodeII }}
+
{{ showTextII }}
+
复制
-
恢复
+
+
+
signKey:{{ showCodeIII }}
+
{{
+ showTextIII
+ }}
+
复制
-
+
+ 密钥状态:
+ 正常
+ 失效
+
+ 恢复
+ 作废
@@ -34,40 +59,107 @@ import { useI18n } from "vue-i18n";
import { useRoute, useRouter } from "vue-router";
+import { getKeyByIdApi, updateKeyStatusApi } from "@/api_mangage/key";
+
const route = useRoute();
const router = useRouter();
const { locale } = useI18n();
const lanChange = ref(locale);
const AccessToken = localStorage.getItem("AccessToken"); // 判断有没有登录
-const key = ref("AE0DVHDWMDOURSBCAP");
+const keyId = ref("");
+const name = ref("");
+
+const appId = ref("");
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;
+ showCode.value = appId.value;
} else {
showText.value = "查看";
showCode.value = hideCode.value;
}
};
-const copyKey = () => {
+const appKey = ref("");
+const hideCodeII = ref("");
+const showCodeII = ref("");
+const showTextII = ref("查看");
+
+const showHideCodeII = () => {
+ if (showTextII.value == "查看") {
+ showTextII.value = "隐藏";
+ showCodeII.value = appKey.value;
+ } else {
+ showTextII.value = "查看";
+ showCodeII.value = hideCodeII.value;
+ }
+};
+
+const signKey = ref("");
+const hideCodeIII = ref("");
+const showCodeIII = ref("");
+const showTextIII = ref("查看");
+
+const showHideCodeIII = () => {
+ if (showTextIII.value == "查看") {
+ showTextIII.value = "隐藏";
+ showCodeIII.value = signKey.value;
+ } else {
+ showTextIII.value = "查看";
+ showCodeIII.value = hideCodeIII.value;
+ }
+};
+
+const getKeyFunc = async () => {
+ const id = keyId.value;
+ try {
+ const res = await getKeyByIdApi(id);
+ console.log(res, "res");
+ appId.value = res.data.appId;
+ appKey.value = res.data.appKey;
+ signKey.value = res.data.signKey;
+ keyStatus.value = res.data.status;
+ name.value = res.data.name;
+
+ const len = signKey.value.length;
+ const lenII = signKey.value.length;
+ const lenIII = signKey.value.length;
+
+ let code = "";
+ let codeII = "";
+ let codeIII = "";
+ for (let index = 0; index < len; index++) {
+ code += "*";
+ }
+
+ for (let index = 0; index < lenII; index++) {
+ codeII += "*";
+ }
+
+ for (let index = 0; index < lenIII; index++) {
+ codeIII += "*";
+ }
+ hideCode.value = code;
+ showCode.value = code;
+
+ hideCodeII.value = codeII;
+ showCodeII.value = codeII;
+
+ hideCodeIII.value = codeIII;
+ showCodeIII.value = codeIII;
+ } catch (error) {
+ console.log(error, "err");
+ }
+};
+
+const copyKey = (text) => {
navigator.clipboard
- .writeText(key.value)
+ .writeText(text)
.then(() => {
ElMessage.success("复制成功!");
})
@@ -78,19 +170,48 @@ const copyKey = () => {
const keyStatus = ref("");
-const getStatus = () => {
- // 1:正常;2:作废
- const status = 1;
- keyStatus.value = status;
-};
-
-const changeStatus = (num) => {
- keyStatus.value = num;
+const changeStatus = async (status) => {
+ const id = keyId.value;
+ if (status) {
+ ElMessageBox.confirm("此操作将作废密钥,确定?", "Warning", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning",
+ })
+ .then(async () => {
+ try {
+ const res = await updateKeyStatusApi(id, status);
+ if (res.code == 200) {
+ ElMessage({
+ type: "success",
+ message: "作废成功!",
+ });
+ getKeyFunc();
+ }
+ } catch (error) {
+ console.log(error, "err");
+ }
+ })
+ .catch(() => {});
+ } else {
+ try {
+ const res = await updateKeyStatusApi(id, status);
+ if (res.code == 200) {
+ ElMessage({
+ type: "success",
+ message: "恢复成功!",
+ });
+ getKeyFunc();
+ }
+ } catch (error) {
+ console.log(error, "err");
+ }
+ }
};
onMounted(() => {
- getKey();
- getStatus();
+ keyId.value = route.query.id;
+ getKeyFunc();
});
@@ -102,23 +223,25 @@ onMounted(() => {
border-radius: 30px 0 0 0;
overflow: hidden;
.card {
- width: 70%;
+ width: 80%;
height: 70%;
- background-color: #f8f8f8;
+ background-color: #fafafa;
margin-top: 10vh;
border-radius: 5vh;
box-shadow: #0000002e 1px 1px 1px 1px;
.title {
text-align: center;
- font-size: 4vh;
- padding: 5vh;
+ font-size: 3vh;
+ padding: 4vh;
}
.key {
text-align: center;
- font-size: 4vh;
+ font-size: 2.5vh;
padding: 5vh;
+ padding-bottom: 0.5vh;
+ text-align: left;
.copy {
color: #ffffff;
@@ -144,25 +267,32 @@ onMounted(() => {
}
.keyStatus {
text-align: center;
- font-size: 4vh;
- padding: 5vh;
+ font-size: 2.9vh;
+ padding: 4vh;
+ margin-top: 1vh;
.success {
- color: #ff0000;
+ color: #ffffff;
+ background-color: #ff0000;
margin-left: 2vh;
+ padding: 0.7vh;
+ border-radius: 15px;
cursor: pointer;
transition: all 0.3s;
&:hover {
- color: #36db43;
+ background-color: #36db43;
}
}
.fail {
- color: #36db43;
+ color: #ffffff;
+ background-color: #36db43;
margin-left: 2vh;
+ padding: 0.7vh;
+ border-radius: 15px;
cursor: pointer;
transition: all 0.3s;
&:hover {
- color: #ff0000;
+ background-color: #ff0000;
}
}
}
diff --git a/src/views/mangage/keyList.vue b/src/views/mangage/keyList.vue
new file mode 100644
index 0000000..a78ba77
--- /dev/null
+++ b/src/views/mangage/keyList.vue
@@ -0,0 +1,148 @@
+
+
+
+
+
+
+
+ {{ getStatus(scope.row.status) }}
+
+
+
+
+
+ {{ $t("keyMangage.check") }}
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/myCreating/index copy.vue b/src/views/myCreating/index copy.vue
deleted file mode 100644
index a5a0054..0000000
--- a/src/views/myCreating/index copy.vue
+++ /dev/null
@@ -1,698 +0,0 @@
-
-
-
-
-
-
-
-
-
-
![]()
-
![](@/assets/img/left-top-logo.png)
-
-
-
- {{ $t("myCreating." + item.statusName) }}
-
-
-
- {{ item.title }}
- {{ dayjs(item.createDate).format("YYYY-MM-DD") }}
-
-
-
-
-
-
-
-
...
-
-
-
-
-
-
-
{{ $t("myCreating.download") }}
-
-
-
-
-
-
-
{{ $t("myCreating.delete") }}
-
-
-
-
-
-
-
- {{ $t("myCreating.noList") }}
-
-
- {{ $t("myCreating.goCreate") }}
-
-
-
-
-
-
-
-
{{ $t("myCreating.loading") }}
-
-
-
-
-
-
- {{ $t("myCreating." + presentItem.statusName + "Text") }}
- {{
- presentItem.videoMsg
- }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-