api 接口返回错误提示

This commit is contained in:
liaoxuezhi 2019-08-13 18:17:30 +08:00
parent 81ce4a4881
commit 90b40083af

View File

@ -128,7 +128,10 @@ function responseAdaptor(ret: fetcherResult) {
if (!data) {
throw new Error('Response is empty!');
} else if (!data.hasOwnProperty('status')) {
throw new Error('接口返回格式不符合,请参考 http://amis.baidu.com/v2/docs/api');
}
const payload: Payload = {
ok: data.status == 0,
status: data.status,