|
@@ -234,25 +234,24 @@
|
|
|
// provider: 'weixin',
|
|
|
success: (res2) => {
|
|
|
console.log('res2', res2)
|
|
|
- console.log('-------获取openid(unionid)-----');
|
|
|
uni.getUserInfo({
|
|
|
provider: 'weixin',
|
|
|
success: (info) => {
|
|
|
console.log('info')
|
|
|
- uni.setStorage({
|
|
|
- key: 'wxLoginData',
|
|
|
- data: {
|
|
|
- code: res2.code,
|
|
|
- encryptedData: info.encryptedData,
|
|
|
- iv: info.iv,
|
|
|
- rawData: info.rawData,
|
|
|
- signature: info.signature,
|
|
|
- }
|
|
|
- })
|
|
|
- that.wxLoginData = uni.getStorageSync("wxLoginData")
|
|
|
- console.log(1111111, that.wxLoginData && that.wxLoginData.rawData)
|
|
|
- that.userNmae = JSON.parse(that.wxLoginData.rawData).nickName
|
|
|
- that.getUserInfo()
|
|
|
+ // uni.setStorage({
|
|
|
+ // key: 'wxLoginData',
|
|
|
+ // data: {
|
|
|
+ // code: res2.code,
|
|
|
+ // encryptedData: info.encryptedData,
|
|
|
+ // iv: info.iv,
|
|
|
+ // rawData: info.rawData,
|
|
|
+ // signature: info.signature,
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // that.wxLoginData = uni.getStorageSync("wxLoginData")
|
|
|
+ // console.log(1111111, that.wxLoginData && that.wxLoginData.rawData)
|
|
|
+ // that.userNmae = JSON.parse(that.wxLoginData.rawData).nickName
|
|
|
+ // that.getUserInfo()
|
|
|
// this.$refs.uTips.show({
|
|
|
// title: '获取角色信息成功',
|
|
|
// type: 'success',
|
|
@@ -260,19 +259,19 @@
|
|
|
},
|
|
|
fail: (error) => {
|
|
|
console.log(2222, error)
|
|
|
- that.$refs.uTips.show({
|
|
|
- title: '微信登录授权失败',
|
|
|
- type: 'warning',
|
|
|
- })
|
|
|
+ // that.$refs.uTips.show({
|
|
|
+ // title: '微信登录授权失败',
|
|
|
+ // type: 'warning',
|
|
|
+ // })
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
fail: () => {
|
|
|
console.log(33333, error)
|
|
|
- that.$refs.uTips.show({
|
|
|
- title: '微信登录授权失败',
|
|
|
- type: 'warning',
|
|
|
- })
|
|
|
+ // that.$refs.uTips.show({
|
|
|
+ // title: '微信登录授权失败',
|
|
|
+ // type: 'warning',
|
|
|
+ // })
|
|
|
}
|
|
|
})
|
|
|
// uni.getProvider({
|