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