目的:将 格式Erro:xxxxx,Url:xxxxx; 改为自定义的提示信息
过程:
1、更改config.js中的debug
ps:将debug:true 改为debug:false
// , debug: true //是否开启调试模式。如开启,接口异常时会抛出异常 URL 等信息
, debug: false //是否开启调试模式。如开启,接口异常时会抛出异常 URL 等信息
2、更改config.js中的response
//自定义响应字段
, response: {
statusName: 'code' //数据状态的字段名称
, statusCode: {
ok: 0 //数据状态一切正常的状态码
, logout: 1001 //登录状态失效的状态码
// 自增加代码
, error: -1 //增加登录失败的状态码
}
, msgName: 'msg' //状态信息的字段名称
, dataName: 'data' //数据详情的字段名称