暂未开放用户注册

dev
truthhun 1 year ago
parent 8bf7d7c1f3
commit ce8aca37f6

@ -496,10 +496,17 @@ func (m *DBModel) GetConfigOfSecurity(name ...string) (config ConfigSecurity) {
for _, cfg := range configs {
switch cfg.Name {
case "is_close", "enable_register", "enable_captcha_login", "enable_captcha_register", "enable_captcha_comment", "enable_captcha_find_password", "enable_captcha_upload":
case ConfigSecurityIsClose,
ConfigSecurityEnableRegister,
ConfigSecurityEnableCaptchaLogin,
ConfigSecurityEnableCaptchaRegister,
ConfigSecurityEnableCaptchaComment,
ConfigSecurityEnableCaptchaFindPassword:
value, _ := strconv.ParseBool(cfg.Value)
data[cfg.Name] = value
case "max_document_size", "comment_interval", ConfigSecurityDocumentRelatedDuration:
case ConfigSecurityMaxDocumentSize,
ConfigSecurityCommentInterval,
ConfigSecurityDocumentRelatedDuration:
data[cfg.Name], _ = strconv.Atoi(cfg.Value)
case ConfigSecurityDocumentAllowedExt:
arr := strings.Split(cfg.Value, ",")

@ -119,11 +119,24 @@
<el-input v-model="user.captcha" placeholder="请输入验证码"></el-input>
</el-form-item>
<el-form-item class="register">
<el-alert
v-if="
settings && settings.security && !settings.security.enable_register
"
title="网站暂未开放用户注册"
type="warning"
:closable="false"
show-icon
style="margin-bottom: 10px"
></el-alert>
<el-button
type="primary"
class="btn-block btn-register"
icon="el-icon-check"
@click="execRegister"
:disabled="
settings && settings.security && !settings.security.enable_register
"
:loading="loading"
>立即注册</el-button
>
@ -138,7 +151,7 @@
</div>
</template>
<script>
import { mapActions } from 'vuex'
import { mapActions, mapGetters } from 'vuex'
import { getUserCaptcha } from '~/api/user'
export default {
name: 'FormRegister',
@ -164,6 +177,9 @@ export default {
loading: false,
}
},
computed: {
...mapGetters('setting', ['settings']),
},
created() {
this.loadCaptcha()
},

Loading…
Cancel
Save