|
@@ -9,17 +9,11 @@
|
|
|
} from "@dcloudio/uni-app"
|
|
} from "@dcloudio/uni-app"
|
|
|
|
|
|
|
|
const APPKEY = '4AA7B3944BDF3739'
|
|
const APPKEY = '4AA7B3944BDF3739'
|
|
|
- const APPID = 'wxd87cbe1db0437303'
|
|
|
|
|
const ocode = '1015730314'
|
|
const ocode = '1015730314'
|
|
|
- const SCOPE = 'snsapi_base'
|
|
|
|
|
- const URL = 'https://chtech.ncjti.edu.cn/jiaofei/jiaofeiManage/'
|
|
|
|
|
- const URL2 = 'http://192.168.161.78:5173/#/pages/index/index'
|
|
|
|
|
|
|
+ const URL = 'http://192.168.161.78:5173/#/pages/index/index'
|
|
|
|
|
|
|
|
onLoad(() => {
|
|
onLoad(() => {
|
|
|
- // loginFilter()
|
|
|
|
|
- uni.switchTab({
|
|
|
|
|
- url: "/pages/home/home"
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ loginFilter()
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
const loginFilter = () => {
|
|
const loginFilter = () => {
|
|
@@ -29,25 +23,7 @@
|
|
|
if (!wxcode) {
|
|
if (!wxcode) {
|
|
|
getWxcodeURL()
|
|
getWxcodeURL()
|
|
|
} else {
|
|
} else {
|
|
|
- alert(wxcode)
|
|
|
|
|
uni.setStorageSync('wxcode', wxcode)
|
|
uni.setStorageSync('wxcode', wxcode)
|
|
|
- getCode()
|
|
|
|
|
- }
|
|
|
|
|
- } else {
|
|
|
|
|
- getCode()
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- const getCode = () => {
|
|
|
|
|
- const code = uni.getStorageSync('code');
|
|
|
|
|
- if (!code) {
|
|
|
|
|
- const code = getQueryString('code')
|
|
|
|
|
- if (!code) {
|
|
|
|
|
- alert(666)
|
|
|
|
|
- getCodeURL()
|
|
|
|
|
- } else {
|
|
|
|
|
- alert(code)
|
|
|
|
|
- uni.setStorageSync('code', code)
|
|
|
|
|
uni.switchTab({
|
|
uni.switchTab({
|
|
|
url: "/pages/home/home"
|
|
url: "/pages/home/home"
|
|
|
})
|
|
})
|
|
@@ -62,13 +38,7 @@
|
|
|
const getWxcodeURL = () => {
|
|
const getWxcodeURL = () => {
|
|
|
window.
|
|
window.
|
|
|
location.href =
|
|
location.href =
|
|
|
- `https://open.wecard.qq.com/connect/oauth/authorize?app_key=${APPKEY}&response_type=code&scope=snsapi_base&ocode=${ocode}&redirect_uri=${encodeURIComponent(URL2)}`
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- const getCodeURL = () => {
|
|
|
|
|
- window.
|
|
|
|
|
- location.href =
|
|
|
|
|
- `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${APPID}&redirect_uri=${encodeURIComponent(URL)}&response_type=code&scope=${SCOPE}#wechat_redirect`
|
|
|
|
|
|
|
+ `https://open.wecard.qq.com/connect/oauth/authorize?app_key=${APPKEY}&response_type=code&scope=snsapi_base&ocode=${ocode}&redirect_uri=${encodeURIComponent(URL)}`
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//获取当前URL指定参数
|
|
//获取当前URL指定参数
|