update bug fixed

main
old易 2024-09-28 14:21:08 +08:00
parent 2efc9cc00d
commit afa890b8b7
1 changed files with 10 additions and 7 deletions

View File

@ -82,6 +82,7 @@ export default {
//
const getReferer = () => {
let ref = document.referrer;
console.log('refref:', ref);
//
if (!ref) {
if (process.env.NODE_ENV === 'development') {
@ -91,23 +92,25 @@ export default {
window.location.href = "https://www.ycymedu.com"; //
}
} else {
const url = new URL(ref);
referer.value = url.origin; //
try {
const url = new URL(ref);
console.log('url:', url);
referer.value = url.origin; //
// redirect_uri
const redirectUri = url.searchParams.get('redirect_uri');
if (redirectUri) {
referer.value = redirectUri; // referer redirect_uri
} catch (error) {
console.error('解析来源网址时出错:', error);
}
}
};
//
const initWeChatLogin = () => {
nextTick(() => {
console.log(import.meta.env.VUE_APP_WECHAT_APPID);
const appid = 'wxf8db44d5ec082dfc';
const redirectUri = encodeURIComponent('https://api.sso.ycymedu.com/api/syswechat/snlogin?redirect_uri=' + referer);
const redirectUri = encodeURIComponent('https://api.sso.ycymedu.com/api/syswechat/snlogin?redirect_uri=' + referer.value);
const state = Math.random().toString(36).substr(2);
new WxLogin({