1
0
mirror of https://github.com/PanJiaChen/vue-element-admin.git synced 2025-08-10 20:39:48 +08:00

Allows timeout for backed request (#759)

* Allows timeout for backed request
Just a little change for allows define timeout on default.json based on ADempiere request

* Validate 0
This commit is contained in:
Yamel Senih 2021-04-19 10:49:22 -04:00 committed by GitHub
parent 2ceb55393d
commit e9596d0744
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -5,7 +5,8 @@
},
"adempiere": {
"api": {
"url": "https://api.erpya.com/adempiere-api"
"url": "https://api.erpya.com/adempiere-api",
"timeout": 100000
},
"images": {
"url": "https://api.erpya.com/adempiere-api/img"

View File

@ -29,6 +29,10 @@ export function request(requestValues) {
requestValues.params = {}
}
requestValues.baseURL = config.adempiere.api.url
// Timeout
if (config.adempiere.api.timeout && config.adempiere.api.timeout > 0) {
requestValues.timeout = config.adempiere.api.timeout
}
requestValues.params.token = getToken()
requestValues.params.language = getLanguage() || 'en_US'
return new Promise(resolve => {