diff --git a/application/config.php b/application/config.php index 90bdc3dc..a2be26e0 100755 --- a/application/config.php +++ b/application/config.php @@ -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}', //是否启用会员字母头像 diff --git a/application/index/controller/User.php b/application/index/controller/User.php index 45043e95..dc7e6d1d 100644 --- a/application/index/controller/User.php +++ b/application/index/controller/User.php @@ -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(); + } } diff --git a/application/index/lang/zh-cn/user.php b/application/index/lang/zh-cn/user.php index 41ef37bd..8c9763b5 100755 --- a/application/index/lang/zh-cn/user.php +++ b/application/index/lang/zh-cn/user.php @@ -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' => '这个人很懒,啥也没写', diff --git a/application/index/view/user/agreement.html b/application/index/view/user/agreement.html new file mode 100644 index 00000000..0f944ea2 --- /dev/null +++ b/application/index/view/user/agreement.html @@ -0,0 +1,7 @@ +
用户协议内容
+