dev #758
@ -3,6 +3,7 @@
|
||||
import { useState } from 'react'
|
||||
import { useMessage } from '@/hooks/useMessage'
|
||||
import { setSession, login } from '@/lib/authActions'
|
||||
import Cookies from 'js-cookie'
|
||||
import { sessionStore } from '@/store/commonAtom'
|
||||
import { useRecoilState } from 'recoil'
|
||||
import { useAxios } from '@/hooks/useAxios'
|
||||
@ -31,6 +32,7 @@ export default function AutoLoginPage({ autoLoginParam }) {
|
||||
setIsLoading(false)
|
||||
if (response.data) {
|
||||
const res = response.data
|
||||
if (res.sessionId) Cookies.set('sessionId', res.sessionId)
|
||||
const result = { ...res, storeLvl: res.groupId === '60000' ? '1' : '2', pwdInitYn: 'Y' }
|
||||
setSession(result)
|
||||
setSessionState(result)
|
||||
|
||||
@ -48,6 +48,7 @@ export default function Login() {
|
||||
post({ url: '/api/login/v1.0/user', data: { loginId: res.data } }).then((response) => {
|
||||
setIsLoading(false)
|
||||
if (response) {
|
||||
if (response.sessionId) Cookies.set('sessionId', response.sessionId)
|
||||
const result = { ...response, storeLvl: response.groupId === '60000' ? '1' : '2', pwdInitYn: 'Y' }
|
||||
setSession(result)
|
||||
setSessionState(result)
|
||||
@ -107,7 +108,7 @@ export default function Login() {
|
||||
if (res) {
|
||||
setIsLoading(false)
|
||||
if (res.data.result.resultCode === 'S') {
|
||||
Cookies.set('sessionId', res.data.sessionId)
|
||||
if (res.data.sessionId) Cookies.set('sessionId', res.data.sessionId)
|
||||
setSession(res.data.data)
|
||||
setSessionState(res.data.data)
|
||||
// ID SAVE 체크되어 있는 경우, 쿠키 저장
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user