修复登录退出接口路径

This commit is contained in:
whyour 2021-12-21 23:42:05 +08:00
parent 46aaeb4eac
commit 03c9f79549
5 changed files with 8 additions and 4 deletions

View File

@ -77,7 +77,7 @@ export default {
writePathList: [configPath, scriptPath], writePathList: [configPath, scriptPath],
bakPath, bakPath,
apiWhiteList: [ apiWhiteList: [
'/api/login', '/api/user/login',
'/open/auth/token', '/open/auth/token',
'/api/user/two-factor/login', '/api/user/two-factor/login',
'/api/system', '/api/system',

View File

@ -44,7 +44,7 @@ export default function (props: any) {
const [collapsed, setCollapsed] = useState(false); const [collapsed, setCollapsed] = useState(false);
const logout = () => { const logout = () => {
request.post(`${config.apiPrefix}logout`).then(() => { request.post(`${config.apiPrefix}user/logout`).then(() => {
localStorage.removeItem(config.authKey); localStorage.removeItem(config.authKey);
history.push('/login'); history.push('/login');
}); });

View File

@ -73,6 +73,10 @@ const Initialization = () => {
setFields(_fields || []); setFields(_fields || []);
}; };
useEffect(() => {
localStorage.removeItem(config.authKey);
}, []);
const steps = [ const steps = [
{ {
title: '欢迎使用', title: '欢迎使用',

View File

@ -31,7 +31,7 @@ const Login = () => {
setTwoFactor(false); setTwoFactor(false);
setWaitTime(null); setWaitTime(null);
request request
.post(`${config.apiPrefix}login`, { .post(`${config.apiPrefix}user/login`, {
data: { data: {
username: values.username, username: values.username,
password: values.password, password: values.password,

View File

@ -34,7 +34,7 @@ const errorHandler = function (error: any) {
const _request = extend({ timeout: 60000, params: { t: time }, errorHandler }); const _request = extend({ timeout: 60000, params: { t: time }, errorHandler });
const apiWhiteList = [ const apiWhiteList = [
'/api/login', '/api/user/login',
'/open/auth/token', '/open/auth/token',
'/api/user/two-factor/login', '/api/user/two-factor/login',
'/api/system', '/api/system',