开通会员微信支付功能开发,调整移动端设备禁止页面字体跟随系统变更
This commit is contained in:
46
pages/wxAuth/wxAuth.vue
Normal file
46
pages/wxAuth/wxAuth.vue
Normal file
@@ -0,0 +1,46 @@
|
||||
<template>
|
||||
<view class="content vertical">
|
||||
<u-loading mode="flower"></u-loading>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { wxCode, wxOpenid } from '@/apis/interfaces/wx'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
||||
};
|
||||
},
|
||||
created() {
|
||||
// 微信鉴权
|
||||
if(!this.$Route.query.code){
|
||||
wxCode({
|
||||
pages: 'wechat-auth'
|
||||
}).then(res => {
|
||||
window.location.href = res
|
||||
})
|
||||
}else{
|
||||
wxOpenid({
|
||||
code: this.$Route.query.code
|
||||
}).then(res => {
|
||||
this.$store.commit('setCode', res.openid)
|
||||
this.$Router.replaceAll({name: 'Index'})
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
title: err.message,
|
||||
icon : 'none'
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.content{
|
||||
background: white;
|
||||
height: 100vh;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user