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