Commit 4c6832e2 by 李君

优化

1 parent 53b5ad63
......@@ -7,14 +7,14 @@ import {ElMessage} from 'element-plus'
let baseURL = ['localhost', '192.168.1.28'].includes(window.location.hostname) ? '' : window._baseUrl
const axiosInstance = axios.create(
{
baseURL: baseURL
baseURL: baseURL,
timeout:10000
}
)
// 请求拦截器
axiosInstance.interceptors.request.use(
config => {
// Cookies.set('atoken','a2393446-3372-45ea-8ee3-0a45140855cf')
Cookies.set('atoken','9b478c52-37e2-451e-8b71-5338f0b0f0e3')
if(!Cookies.get('atoken')){
ElMessage({
message: `登录过期,请重新登录`,
......
......@@ -61,6 +61,7 @@
const accountList = ref([])
const plazaList = ref([])
const deviceList = ref([])
const isLoading = ref(false)
const columns = ref([
{
title: '序号',
......@@ -159,6 +160,7 @@
}
api.getDeviceList(data).then(
(r) => {
isLoading.value = false
if (isArray(r))
{
for (var i = 0; i < r.length; i++) {
......@@ -174,6 +176,7 @@
const confirmSearch = function(){
queryForm.device_id = []
deviceList.value = []
isLoading.value = true
getDevice()
}
const implement = function(){
......@@ -193,8 +196,23 @@
startTime:moment(queryForm.date).format('YYYY-MM-DD')+' '+moment(queryForm.startTime).format('HH:mm:ss'),
endTime:moment(queryForm.date).format('YYYY-MM-DD')+' '+moment(queryForm.endTime).format('HH:mm:ss'),
}
isLoading.value = true
api.getResultresend(parmas).then( (r) =>{
console.log(r)
isLoading.value = false
if(r&&r.success){
item.retransmission = '重传成功'
api.getReboot({ip:item.localIp}).then( (r) =>{
if(r&&r.success){
item.restart = '重启成功'
}else{
item.restart = '重启失败'
}
console.log(deviceList.value)
}
)
}else{
item.retransmission = '重传失败'
}
}
)
}
......@@ -212,6 +230,7 @@
accountList,
plazaList,
columns,
isLoading,
queryForm,
onAccountChange,
confirmSearch,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!