| | |
| | | this.cid = opt.cid |
| | | this.init() |
| | | } |
| | | if (opt.code || opt.auth_code) { |
| | | if (opt.code || opt.auth_code || opt.userAuthCode) { |
| | | let params = { |
| | | code: opt.code |
| | | } |
| | | let code = opt.code |
| | | if (this.payWay == 2&&opt.state == 1 ) { |
| | | if (this.payWay == 2&&opt.state == 1 ) { //微信 |
| | | params.getUserInfo = 1 |
| | | } |
| | | if (this.payWay == 5) { |
| | | if (this.payWay == 5) { //支付宝 |
| | | params.code = opt.auth_code |
| | | } |
| | | if (this.payWay == 15) { //云闪付 |
| | | code = opt.userAuthCode |
| | | } |
| | | const cd = uni.getStorageSync('cd') |
| | | if (code === cd) { |
| | |
| | | if (res.unionid) { |
| | | uni.setStorageSync('UNIONID' + this.payWay, res.unionid) |
| | | } |
| | | if (res.aLiUserId) { |
| | | uni.setStorageSync('ALIUSERID' + this.payWay, res.aLiUserId) |
| | | } |
| | | this.UNIONID = res.unionid |
| | | uni.setStorageSync(ACCESSTOKEN, res.token) |
| | | uni.setStorageSync('IS_NEW', res.isNew) |