재수정
This commit is contained in:
@@ -54,13 +54,8 @@ export const SubLayout = () => {
|
|||||||
const [loginSuccess, setLoginSuccess] = useState<boolean>(false);
|
const [loginSuccess, setLoginSuccess] = useState<boolean>(false);
|
||||||
|
|
||||||
const wrapperClassName = 'wrapper';
|
const wrapperClassName = 'wrapper';
|
||||||
const userParmas = {
|
|
||||||
id: 'nictest00',
|
|
||||||
password: 'nictest00'
|
|
||||||
};
|
|
||||||
const handleRequestToken = useCallback(async () =>{
|
const handleRequestToken = useCallback(async () =>{
|
||||||
console.log('handleRequestToken');
|
|
||||||
alert('handleRequestToken');
|
|
||||||
requestToken().then((token) => {
|
requestToken().then((token) => {
|
||||||
if(!token) {
|
if(!token) {
|
||||||
// 토큰이 null인 경우 로그아웃 처리
|
// 토큰이 null인 경우 로그아웃 처리
|
||||||
@@ -70,7 +65,7 @@ export const SubLayout = () => {
|
|||||||
logout();
|
logout();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
console.log('token', token);
|
console.log('token ' + JSON.stringify(token));
|
||||||
|
|
||||||
setLocalStorage(StorageKeys.Usrid, token.usrid);
|
setLocalStorage(StorageKeys.Usrid, token.usrid);
|
||||||
setLocalStorage(StorageKeys.TokenType, token.tokenType);
|
setLocalStorage(StorageKeys.TokenType, token.tokenType);
|
||||||
@@ -83,7 +78,7 @@ export const SubLayout = () => {
|
|||||||
setLocalStorage(StorageKeys.Requires2FA, token.requires2FA);
|
setLocalStorage(StorageKeys.Requires2FA, token.requires2FA);
|
||||||
|
|
||||||
useStore.getState().UserStore.setUserInfo({
|
useStore.getState().UserStore.setUserInfo({
|
||||||
usrid: userParmas.id,
|
usrid: token.usrid,
|
||||||
tokenType: token.tokenType,
|
tokenType: token.tokenType,
|
||||||
accessToken: token.accessToken,
|
accessToken: token.accessToken,
|
||||||
refreshToken: token.refreshToken,
|
refreshToken: token.refreshToken,
|
||||||
@@ -129,6 +124,10 @@ export const SubLayout = () => {
|
|||||||
|
|
||||||
|
|
||||||
const handleLogin = useCallback(async () => {
|
const handleLogin = useCallback(async () => {
|
||||||
|
const userParmas = {
|
||||||
|
id: 'nictest00',
|
||||||
|
password: 'nictest00'
|
||||||
|
};
|
||||||
callLogin(userParmas).then(() => {
|
callLogin(userParmas).then(() => {
|
||||||
callHomeGroups();
|
callHomeGroups();
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user