目前小程序是通过 wx.login 获取的 code, 然后通过 code 与后台交互, 通过 appId + appSecret + code 获取 openID
就 openId来讲, 微信客户端应该能直接做到通过 code + 小程序标识 来获取openId, 为什么还要通过服务端
我目前想到的一个原因是 "服务端拥有登录态" , 是否还有其他原因
小程序为什么不直接在前端获取到 openId?Why doesn't the applet get the openId directly on the front end?
小程序为什么不直接在前端获取到 openId?目前小程序是通过 wx.login 获取的 code, 然后通过 code 与后台交互, 通过 appId + appSecret + code 获取 openID
就 openId来讲, 微信客户端应该能直接做到通过 code + 小程序标识 来获取openId, 为什么还要通过服务端
我目前想到的一个原因是 "服务端拥有登录态" , 是否还有其他原因
At present, the small program is through the wx.login In terms of openid, wechat clients should be able to directly obtain openid through code + applet ID. why should they use the server? One reason I think of now is "the server has login status". Is there any other reason
回答:
一直就是前端保存的飘过。
我能想到的是安全机制考虑
保存在前端???铭感信息 存前端??