|
|
|
|
@ -13,42 +13,14 @@
|
|
|
|
|
} from '@/api'
|
|
|
|
|
const wxGetUserInfo = (res) => {
|
|
|
|
|
let appid = GzhConfig.id
|
|
|
|
|
let state = encodeURIComponent(GzhConfig.auth)
|
|
|
|
|
let redirect_uri = encodeURIComponent(GzhConfig.jump);
|
|
|
|
|
const url = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=' + appid + '&redirect_uri=' +
|
|
|
|
|
redirect_uri + '&response_type=code&scope=snsapi_base&state=' + state + '#wechat_redirect';
|
|
|
|
|
window.location = url;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const drawer_ref = ref(null)
|
|
|
|
|
const drawerRef = (e) => {
|
|
|
|
|
drawer_ref.value = e
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const copyContent = () => {
|
|
|
|
|
uni.setClipboardData({
|
|
|
|
|
data: user_code.value
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
const WeChatLoginTest = async () => {
|
|
|
|
|
let appid = uni.$lu.config.gzh_id
|
|
|
|
|
let state = encodeURIComponent(uni.$lu.config.login)
|
|
|
|
|
let redirect_uri = encodeURIComponent(OpenGzhAuthUrl);
|
|
|
|
|
let state = encodeURIComponent(GzhConfig.jump)
|
|
|
|
|
let redirect_uri = encodeURIComponent(GzhConfig.auth);
|
|
|
|
|
const url = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=' + appid + '&redirect_uri=' +
|
|
|
|
|
redirect_uri + '&response_type=code&scope=snsapi_base&state=' + state + '#wechat_redirect';
|
|
|
|
|
window.location = url;
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
<template>
|
|
|
|
|
<uni-drawer :ref="drawerRef" mode="right">
|
|
|
|
|
<view class="navbar_wrapper"></view>
|
|
|
|
|
<textarea :maxlength="-1" class="textarea_wrapper" v-model="user_code" />
|
|
|
|
|
<view class="button_line_wrapper">
|
|
|
|
|
<button size="mini" @click="copyContent()">复制</button>
|
|
|
|
|
<button size="mini" @click="WeChatLoginTest()">登录</button>
|
|
|
|
|
</view>
|
|
|
|
|
</uni-drawer>
|
|
|
|
|
|
|
|
|
|
<uni-section title="用户Code" type="line">
|
|
|
|
|
<view class="uni-ma-5 uni-pb-5 example_item_wrapper">
|
|
|
|
|
<button size="mini" @click="wxGetUserInfo">获取Code</button>
|
|
|
|
|
|