-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
能处理一下返回的数据结构不一致的问题吗?有时候后台返回成功的数据是对象,失败的数据是数组这种怎么处理? #11
Comments
这个时候干后端就对了,何必为难自己 |
你可以跟后端讨论下什么是 RESTFUL... |
他会跟你讨论下为啥iOS可以,android不行 |
这个问题,本身是后台不规范导致的问题。如果他们不愿意改,你可以在拦截器中直接把data,字段改掉。
|
老哥这个问题怎么解决啊 我也遇到了 |
用泛型啊 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
失败返回的数据:
{
"status_code": 9218,
"message": "密码错误,剩余4次输入",
"data": []
}
成功返回的数据:
{
"status_code": 1000,
"message": "成功",
"data": {
"id_no": "BtLhO2qmaOrvQSA5xbYTVqOJGJtd/oHkvIkTChI3c3c=",
"is_verifyed": 0,
"phone": "c59le6L65XK1htExLNic/w==",
}
}
我重写你那个Gson解析器,抛ApiFailedResponse这个函数一直有错,大佬能帮忙看下吗?
The text was updated successfully, but these errors were encountered: