fix: 优化token信息获取逻辑 添加空值校验
This commit is contained in:
@@ -7,15 +7,17 @@ const result = ref()
|
||||
const value = ref('')
|
||||
|
||||
const getInfo = () => {
|
||||
axios.get('/api/token/info', {
|
||||
params: {
|
||||
token: value.value
|
||||
}
|
||||
}).then(res => {
|
||||
if (res.status == 200) {
|
||||
result.value = res.data.result
|
||||
}
|
||||
})
|
||||
if (value.value != '') {
|
||||
axios.get('/api/token/info', {
|
||||
params: {
|
||||
token: value.value
|
||||
}
|
||||
}).then(res => {
|
||||
if (res.status == 200) {
|
||||
result.value = res.data.result
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
const deleteDedup = () => {
|
||||
@@ -43,7 +45,6 @@ getInfo()
|
||||
setInterval(getInfo, 5000)
|
||||
|
||||
watch(value, (newValue) => {
|
||||
console.log(newValue)
|
||||
getInfo()
|
||||
})
|
||||
|
||||
|
Reference in New Issue
Block a user