新增注册页用户协议

pull/495/MERGE
Karson 2025-05-20 15:24:09 +08:00
parent a6c8f6a89e
commit fea713785b
7 changed files with 35 additions and 1 deletions

View File

@ -277,6 +277,8 @@ return [
'user_api_captcha' => false,
//会员登录默认类型,支持mobile和account
'user_login_type' => 'account',
//用户注册协议
'user_register_agreement' => true,
//会员主页URL规则{uid}表示用户的ID
'user_home_url' => '/u/{uid}',
//是否启用会员字母头像

View File

@ -20,7 +20,7 @@ use think\Validate;
class User extends Frontend
{
protected $layout = 'default';
protected $noNeedLogin = ['login', 'mobilelogin', 'register', 'third'];
protected $noNeedLogin = ['login', 'mobilelogin', 'register', 'third', 'agreement'];
protected $noNeedRight = ['*'];
public function _initialize()
@ -387,4 +387,10 @@ class User extends Frontend
$this->view->assign("mimetypeList", \app\common\model\Attachment::getMimetypeList());
return $this->view->fetch();
}
public function agreement()
{
$this->view->assign('title', __('User agreement'));
return $this->view->fetch();
}
}

View File

@ -48,6 +48,9 @@ return [
'Account not exist' => '账户不存在',
'Account can not be empty' => '账户不能为空',
'Username or password is incorrect' => '用户名或密码不正确',
'User agreement' => '用户协议',
'Please read and agree to the agreement' => '请阅读并勾选同意用户协议',
'Have read and agree to the agreement' => '已阅读并同意以下用户协议',
'You are not logged in' => '你当前还未登录',
'You\'ve logged in, do not login again' => '你已经登录,请不要重复登录',
'This guy hasn\'t written anything yet' => '这个人很懒,啥也没写',

View File

@ -0,0 +1,7 @@
<div id="content-container" class="container">
<div class="user-section agreement-section">
<h2>用户协议</h2>
<div class="agreement-content">
<p>用户协议内容</p>
</div>
</div>

View File

@ -50,6 +50,14 @@
{/if}
<!--@CaptchaEnd-->
{if config('fastadmin.user_register_agreement')}
<div class="form-group">
<div class="controls checkbox">
<label for="agreement"><input type="checkbox" name="agreement" id="agreement" data-rule="checked" data-msg-checked="{:__('Please read and agree to the agreement')}"> {:__('Have read and agree to the agreement')}《<a href="{:url('user/agreement')}" target="_blank">{:__('User Agreement')}</a></label>
</div>
</div>
{/if}
<div class="form-group">
<button type="submit" class="btn btn-primary btn-lg btn-block">{:__('Sign up')}</button>
<a href="{:url('user/login')}?url={$url|urlencode|htmlentities}" class="btn btn-default btn-lg btn-block mt-3 no-border">{:__('Already have an account? Sign in')}</a>

View File

@ -865,6 +865,10 @@ footer.footer .copyright a:hover {
.form-section .n-bootstrap .n-right .msg-wrap {
position: relative;
}
.login-section .n-bootstrap .n-right[for="agreement"],
.form-section .n-bootstrap .n-right[for="agreement"] {
top: -12px;
}
main.content {
width: 100%;
overflow: auto;

View File

@ -688,6 +688,10 @@ footer.footer {
.msg-wrap {
position: relative;
}
&[for="agreement"] {
top: -12px;
}
}
}
}