feat: allow user to sign up

This commit is contained in:
semmy 2021-11-29 20:59:31 +08:00
parent a5e2d57894
commit e435fe0ff3
6 changed files with 16 additions and 2 deletions

View File

@ -93,6 +93,13 @@ const schema: ISchema = {
{ label: '简体中文', value: 'zh-CN' },
],
},
allowSignUp: {
type: 'string',
title: '{{t("Allow sign up")}}',
'x-component': 'Checkbox',
'x-decorator': 'FormItem',
default: true,
},
},
},
},

View File

@ -69,7 +69,7 @@ export function RouteSchemaRenderer({ route }) {
},
);
const compile = useCompile();
const { title } = useSystemSettings();
const { title, allowSignUp = true } = useSystemSettings();
if (loading) {
return <Spin size={'large'} className={'nb-spin-center'} />;
}
@ -82,7 +82,7 @@ export function RouteSchemaRenderer({ route }) {
</Helmet>
<SchemaRenderer
components={{ Div }}
scope={{ useSignin, useSignup }}
scope={{ useSignin, useSignup, allowSignUp }}
schema={data}
/>
</div>

View File

@ -39,6 +39,7 @@ export default {
'Switch role': 'Switch role',
'Super admin': 'Super admin',
'Language': 'Language',
'Allow sign up': 'Allow sign up',
'Sign out': 'Sign out',
'Cancel': 'Cancel',
'Submit': 'Submit',

View File

@ -40,6 +40,7 @@ export default {
'Switch role': '切换角色',
'Super admin': '超级管理员',
'Language': '语言设置',
'Allow sign up': '允许注册',
'Sign out': '注销',
'Cancel': '取消',
'Submit': '提交',

View File

@ -11,6 +11,10 @@ export default {
type: 'boolean',
name: 'showLogoOnly',
},
{
type: 'boolean',
name: 'allowSignUp',
},
{
type: 'belongsTo',
name: 'logo',

View File

@ -49,6 +49,7 @@ export const signin = {
registerlink: {
type: 'void',
'x-component': 'Div',
'x-hidden': '{{allowSignUp !== true}}',
properties: {
link: {
type: 'void',