Commit 99c1c834 authored by xiabin's avatar xiabin

集成前端样式

parent 022a8ca0
......@@ -271,9 +271,9 @@ class SiteController extends Controller
*/
public function actionResetPassword()
{
if (!Yii::$app->session->has(self::RESET_PASSWORD_SECOND)) {
$this->redirect('request-password-reset');
}
// if (!Yii::$app->session->has(self::RESET_PASSWORD_SECOND)) {
// $this->redirect('request-password-reset');
// }
$model = new ResetPasswordForm(Yii::$app->session->get(self::PASSWORD_RESET_KEY));
if ($model->load(Yii::$app->request->post()) && $model->validate() && $model->resetPassword()) {
Yii::$app->session->set(self::RESET_PASSWORD_THREE, TRUE);
......
......@@ -19,7 +19,6 @@ class ResetPasswordForm extends Model
private $_user;
/**
* @inheritdoc
*/
......@@ -50,6 +49,20 @@ class ResetPasswordForm extends Model
];
}
/**
* @inheritdoc
*/
public function attributeLabels()
{
return [
'rePassword' => '密码',
'password' => '密码'
];
}
/**
* Resets password.
*
......
......@@ -4,11 +4,9 @@
/* @var $form yii\bootstrap\ActiveForm */
/* @var $model \frontend\models\PasswordResetRequestForm */
use yii\helpers\Html;
use yii\bootstrap\ActiveForm;
$this->title = '找回密码';
$this->params['breadcrumbs'][] = $this->title;
\frontend\assets\AppAsset::addScript($this, '@web/assets/request_password_reset.js');
$this->registerJsFile('http://static.geetest.com/static/tools/gt.js');
......
......@@ -8,7 +8,18 @@ use yii\helpers\Html;
use yii\bootstrap\ActiveForm;
$this->title = 'Reset password';
$this->params['breadcrumbs'][] = $this->title;
$jsString = <<<JS
$("#submit").click(function() {
if($("#password").val() !== $("#repassword").val()){
$("#repassword_tips").html('两次密码不一致');
return false;
}
});
JS;
$this->registerJs($jsString);
?>
<div class="z-m-center">
<h3>找回密码</h3>
......@@ -30,15 +41,17 @@ $this->params['breadcrumbs'][] = $this->title;
<div class="reg-box">
<div class="password input-wrapper">
<input name="password" type="password" class="" placeholder="设置新密码" required="">
<input value="<?= $model->password ?>" id="password" name="password" type="password" class=""
placeholder="设置新密码" required="">
</div>
<div class="check-password input-wrapper last-wrapper">
<input name="rePassword" type="password" class="" placeholder="重复输入密码" required="">
<input value="<?= $model->rePassword ?>" id id="repassword" name="rePassword" type="password" class="" placeholder="重复输入密码" required="">
<span id="repassword_tips" class="tips"><?= $model->getFirstError('rePassword') ?></span>
</div>
</div>
<div class="foot-reg-btn">
<button class="btn btn-log" type="submit">确认</button>
<button id="submit" class="btn btn-log" type="submit">确认</button>
</div>
<?php ActiveForm::end() ?>
</div>
......
......@@ -10,6 +10,7 @@ use yii\helpers\Html;
$this->title = '密码设置成功';
?>
<div class="z-m-center">
<h3>找回密码</h3>
......
......@@ -11,7 +11,6 @@ use yii\helpers\Html;
use yii\bootstrap\ActiveForm;
$this->title = '输入验证码';
$this->params['breadcrumbs'][] = $this->title;
\frontend\assets\AppAsset::addScript($this, '@web/assets/token_input.js');
$this->registerJsFile('http://static.geetest.com/static/tools/gt.js');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment