@@ -21,7 +21,7 @@ const updateTime = () => {
|
|||||||
|
|
||||||
const fetchInfo = async () => {
|
const fetchInfo = async () => {
|
||||||
if (!input.value) return
|
if (!input.value) return
|
||||||
loading.value = true
|
|
||||||
try {
|
try {
|
||||||
const res = await axios.get('/api/token/info', {
|
const res = await axios.get('/api/token/info', {
|
||||||
params: {token: input.value}
|
params: {token: input.value}
|
||||||
@@ -29,14 +29,18 @@ const fetchInfo = async () => {
|
|||||||
result.value = res.data.result
|
result.value = res.data.result
|
||||||
token.value = input.value
|
token.value = input.value
|
||||||
updateTime()
|
updateTime()
|
||||||
// ElMessage({message: '刷新成功', type: 'success', duration: 1500})
|
|
||||||
} catch {
|
} catch {
|
||||||
ElMessage({message: 'Token输入错误', type: 'error', duration: 2000})
|
ElMessage({message: 'Token输入错误', type: 'error', duration: 2000})
|
||||||
} finally {
|
|
||||||
loading.value = false
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const refresh = async () => {
|
||||||
|
loading.value = true
|
||||||
|
await fetchInfo()
|
||||||
|
loading.value = false
|
||||||
|
ElMessage({message: '查询成功', type: 'success', duration: 1500})
|
||||||
|
}
|
||||||
|
|
||||||
const inputChange = () => {
|
const inputChange = () => {
|
||||||
if (input.value) fetchInfo()
|
if (input.value) fetchInfo()
|
||||||
}
|
}
|
||||||
@@ -83,7 +87,7 @@ const statCards = [
|
|||||||
</el-icon>
|
</el-icon>
|
||||||
</template>
|
</template>
|
||||||
</el-input>
|
</el-input>
|
||||||
<el-button type="primary" size="large" @click="fetchInfo" :loading="loading">
|
<el-button type="primary" size="large" @click="refresh" :loading="loading">
|
||||||
查询
|
查询
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button type="success" size="large" @click="showAddDataDialog = true">
|
<el-button type="success" size="large" @click="showAddDataDialog = true">
|
||||||
|
|||||||
Reference in New Issue
Block a user