edit login
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
VITE_TOKEN_NAME = 'dmnu_a_t'
|
VITE_TOKEN_NAME = 'dmnu_a_t'
|
||||||
VITE_REFRESH_TOKEN_NAME = 'dmnu-a-rt'
|
VITE_REFRESH_TOKEN_NAME = 'dmnu-a-rt'
|
||||||
VITE_BASE_URL = 'https://api.danakcorp.com'
|
VITE_BASE_URL = 'https://dmenuplus-api.dev.danakcorp.com'
|
||||||
# VITE_BASE_URL = 'http://192.168.1.112:4001'
|
# VITE_BASE_URL = 'http://192.168.1.112:4001'
|
||||||
+1
-1
@@ -99,7 +99,7 @@ const App: FC = () => {
|
|||||||
|
|
||||||
const [isLogin, setIsLogin] = useState<'checking' | 'isLogin' | 'isNotLogin'>('checking')
|
const [isLogin, setIsLogin] = useState<'checking' | 'isLogin' | 'isNotLogin'>('checking')
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const token = getToken() || 'test'
|
const token = getToken()
|
||||||
if (token) {
|
if (token) {
|
||||||
setIsLogin('isLogin')
|
setIsLogin('isLogin')
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { useMutation } from '@tanstack/react-query';
|
import { useMutation } from '@tanstack/react-query';
|
||||||
import * as api from '../service/AuthService'
|
import * as api from '../service/AuthService'
|
||||||
import { CheckHasAccountPhoneType, CheckHasAccountType, LoginWithOtpType, LoginWithPasswordType, OtpVerifyType, RegisterType } from '../types/AuthTypes';
|
import type { CheckHasAccountPhoneType, CheckHasAccountType, LoginWithOtpType, LoginWithPasswordType, OtpVerifyType, RegisterType } from '../types/AuthTypes';
|
||||||
|
|
||||||
export const useLoginWithPassword = () => {
|
export const useLoginWithPassword = () => {
|
||||||
return useMutation({
|
return useMutation({
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { create } from "zustand";
|
import { create } from "zustand";
|
||||||
import { AuthStoreType } from "../../auth/types/AuthTypes";
|
import { type AuthStoreType } from "../../auth/types/AuthTypes";
|
||||||
|
|
||||||
export const useAuthStore = create<AuthStoreType>((set) => ({
|
export const useAuthStore = create<AuthStoreType>((set) => ({
|
||||||
phone: "",
|
phone: "",
|
||||||
|
|||||||
+8
-3
@@ -1,8 +1,13 @@
|
|||||||
import React from 'react'
|
import { type FC } from 'react'
|
||||||
|
import { Routes, Route } from 'react-router-dom'
|
||||||
|
import { Pages } from '../config/Pages'
|
||||||
|
import Login from '../pages/auth/Login'
|
||||||
|
|
||||||
const Auth = () => {
|
const Auth: FC = () => {
|
||||||
return (
|
return (
|
||||||
<div>Auth</div>
|
<Routes>sa
|
||||||
|
<Route path={Pages.auth.login} element={<Login />} />
|
||||||
|
</Routes>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user