hookehuyr

refactor(router): 简化未授权地址的生成逻辑

移除冗余的路径拼接,直接使用location.href生成未授权地址,使代码更简洁易读
/*
* @Date: 2025-03-20 20:36:36
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2025-03-26 13:50:07
* @LastEditTime: 2025-03-26 16:52:03
* @FilePath: /mlaj/src/router/guards.js
* @Description: 路由守卫逻辑
*/
......@@ -31,7 +31,7 @@ export const checkWxAuth = async () => {
const { code, data } = await getAuthInfoAPI();
if (code && !data.openid_has) {
// 直接在这里处理授权跳转
let raw_url = encodeURIComponent(location.origin + location.pathname + location.href); // 未授权的地址
let raw_url = encodeURIComponent(location.href); // 未授权的地址
const short_url = `/srv/?f=behalo&a=openid&res=${raw_url}`;
location.href = short_url;
......