Comments (8)
可以附上代码吗?
from weapp.
可以附上代码吗?
fmt.Println(item.SessionKey, "-----")
fmt.Println(item.EncryptedData)
fmt.Println(item.Iv)
fmt.Println(item.UserID)
//1查找user
u := model.User{
BaseInfo: model.BaseInfo{
ID: item.UserID,
},
}
//2解密用户手机号信息
res, err := weapp.DecryptMobile(item.SessionKey, item.EncryptedData, item.Iv)
fmt.Println(res, err, "-----wxinfo---")
if err != nil {
return &u, err
}
启动通过小程序的 code获取的ssk ,也都是有效的 wx.checksession 也是通过的 ;
from weapp.
好的,空了我核对下。记得一定是先完成登陆流程然后再获取的电话加密数据才有效哦;
from weapp.
好的,空了我核对下。记得一定是先完成登陆流程然后再获取的电话加密数据才有效哦;
是的,是这样操作的,小程序启动通过code 获取ssk 前端存入缓存 获取手机号的时候从缓存读取得ssk
from weapp.
好的,空了我核对下。记得一定是先完成登陆流程然后再获取的电话加密数据才有效哦;
// decryptUserData 解密用户数据这个函数先base64编码在base64解码 我那个错误能解决,接下来的cbcDecrypt(CBC解密数据)一直走到这个错if len(ciphertext) % size != 0 {
return nil, errors.New("ciphertext is not a multiple of the block size")
}
编码
base64.StdEncoding.EncodeToString
from weapp.
每次小程序用户提交解密数据后 后台解析报这个错 每次 'x1a'这个地方会有变化. invalid character '\x1a' looking for beginning of value
换 了个小程序可以获取到手机号信息,很奇怪了 ,能够获取到的是之前正式发布过,新申请的这个小程序获取不到信息 报这个错一直
from weapp.
找到问题了 数据库垃圾数据造成的 清空数据库 都可以获取到数据了 可以close到问题了 谢谢啦
from weapp.
OK👌
from weapp.
Related Issues (20)
- 【咨询】为什么使用微信通知监听服务要传入mchID和apiKey呢? HOT 1
- 会考虑接入小程序的同城配送么? HOT 1
- 小程序与公众号下发统一消息接口调整通知 HOT 1
- 获取token的地址能否更新一下 HOT 7
- 包名不统一 HOT 1
- 【提问】请问支持API安全(api签名加密)嘛? HOT 2
- 希望可以更新内容审核2.0 HOT 4
- "crypto/aes: invalid key size 43 HOT 1
- 订阅消息 HOT 1
- baseURL 建议支持用户自定义 因为现在后端还可能用于其他平台的小程序 HOT 1
- 使用fasthttp代替http
- 并发 Send 上万条就报错了 HOT 1
- 自定义 token 获取方法,入参应该加上appid,和appsecret
- 有主动刷新access_token缓存的方法吗
- there is bug when deal with customer message
- 测试登录[login]接口时 `code`如何获取?
- v1需要添加profit_sharing这个字段, HOT 9
- 获取电子面单余额 的接口中,获取到的数据始终是0 HOT 3
- 媒体安全检查接口还是用的v1,但现在微信支持的是v2
- 调用client.Login,发现默认的logger每次打印日志都会把之前所有的login记录打出来,是故意的还是不小心? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from weapp.