Commit 5b242f46 by 张立顺

添加alert

1 parent 8941c3ac
...@@ -130,7 +130,8 @@ export default { ...@@ -130,7 +130,8 @@ export default {
this.merchantId = merchantId this.merchantId = merchantId
this.merchantName = merchantName this.merchantName = merchantName
console.log(appId, 'appId') console.log(appId, 'appId')
console.log('ap.getAuthCode', ap.getAuthCode) // console.log('ap.getAuthCode', ap.getAuthCode)
alert(appId)
// 请求用户授权 // 请求用户授权
ap.getAuthCode({ ap.getAuthCode({
// appId: '${appId}', // appId: '${appId}',
...@@ -139,9 +140,11 @@ export default { ...@@ -139,9 +140,11 @@ export default {
// 主动授权:auth_user,静默授权:auth_base。或者其它scope // 主动授权:auth_user,静默授权:auth_base。或者其它scope
scopes: ['auth_base'] scopes: ['auth_base']
}, function (res) { }, function (res) {
console.log('res.authCode', res.authCode) alert(JSON.stringify(res))
console.log(JSON.stringify(res))
res.authCode && that.getOpenId(res.authCode) res.authCode && that.getOpenId(res.authCode)
}, function (res) { }, function (res) {
alert(JSON.stringify(res))
console.log('res.fail', res) console.log('res.fail', res)
// res.authCode && that.getOpenId(res.authCode) // res.authCode && that.getOpenId(res.authCode)
}) })
...@@ -159,16 +162,16 @@ export default { ...@@ -159,16 +162,16 @@ export default {
}, },
methods: { methods: {
getOpenId(code) { getOpenId(code) {
// ap.alert(JSON.stringify(code))
console.log('getOpenId', code) console.log('getOpenId', code)
console.log(alipayOauthToken) console.log(alipayOauthToken)
// !code&&console.log('alipayOauthToken') // !code&&console.log('alipayOauthToken')
code && alipayOauthToken({ code }).then((result) => { code && alipayOauthToken({ code }).then((result) => {
alert('alipayOauthToken', JSON.stringify(result))
console.log('alipayOauthToken', result) console.log('alipayOauthToken', result)
const { userId } = result const { userId } = result
this.userId = userId this.userId = userId
// ap.alert(JSON.stringify(result))
}).catch((err) => { }).catch((err) => {
alert(JSON.stringify(err))
// ap.alert(JSON.stringify(err)) // ap.alert(JSON.stringify(err))
console.log('err', err) console.log('err', err)
}) })
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!