Super code can be disabled

This commit is contained in:
skiffer-git
2022-07-02 09:50:25 +08:00
parent 7ffe857f52
commit d7ce455f2f
5 changed files with 9 additions and 6 deletions
+1 -1
View File
@@ -46,7 +46,7 @@ func SetPassword(c *gin.Context) {
if params.Nickname == "" {
params.Nickname = account
}
if params.VerificationCode != config.Config.Demo.SuperCode {
if (config.Config.Demo.UseSuperCode && params.VerificationCode != config.Config.Demo.SuperCode) || !config.Config.Demo.UseSuperCode {
accountKey := params.AreaCode + account + "_" + constant.VerificationCodeForRegisterSuffix
v, err := db.DB.GetAccountCode(accountKey)
if err != nil || v != params.VerificationCode {