refactor(token): 优化Token管理界面和重构工作流

This commit is contained in:
2025-09-11 22:47:08 +08:00
parent f883b0a7d8
commit 5e3c0762ab
5 changed files with 29 additions and 30 deletions

View File

@@ -6,13 +6,16 @@ import {useCounterStore} from "@/stores/counter.ts";
import {useRouter} from "vue-router";
const tableData = ref([])
axios.get("/api/token").then(res => {
tableData.value = res.data.result
})
const input = ref('')
const value = ref('')
const dataFormat = ref('')
const inputPassWord = ref('')
const router = useRouter()
var rowOut: any
const dedupObjectVisible = ref(false)
const dataFormatVisible = ref(false)
const inputNotes = ref("")
const NotesVisible = ref(false)
const options = [
{
value: 'uid',
@@ -31,7 +34,6 @@ const options = [
}
]
const dataFormat = ref('')
const dataFormatOptions = [
{
value: 'uid----secid----pid----comment_id',
@@ -40,6 +42,11 @@ const dataFormatOptions = [
}
]
axios.get("/api/token").then(res => {
tableData.value = res.data.result
})
const addToken = () => {
axios.post('/api/token', {}, {
params: {
@@ -63,8 +70,6 @@ const addToken = () => {
})
}
const router = useRouter()
const viewDetails = (row: any) => {
useCounterStore().token = row.token
router.push({
@@ -72,13 +77,11 @@ const viewDetails = (row: any) => {
})
}
var rowOut: any
const dedupObjectVisible = ref(false)
const dialogDedupObjectVisible = (row: any) => {
rowOut = row
dedupObjectVisible.value = true
}
const updateDedupObject = () => {
dedupObjectVisible.value = false
axios.put('/api/token', {}, {
@@ -103,11 +106,11 @@ const updateDedupObject = () => {
})
}
const dataFormatVisible = ref(false)
const dialogDataFormatVisible = (row: any) => {
rowOut = row
dataFormatVisible.value = true
}
const updateDataFormat = () => {
dataFormatVisible.value = false
axios.put('/api/token', {}, {
@@ -132,12 +135,11 @@ const updateDataFormat = () => {
})
}
const inputNotes = ref("")
const NotesVisible = ref(false)
const dialogNotesVisible = (row: any) => {
rowOut = row
NotesVisible.value = true
}
const updateNotes = () => {
NotesVisible.value = false
axios.put('/api/token', {}, {
@@ -182,7 +184,6 @@ const deleteToken = (row: any) => {
})
}
const inputPassWord = ref('')
const checkPassword = () => {
if (inputPassWord.value == "haha") {
ElMessage({