From 76a4db8c4e4f5de68d7b9d9be6a776da8c2fb976 Mon Sep 17 00:00:00 2001 From: hamid zarghami Date: Wed, 12 Nov 2025 11:07:16 +0330 Subject: [PATCH] edit login --- .env | 2 +- src/App.tsx | 2 +- src/pages/auth/hooks/useAuthData.tsx | 2 +- src/pages/auth/store/AuthStore.ts | 2 +- src/router/Auth.tsx | 11 ++++++++--- 5 files changed, 12 insertions(+), 7 deletions(-) diff --git a/.env b/.env index d6e0a82..588a700 100644 --- a/.env +++ b/.env @@ -1,4 +1,4 @@ VITE_TOKEN_NAME = 'dmnu_a_t' 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' \ No newline at end of file diff --git a/src/App.tsx b/src/App.tsx index fde6b96..91a0495 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -99,7 +99,7 @@ const App: FC = () => { const [isLogin, setIsLogin] = useState<'checking' | 'isLogin' | 'isNotLogin'>('checking') useEffect(() => { - const token = getToken() || 'test' + const token = getToken() if (token) { setIsLogin('isLogin') } else { diff --git a/src/pages/auth/hooks/useAuthData.tsx b/src/pages/auth/hooks/useAuthData.tsx index 0c480e9..39fbba0 100644 --- a/src/pages/auth/hooks/useAuthData.tsx +++ b/src/pages/auth/hooks/useAuthData.tsx @@ -1,6 +1,6 @@ import { useMutation } from '@tanstack/react-query'; 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 = () => { return useMutation({ diff --git a/src/pages/auth/store/AuthStore.ts b/src/pages/auth/store/AuthStore.ts index de766e3..c6751b4 100644 --- a/src/pages/auth/store/AuthStore.ts +++ b/src/pages/auth/store/AuthStore.ts @@ -1,5 +1,5 @@ import { create } from "zustand"; -import { AuthStoreType } from "../../auth/types/AuthTypes"; +import { type AuthStoreType } from "../../auth/types/AuthTypes"; export const useAuthStore = create((set) => ({ phone: "", diff --git a/src/router/Auth.tsx b/src/router/Auth.tsx index a8ee7b8..e7693f3 100644 --- a/src/router/Auth.tsx +++ b/src/router/Auth.tsx @@ -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 ( -
Auth
+ sa + } /> + ) }