mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-24 07:16:08 +08:00
修复登录退出接口路径
This commit is contained in:
parent
46aaeb4eac
commit
03c9f79549
|
@ -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',
|
||||||
|
|
|
@ -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');
|
||||||
});
|
});
|
||||||
|
|
|
@ -73,6 +73,10 @@ const Initialization = () => {
|
||||||
setFields(_fields || []);
|
setFields(_fields || []);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
localStorage.removeItem(config.authKey);
|
||||||
|
}, []);
|
||||||
|
|
||||||
const steps = [
|
const steps = [
|
||||||
{
|
{
|
||||||
title: '欢迎使用',
|
title: '欢迎使用',
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -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',
|
||||||
|
|
Loading…
Reference in New Issue
Block a user