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

签名算法的类型问题 #9

Open
Guo-Zhang opened this issue Sep 26, 2022 · 1 comment
Open

签名算法的类型问题 #9

Guo-Zhang opened this issue Sep 26, 2022 · 1 comment

Comments

@Guo-Zhang
Copy link

我重新造了一遍这个库,发现了你的文章的评论区提到的签名问题可能的原因。

源码:https://github.com/quanttide/flutter-qcloud-cos/blob/master/lib/src/api/sign.dart

Dart的Uri的queryParamters的类型是Map<String, dynamic>?,http库的headers的类型是Map<String, String>?

步骤4对value的处理应该是这样

Uri.encodeComponent((value!=null)?value.toString():"")

我在主函数的入口增加了

queryParams = queryParams ?? {};
headers = headers ?? {};

Btw, 我在README和模块的头部注明了Inspired by your project. 非常感谢你开源代码,对我的开发有很大的帮助!

@zhangruiyu
Copy link
Owner

好的,我这边也会找时间同步这个问题

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