|
@ -18,7 +18,7 @@ export default class ApiClient { |
|
|
async call( name, params={} ) { |
|
|
async call( name, params={} ) { |
|
|
let response = await axios({ |
|
|
let response = await axios({ |
|
|
method: 'post', |
|
|
method: 'post', |
|
|
url: `http://127.0.0.1/api/${name}`, |
|
|
|
|
|
|
|
|
url: `/api/${name}`, |
|
|
data: params |
|
|
data: params |
|
|
}); |
|
|
}); |
|
|
if ( !response.data.success ) { |
|
|
if ( !response.data.success ) { |
|
@ -49,7 +49,7 @@ export default class ApiClient { |
|
|
throw new Error(`API【${name}】调用失败 : ${response.data}`); |
|
|
throw new Error(`API【${name}】调用失败 : ${response.data}`); |
|
|
} |
|
|
} |
|
|
if ( 'MESSAGE' === response.data.appRetType ) { |
|
|
if ( 'MESSAGE' === response.data.appRetType ) { |
|
|
Modal.info({title:'通知', contnet:response.data.message}); |
|
|
|
|
|
|
|
|
Modal.info({title:'通知', content:response.data.message}); |
|
|
} |
|
|
} |
|
|
if ( null !== response.data.data && 'object' === typeof(response.data.data) ) { |
|
|
if ( null !== response.data.data && 'object' === typeof(response.data.data) ) { |
|
|
response.data.data.$dataType = response.data.dataType; |
|
|
response.data.data.$dataType = response.data.dataType; |
|
|