| | |
| | | if (typeof responseData.state === 'object' && typeof responseData.data === 'object') { |
| | | return responseData; |
| | | } |
| | | // App版请求,响应体转换 |
| | | if (typeof responseData.ret !== 'undefined' && typeof responseData.data !== 'undefined') { |
| | | // App版请求(存在ret直接视为App请求),响应体转换 |
| | | if (typeof responseData.ret !== 'undefined') { |
| | | // 转换数据体 |
| | | let data2 = { rows: [] }; |
| | | // 数组类型 |
| | |
| | | if (!Tools.isEmptyObject(responseData.data)) { |
| | | data2 = responseData.data; |
| | | } |
| | | } |
| | | // 不存在 |
| | | else if (typeof responseData.data === 'undefined') { |
| | | data2 = {}; |
| | | } |
| | | // 转换响应码 |
| | | let code = 0; |
| | |
| | | msg: responseData.msg, |
| | | }, |
| | | data: data2, |
| | | }; |
| | | } |
| | | if (responseData.ret === 3) { |
| | | return { |
| | | state: { |
| | | code: 5000, |
| | | msg: responseData.msg, |
| | | }, |
| | | data: {}, |
| | | }; |
| | | } |
| | | // 旧请求,操作类通讯,响应体转换 |