update bug fixed
parent
2efc9cc00d
commit
afa890b8b7
|
|
@ -82,6 +82,7 @@ export default {
|
||||||
// 获取来源页面的域名
|
// 获取来源页面的域名
|
||||||
const getReferer = () => {
|
const getReferer = () => {
|
||||||
let ref = document.referrer;
|
let ref = document.referrer;
|
||||||
|
console.log('refref:', ref);
|
||||||
// 处理开发和生产环境
|
// 处理开发和生产环境
|
||||||
if (!ref) {
|
if (!ref) {
|
||||||
if (process.env.NODE_ENV === 'development') {
|
if (process.env.NODE_ENV === 'development') {
|
||||||
|
|
@ -91,23 +92,25 @@ export default {
|
||||||
window.location.href = "https://www.ycymedu.com"; // 生产环境重定向
|
window.location.href = "https://www.ycymedu.com"; // 生产环境重定向
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const url = new URL(ref);
|
try {
|
||||||
referer.value = url.origin; // 存储来源网址的域名部分
|
const url = new URL(ref);
|
||||||
|
console.log('url:', url);
|
||||||
|
referer.value = url.origin; // 存储来源网址的域名部分
|
||||||
|
|
||||||
// 获取 redirect_uri 查询参数
|
|
||||||
const redirectUri = url.searchParams.get('redirect_uri');
|
} catch (error) {
|
||||||
if (redirectUri) {
|
console.error('解析来源网址时出错:', error);
|
||||||
referer.value = redirectUri; // 更新 referer 为 redirect_uri
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// 微信扫码登录初始化
|
// 微信扫码登录初始化
|
||||||
const initWeChatLogin = () => {
|
const initWeChatLogin = () => {
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
console.log(import.meta.env.VUE_APP_WECHAT_APPID);
|
console.log(import.meta.env.VUE_APP_WECHAT_APPID);
|
||||||
const appid = 'wxf8db44d5ec082dfc';
|
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);
|
const state = Math.random().toString(36).substr(2);
|
||||||
|
|
||||||
new WxLogin({
|
new WxLogin({
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue