add user_token

This commit is contained in:
ljw
2024-10-31 22:27:30 +08:00
parent fffc2658e3
commit 130235fdc1
11 changed files with 211 additions and 10 deletions
+10
View File
@@ -1,5 +1,6 @@
import { reactive } from 'vue'
import { list, remove } from '@/api/login_log'
import { list as fetchPeers } from '@/api/peer'
import { ElMessage, ElMessageBox } from 'element-plus'
import { useRoute } from 'vue-router'
import { T } from '@/utils/i18n'
@@ -23,6 +24,15 @@ export function useRepositories () {
const res = await list(listQuery).catch(_ => false)
listRes.loading = false
if (res) {
const uuids = res.data.list.filter(item => item.uuid).map(item => item.uuid)
const peers = await fetchPeers({ uuids }).catch(_ => false)
if (peers?.data?.list) {
res.data.list.forEach(item => {
if (item.uuid) {
item.peer = peers.data.list.find(peer => peer.uuid === item.uuid)
}
})
}
listRes.list = res.data.list
listRes.total = res.data.total
}