Skip to content
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

type 'String' is not a subtype of type 'Map<dynamic, dynamic>' #30

Open
designDo opened this issue Aug 10, 2021 · 2 comments
Open

type 'String' is not a subtype of type 'Map<dynamic, dynamic>' #30

designDo opened this issue Aug 10, 2021 · 2 comments

Comments

@designDo
Copy link

I/flutter ( 5231): Post请求启动! url:https://api2.bmob.cn/1/users ,body: {"smsCode":"594739","username":"FG ","mobilePhoneNumber":"13073636078"} ,headers:{content-type: null, X-Bmob-Application-Id: 28009b3f686439f09b5f81da404177fb, X-Bmob-REST-API-Key: e9f5e4b15c5b57631d280d0bcd49330d, Content-Type: application/json}
I/flutter ( 5231): Post请求结果:{"createdAt":"2021-08-10 20:04:35","mobilePhoneNumber":"13073636078","mobilePhoneNumberVerified":true,"objectId":"a425c6c147","sessionToken":"a390930140b625898085592bc36fa88d","updatedAt":"2021-08-10 20:04:35","username":"NBA"}
I/flutter ( 5231): type 'String' is not a subtype of type 'Map<dynamic, dynamic>'
I/flutter ( 5231): error

验证码登录接口,返回值为String?

 //Map转String
    //发送请求
///返回值类型为String,这里用Map接收
    Map result = await BmobDio.getInstance()
        .post(Bmob.BMOB_API_USERS, data: getParamsJsonFromParamsMap(data));
   
    print(result);
@yhfy2006
Copy link

我也有这个问题,然后这个还会变的。一会儿String一会儿Map 我也是服了。
解决方法是自己clone一个版本 然后加一个判断,同时可以处理String 和Map

@designDo
Copy link
Author

我也有这个问题,然后这个还会变的。一会儿String一会儿Map 我也是服了。
解决方法是自己clone一个版本 然后加一个判断,同时可以处理String 和Map

是的,我觉得是开发版的原因。我这里还有个问题,就是验证码登录之后,token的过期时间,拉取数据能拉下来,修改不了,也是醉了。按理说登录过期了所有API都应该报错。。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants