Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
new-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
defda1df
authored
Jan 21, 2026
by
Calcium-Ion
Committed by
GitHub
Jan 21, 2026
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2676 from seefs001/fix/aff-login-method
fix: the login method cannot be displayed under the aff link.
parents
ffd20f9f
eb828f63
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
18 deletions
+32
-18
web/src/components/auth/LoginForm.jsx
+15
-7
web/src/components/auth/RegisterForm.jsx
+17
-11
No files found.
web/src/components/auth/LoginForm.jsx
View file @
defda1df
...
...
@@ -17,9 +17,10 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import
React
,
{
useContext
,
useEffect
,
useRef
,
useState
}
from
'react'
;
import
React
,
{
useContext
,
useEffect
,
use
Memo
,
use
Ref
,
useState
}
from
'react'
;
import
{
Link
,
useNavigate
,
useSearchParams
}
from
'react-router-dom'
;
import
{
UserContext
}
from
'../../context/User'
;
import
{
StatusContext
}
from
'../../context/Status'
;
import
{
API
,
getLogo
,
...
...
@@ -73,6 +74,7 @@ const LoginForm = () => {
const
[
searchParams
,
setSearchParams
]
=
useSearchParams
();
const
[
submitted
,
setSubmitted
]
=
useState
(
false
);
const
[
userState
,
userDispatch
]
=
useContext
(
UserContext
);
const
[
statusState
]
=
useContext
(
StatusContext
);
const
[
turnstileEnabled
,
setTurnstileEnabled
]
=
useState
(
false
);
const
[
turnstileSiteKey
,
setTurnstileSiteKey
]
=
useState
(
''
);
const
[
turnstileToken
,
setTurnstileToken
]
=
useState
(
''
);
...
...
@@ -108,20 +110,26 @@ const LoginForm = () => {
localStorage
.
setItem
(
'aff'
,
affCode
);
}
const
[
status
]
=
useState
(()
=>
{
const
status
=
useMemo
(()
=>
{
if
(
statusState
?.
status
)
return
statusState
.
status
;
const
savedStatus
=
localStorage
.
getItem
(
'status'
);
return
savedStatus
?
JSON
.
parse
(
savedStatus
)
:
{};
});
if
(
!
savedStatus
)
return
{};
try
{
return
JSON
.
parse
(
savedStatus
)
||
{};
}
catch
(
err
)
{
return
{};
}
},
[
statusState
?.
status
]);
useEffect
(()
=>
{
if
(
status
.
turnstile_check
)
{
if
(
status
?
.
turnstile_check
)
{
setTurnstileEnabled
(
true
);
setTurnstileSiteKey
(
status
.
turnstile_site_key
);
}
// 从 status 获取用户协议和隐私政策的启用状态
setHasUserAgreement
(
status
.
user_agreement_enabled
||
false
);
setHasPrivacyPolicy
(
status
.
privacy_policy_enabled
||
false
);
setHasUserAgreement
(
status
?
.
user_agreement_enabled
||
false
);
setHasPrivacyPolicy
(
status
?
.
privacy_policy_enabled
||
false
);
},
[
status
]);
useEffect
(()
=>
{
...
...
web/src/components/auth/RegisterForm.jsx
View file @
defda1df
...
...
@@ -17,7 +17,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import
React
,
{
useContext
,
useEffect
,
useRef
,
useState
}
from
'react'
;
import
React
,
{
useContext
,
useEffect
,
use
Memo
,
use
Ref
,
useState
}
from
'react'
;
import
{
Link
,
useNavigate
}
from
'react-router-dom'
;
import
{
API
,
...
...
@@ -59,6 +59,7 @@ import LinuxDoIcon from '../common/logo/LinuxDoIcon';
import
WeChatIcon
from
'../common/logo/WeChatIcon'
;
import
TelegramLoginButton
from
'react-telegram-login/src'
;
import
{
UserContext
}
from
'../../context/User'
;
import
{
StatusContext
}
from
'../../context/Status'
;
import
{
useTranslation
}
from
'react-i18next'
;
import
{
SiDiscord
}
from
'react-icons/si'
;
...
...
@@ -80,6 +81,7 @@ const RegisterForm = () => {
});
const
{
username
,
password
,
password2
}
=
inputs
;
const
[
userState
,
userDispatch
]
=
useContext
(
UserContext
);
const
[
statusState
]
=
useContext
(
StatusContext
);
const
[
turnstileEnabled
,
setTurnstileEnabled
]
=
useState
(
false
);
const
[
turnstileSiteKey
,
setTurnstileSiteKey
]
=
useState
(
''
);
const
[
turnstileToken
,
setTurnstileToken
]
=
useState
(
''
);
...
...
@@ -114,25 +116,29 @@ const RegisterForm = () => {
localStorage
.
setItem
(
'aff'
,
affCode
);
}
const
[
status
]
=
useState
(()
=>
{
const
status
=
useMemo
(()
=>
{
if
(
statusState
?.
status
)
return
statusState
.
status
;
const
savedStatus
=
localStorage
.
getItem
(
'status'
);
return
savedStatus
?
JSON
.
parse
(
savedStatus
)
:
{};
});
if
(
!
savedStatus
)
return
{};
try
{
return
JSON
.
parse
(
savedStatus
)
||
{};
}
catch
(
err
)
{
return
{};
}
},
[
statusState
?.
status
]);
const
[
showEmailVerification
,
setShowEmailVerification
]
=
useState
(()
=>
{
return
status
.
email_verification
??
false
;
});
const
[
showEmailVerification
,
setShowEmailVerification
]
=
useState
(
false
);
useEffect
(()
=>
{
setShowEmailVerification
(
status
.
email_verification
);
if
(
status
.
turnstile_check
)
{
setShowEmailVerification
(
!!
status
?
.
email_verification
);
if
(
status
?
.
turnstile_check
)
{
setTurnstileEnabled
(
true
);
setTurnstileSiteKey
(
status
.
turnstile_site_key
);
}
// 从 status 获取用户协议和隐私政策的启用状态
setHasUserAgreement
(
status
.
user_agreement_enabled
||
false
);
setHasPrivacyPolicy
(
status
.
privacy_policy_enabled
||
false
);
setHasUserAgreement
(
status
?
.
user_agreement_enabled
||
false
);
setHasPrivacyPolicy
(
status
?
.
privacy_policy_enabled
||
false
);
},
[
status
]);
useEffect
(()
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment