Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
zuiketang
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
夏彬
zuiketang
Commits
99c1c834
Commit
99c1c834
authored
Oct 09, 2016
by
xiabin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
集成前端样式
parent
022a8ca0
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
35 additions
and
11 deletions
+35
-11
SiteController.php
src/frontend/controllers/SiteController.php
+3
-3
ResetPasswordForm.php
src/frontend/models/ResetPasswordForm.php
+14
-1
requestPasswordResetToken.php
src/frontend/views/site/requestPasswordResetToken.php
+0
-2
resetPassword.php
src/frontend/views/site/resetPassword.php
+17
-4
resetPasswordSuccess.php
src/frontend/views/site/resetPasswordSuccess.php
+1
-0
tokenInput.php
src/frontend/views/site/tokenInput.php
+0
-1
No files found.
src/frontend/controllers/SiteController.php
View file @
99c1c834
...
@@ -271,9 +271,9 @@ class SiteController extends Controller
...
@@ -271,9 +271,9 @@ class SiteController extends Controller
*/
*/
public
function
actionResetPassword
()
public
function
actionResetPassword
()
{
{
if
(
!
Yii
::
$app
->
session
->
has
(
self
::
RESET_PASSWORD_SECOND
))
{
//
if (!Yii::$app->session->has(self::RESET_PASSWORD_SECOND)) {
$this
->
redirect
(
'request-password-reset'
);
//
$this->redirect('request-password-reset');
}
//
}
$model
=
new
ResetPasswordForm
(
Yii
::
$app
->
session
->
get
(
self
::
PASSWORD_RESET_KEY
));
$model
=
new
ResetPasswordForm
(
Yii
::
$app
->
session
->
get
(
self
::
PASSWORD_RESET_KEY
));
if
(
$model
->
load
(
Yii
::
$app
->
request
->
post
())
&&
$model
->
validate
()
&&
$model
->
resetPassword
())
{
if
(
$model
->
load
(
Yii
::
$app
->
request
->
post
())
&&
$model
->
validate
()
&&
$model
->
resetPassword
())
{
Yii
::
$app
->
session
->
set
(
self
::
RESET_PASSWORD_THREE
,
TRUE
);
Yii
::
$app
->
session
->
set
(
self
::
RESET_PASSWORD_THREE
,
TRUE
);
...
...
src/frontend/models/ResetPasswordForm.php
View file @
99c1c834
...
@@ -19,7 +19,6 @@ class ResetPasswordForm extends Model
...
@@ -19,7 +19,6 @@ class ResetPasswordForm extends Model
private
$_user
;
private
$_user
;
/**
/**
* @inheritdoc
* @inheritdoc
*/
*/
...
@@ -50,6 +49,20 @@ class ResetPasswordForm extends Model
...
@@ -50,6 +49,20 @@ class ResetPasswordForm extends Model
];
];
}
}
/**
* @inheritdoc
*/
public
function
attributeLabels
()
{
return
[
'rePassword'
=>
'密码'
,
'password'
=>
'密码'
];
}
/**
/**
* Resets password.
* Resets password.
*
*
...
...
src/frontend/views/site/requestPasswordResetToken.php
View file @
99c1c834
...
@@ -4,11 +4,9 @@
...
@@ -4,11 +4,9 @@
/* @var $form yii\bootstrap\ActiveForm */
/* @var $form yii\bootstrap\ActiveForm */
/* @var $model \frontend\models\PasswordResetRequestForm */
/* @var $model \frontend\models\PasswordResetRequestForm */
use
yii\helpers\Html
;
use
yii\bootstrap\ActiveForm
;
use
yii\bootstrap\ActiveForm
;
$this
->
title
=
'找回密码'
;
$this
->
title
=
'找回密码'
;
$this
->
params
[
'breadcrumbs'
][]
=
$this
->
title
;
\frontend\assets\AppAsset
::
addScript
(
$this
,
'@web/assets/request_password_reset.js'
);
\frontend\assets\AppAsset
::
addScript
(
$this
,
'@web/assets/request_password_reset.js'
);
$this
->
registerJsFile
(
'http://static.geetest.com/static/tools/gt.js'
);
$this
->
registerJsFile
(
'http://static.geetest.com/static/tools/gt.js'
);
...
...
src/frontend/views/site/resetPassword.php
View file @
99c1c834
...
@@ -8,7 +8,18 @@ use yii\helpers\Html;
...
@@ -8,7 +8,18 @@ use yii\helpers\Html;
use
yii\bootstrap\ActiveForm
;
use
yii\bootstrap\ActiveForm
;
$this
->
title
=
'Reset password'
;
$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"
>
<div
class=
"z-m-center"
>
<h3>
找回密码
</h3>
<h3>
找回密码
</h3>
...
@@ -30,15 +41,17 @@ $this->params['breadcrumbs'][] = $this->title;
...
@@ -30,15 +41,17 @@ $this->params['breadcrumbs'][] = $this->title;
<div
class=
"reg-box"
>
<div
class=
"reg-box"
>
<div
class=
"password input-wrapper"
>
<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>
<div
class=
"check-password input-wrapper last-wrapper"
>
<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>
</div>
<div
class=
"foot-reg-btn"
>
<div
class=
"foot-reg-btn"
>
<button
class=
"btn btn-log"
type=
"submit"
>
确认
</button>
<button
id=
"submit"
class=
"btn btn-log"
type=
"submit"
>
确认
</button>
</div>
</div>
<?php
ActiveForm
::
end
()
?>
<?php
ActiveForm
::
end
()
?>
</div>
</div>
...
...
src/frontend/views/site/resetPasswordSuccess.php
View file @
99c1c834
...
@@ -10,6 +10,7 @@ use yii\helpers\Html;
...
@@ -10,6 +10,7 @@ use yii\helpers\Html;
$this
->
title
=
'密码设置成功'
;
$this
->
title
=
'密码设置成功'
;
?>
?>
<div
class=
"z-m-center"
>
<div
class=
"z-m-center"
>
<h3>
找回密码
</h3>
<h3>
找回密码
</h3>
...
...
src/frontend/views/site/tokenInput.php
View file @
99c1c834
...
@@ -11,7 +11,6 @@ use yii\helpers\Html;
...
@@ -11,7 +11,6 @@ use yii\helpers\Html;
use
yii\bootstrap\ActiveForm
;
use
yii\bootstrap\ActiveForm
;
$this
->
title
=
'输入验证码'
;
$this
->
title
=
'输入验证码'
;
$this
->
params
[
'breadcrumbs'
][]
=
$this
->
title
;
\frontend\assets\AppAsset
::
addScript
(
$this
,
'@web/assets/token_input.js'
);
\frontend\assets\AppAsset
::
addScript
(
$this
,
'@web/assets/token_input.js'
);
$this
->
registerJsFile
(
'http://static.geetest.com/static/tools/gt.js'
);
$this
->
registerJsFile
(
'http://static.geetest.com/static/tools/gt.js'
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment