# 调整下载超时
This commit is contained in:
parent
392ad2a2b0
commit
b2ac5951f2
|
@ -11,6 +11,7 @@ export function fetchDeviceList(query) {
|
||||||
|
|
||||||
// device log list api
|
// device log list api
|
||||||
export function fetchDeviceLogs(query) {
|
export function fetchDeviceLogs(query) {
|
||||||
|
request.defaults.timeout = 5000 * 6
|
||||||
return request({
|
return request({
|
||||||
url: '/api/counter/logs/',
|
url: '/api/counter/logs/',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
|
@ -18,6 +19,9 @@ export function fetchDeviceLogs(query) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// reset timeout
|
||||||
|
request.defaults.timeout = 5000
|
||||||
|
|
||||||
// device logs history api
|
// device logs history api
|
||||||
export function fetchDeviceLogsHistory(query) {
|
export function fetchDeviceLogsHistory(query) {
|
||||||
return request({
|
return request({
|
||||||
|
|
|
@ -6,7 +6,7 @@ import { getToken } from '@/utils/auth'
|
||||||
// create an axios instance
|
// create an axios instance
|
||||||
const service = axios.create({
|
const service = axios.create({
|
||||||
baseURL: process.env.BASE_API, // api的base_url
|
baseURL: process.env.BASE_API, // api的base_url
|
||||||
timeout: 5000 * 2 // request timeout
|
timeout: 5000 // request timeout
|
||||||
})
|
})
|
||||||
|
|
||||||
// request interceptor
|
// request interceptor
|
||||||
|
|
|
@ -1,7 +1,12 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<div class="filter-container">
|
<div class="filter-container">
|
||||||
<el-input @keyup.enter.native="handleFilter" size="small" style="width: 220px;" class="filter-item" :placeholder="$t('counter.logSeachContent')" v-model="logsListQuery.device">
|
<el-input
|
||||||
|
@keyup.enter.native="handleFilter"
|
||||||
|
@keyup.esc.native="handleEsc"
|
||||||
|
size="small" style="width: 220px;"
|
||||||
|
class="filter-item"
|
||||||
|
:placeholder="$t('counter.logSeachContent')" v-model="logsListQuery.device">
|
||||||
</el-input>
|
</el-input>
|
||||||
<div class="date-selector filter-item">
|
<div class="date-selector filter-item">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
|
@ -141,6 +146,11 @@ export default {
|
||||||
this.logsListQuery.page = 1
|
this.logsListQuery.page = 1
|
||||||
this.getDeviceLogs(this.logsListQuery)
|
this.getDeviceLogs(this.logsListQuery)
|
||||||
},
|
},
|
||||||
|
handleEsc() {
|
||||||
|
this.logsListQuery.page = 1
|
||||||
|
this.logsListQuery.device = undefined
|
||||||
|
this.getDeviceLogs(this.logsListQuery)
|
||||||
|
},
|
||||||
handleDateSelect(value) {
|
handleDateSelect(value) {
|
||||||
if (value === null) {
|
if (value === null) {
|
||||||
this.logsListQuery.start = undefined
|
this.logsListQuery.start = undefined
|
||||||
|
|
Loading…
Reference in New Issue