fix: fix aff not effective (#937)

This commit is contained in:
Buer 2024-01-20 12:38:06 +08:00 committed by GitHub
parent eed9f5fdf0
commit e2ed0399f0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -6,6 +6,10 @@ 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) {