🐛 fix: aff not effective

This commit is contained in:
Martial BE 2024-01-15 14:15:54 +08:00 committed by Buer
parent 983e77cb73
commit 0bfe1f5779

View File

@ -6,6 +6,11 @@ const useRegister = () => {
const navigate = useNavigate(); const navigate = useNavigate();
const register = async (input, turnstile) => { const register = async (input, turnstile) => {
try { try {
let affCode = localStorage.getItem('aff');
if (affCode) {
input = { ...input, aff_code: affCode };
}
const res = await API.post(`/api/user/register?turnstile=${turnstile}`, input); const res = await API.post(`/api/user/register?turnstile=${turnstile}`, input);
const { success, message } = res.data; const { success, message } = res.data;
if (success) { if (success) {