refactor: 数据预览接口延长请求时间

This commit is contained in:
junjie 2021-07-30 17:44:44 +08:00
parent 4b65494dd6
commit 97612f1968
3 changed files with 4 additions and 3 deletions

View File

@ -111,11 +111,12 @@ export function batchEdit(data) {
}) })
} }
export function post(url, data, showLoading = true) { export function post(url, data, showLoading = true, timeout = 10000) {
return request({ return request({
url: url, url: url,
method: 'post', method: 'post',
loading: showLoading, loading: showLoading,
timeout: timeout,
data data
}) })
} }

View File

@ -72,7 +72,7 @@ export default {
if (this.table.id) { if (this.table.id) {
this.dataLoading = true this.dataLoading = true
this.table.row = 100 this.table.row = 100
post('/dataset/table/getPreviewData/1/100', this.table, false).then(response => { post('/dataset/table/getPreviewData/1/100', this.table, false,30000).then(response => {
this.fields = response.data.fields this.fields = response.data.fields
this.data = response.data.data this.data = response.data.data
const datas = this.data const datas = this.data

View File

@ -134,7 +134,7 @@ export default {
initPreviewData(page) { initPreviewData(page) {
if (this.table.id) { if (this.table.id) {
this.table.row = this.tableViewRowForm.row this.table.row = this.tableViewRowForm.row
post('/dataset/table/getPreviewData/' + page.page + '/' + page.pageSize, this.table).then(response => { post('/dataset/table/getPreviewData/' + page.page + '/' + page.pageSize, this.table, true, 30000).then(response => {
this.fields = response.data.fields this.fields = response.data.fields
this.data = response.data.data this.data = response.data.data
this.page = response.data.page this.page = response.data.page