delete console log
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
'use client'; // Bắt buộc phải có dòng này
|
||||
'use client';
|
||||
|
||||
import { useState, useEffect } from 'react';
|
||||
import { apiGetCurrentUser } from "@/service/auth";
|
||||
@@ -13,10 +13,10 @@ export default function GetUser() {
|
||||
try {
|
||||
setLoading(true);
|
||||
const result = await apiGetCurrentUser();
|
||||
console.log("Current User from useEffect:", result);
|
||||
// console.log("Current User from useEffect:", result);
|
||||
setUser(result);
|
||||
} catch (err) {
|
||||
console.error("Lỗi 401 hoặc lỗi kết nối:", err);
|
||||
// console.error("Lỗi 401 hoặc lỗi kết nối:", err);
|
||||
// setError(err);
|
||||
} finally {
|
||||
setLoading(false);
|
||||
@@ -24,7 +24,7 @@ export default function GetUser() {
|
||||
};
|
||||
|
||||
fetchUser();
|
||||
}, []); // Dependency array rỗng để chỉ chạy 1 lần khi mount
|
||||
}, []);
|
||||
|
||||
if (loading) return <div>Đang tải thông tin...</div>;
|
||||
if (error) return <div>Bạn chưa đăng nhập (Lỗi 401)</div>;
|
||||
|
||||
@@ -65,13 +65,13 @@ export default function SignInForm() {
|
||||
setLoading(true);
|
||||
|
||||
const res = await apiSignIn(formData);
|
||||
console.log("API Sign In Response:", res);
|
||||
// console.log("API Sign In Response:", res);
|
||||
|
||||
if (res.status === true) {
|
||||
toast.success("Đăng nhập thành công!");
|
||||
const data = await apiGetCurrentUser();
|
||||
|
||||
console.log("Current User Data:", data);
|
||||
// console.log("Current User Data:", data);
|
||||
if (data?.data) {
|
||||
dispatch(setUserData(data.data));
|
||||
router.push("/");
|
||||
|
||||
@@ -101,11 +101,7 @@ export default function SignUpForm() {
|
||||
token_id: tokenId,
|
||||
};
|
||||
|
||||
|
||||
const signupRes = await apiSignUp(signupPayload);
|
||||
console.log("API Sign Up Response:", signupRes);
|
||||
|
||||
console.log("Đăng ký thành công!", signupRes);
|
||||
alert("Đăng ký thành công! Đang chuyển hướng...");
|
||||
|
||||
window.location.href = "/signin";
|
||||
|
||||
Reference in New Issue
Block a user