refactor(api): 统一API路径配置并优化相关服务调用
All checks were successful
test/timeline-frontend/pipeline/head This commit looks good
All checks were successful
test/timeline-frontend/pipeline/head This commit looks good
feat: 添加API URL全局配置文件 fix: 修复SSR环境下的窗口对象检查 perf: 优化代理配置路径匹配顺序 style: 移除无用注释和未使用的类型声明
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { getFakeCaptcha } from '@/services/ant-design-pro/login';
|
||||
import { loginUser } from '@/services/user/api';
|
||||
import type { UserLoginParams, UserLoginResult } from '@/services/user/typing';
|
||||
import { CommonResponse } from '@/types/common';
|
||||
import {
|
||||
AlipayCircleOutlined,
|
||||
@@ -133,9 +134,9 @@ const Login: React.FC = () => {
|
||||
currentUser: response.data,
|
||||
}));
|
||||
const urlParams = new URL(window.location.href).searchParams;
|
||||
// 修复:直接使用 redirect 参数,如果不存在则跳转到首页
|
||||
// 修复:使用 history.push 进行跳转,避免页面刷新导致状态丢失
|
||||
const redirect = urlParams.get('redirect');
|
||||
window.location.href = redirect || '/';
|
||||
history.push(redirect || '/');
|
||||
return;
|
||||
}
|
||||
console.log(response.message);
|
||||
|
||||
Reference in New Issue
Block a user