Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
Starter Web Vue
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
product
kim3-web-vue
Starter Web Vue
Commits
cdfbe141
Commit
cdfbe141
authored
Jul 19, 2021
by
shuiluo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 修改密码页面国际化完成
parent
5eb2a303
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
8 deletions
+16
-8
src/local/user.js
src/local/user.js
+6
-0
src/pages/user/components/modify_password.vue
src/pages/user/components/modify_password.vue
+10
-8
No files found.
src/local/user.js
View file @
cdfbe141
...
@@ -18,4 +18,10 @@ export default {
...
@@ -18,4 +18,10 @@ export default {
'
table.read
'
:
[
'
已读
'
,
'
Read
'
],
'
table.read
'
:
[
'
已读
'
,
'
Read
'
],
'
table.unread
'
:
[
'
未读
'
,
'
Unread
'
],
'
table.unread
'
:
[
'
未读
'
,
'
Unread
'
],
'
user.readTime
'
:
[
'
已读时间
'
,
'
Read Time
'
],
'
user.readTime
'
:
[
'
已读时间
'
,
'
Read Time
'
],
'
user.initialPassword
'
:
[
'
初始密码
'
,
'
Initial Password
'
],
'
user.password
'
:
[
'
新密码
'
,
'
Password
'
],
'
user.confirmPassword
'
:
[
'
确认密码
'
,
'
Confirm password
'
],
'
user.twoInconsistent
'
:
[
'
两次密码不一致
'
,
'
The two passwords are inconsistent
'
],
'
user.modifiedSuccessfully
'
:
[
'
修改成功
'
,
'
Modified successfully
'
],
'
user.serverException
'
:
[
'
服务器异常
'
,
'
Server exception
'
],
};
};
src/pages/user/components/modify_password.vue
View file @
cdfbe141
<
template
>
<
template
>
<a-form-model
layout=
"vertical"
style=
"width: 500px"
:model=
"form"
:rules=
"rules"
ref=
"form"
>
<a-form-model
layout=
"vertical"
style=
"width: 500px"
:model=
"form"
:rules=
"rules"
ref=
"form"
>
<a-form-model-item
label=
"原始密码
"
prop=
"oldPassword"
>
<a-form-model-item
:label=
"$t('user.initialPassword')
"
prop=
"oldPassword"
>
<a-input-password
v-model=
"form.oldPassword"
/>
<a-input-password
v-model=
"form.oldPassword"
/>
</a-form-model-item>
</a-form-model-item>
<a-form-model-item
label=
"新密码
"
prop=
"newPassword"
>
<a-form-model-item
:label=
"$t('user.password')
"
prop=
"newPassword"
>
<a-input-password
v-model=
"form.newPassword"
/>
<a-input-password
v-model=
"form.newPassword"
/>
</a-form-model-item>
</a-form-model-item>
<a-form-model-item
label=
"确认新密码
"
prop=
"confirmPassword"
>
<a-form-model-item
:label=
"$t('user.confirmPassword')
"
prop=
"confirmPassword"
>
<a-input-password
v-model=
"form.confirmPassword"
/>
<a-input-password
v-model=
"form.confirmPassword"
/>
</a-form-model-item>
</a-form-model-item>
<a-form-model-item>
<a-form-model-item>
<a-button
type=
"primary"
@
click=
"modifyPassword"
:loading=
"loading"
>
修改密码
</a-button>
<a-button
type=
"primary"
@
click=
"modifyPassword"
:loading=
"loading"
>
{{
$t
(
'
user.modifyPassword
'
)
}}
</a-button>
</a-form-model-item>
</a-form-model-item>
</a-form-model>
</a-form-model>
</
template
>
</
template
>
...
@@ -21,7 +23,7 @@ import { EMPTY_FUN } from '@/utils';
...
@@ -21,7 +23,7 @@ import { EMPTY_FUN } from '@/utils';
import
md5
from
'
crypto-js/md5
'
;
import
md5
from
'
crypto-js/md5
'
;
export
default
{
export
default
{
data
:
vm
=>
({
data
:
(
vm
)
=>
({
form
:
{
form
:
{
newPassword
:
''
,
newPassword
:
''
,
oldPassword
:
''
,
oldPassword
:
''
,
...
@@ -34,7 +36,7 @@ export default {
...
@@ -34,7 +36,7 @@ export default {
{
required
:
true
},
{
required
:
true
},
{
{
validator
(
rule
,
value
,
callback
)
{
validator
(
rule
,
value
,
callback
)
{
if
(
value
!==
vm
.
form
.
newPassword
)
callback
(
'
两次密码不一致
'
);
if
(
value
!==
vm
.
form
.
newPassword
)
callback
(
this
.
$t
(
'
user.twoInconsistent
'
)
);
callback
();
callback
();
},
},
},
},
...
@@ -53,10 +55,10 @@ export default {
...
@@ -53,10 +55,10 @@ export default {
newPassword
:
md5
(
this
.
form
.
newPassword
).
toString
(),
newPassword
:
md5
(
this
.
form
.
newPassword
).
toString
(),
oldPassword
:
md5
(
this
.
form
.
oldPassword
).
toString
(),
oldPassword
:
md5
(
this
.
form
.
oldPassword
).
toString
(),
});
});
this
.
$message
.
success
(
'
修改成功
'
);
this
.
$message
.
success
(
this
.
$t
(
'
user.modifiedSuccessfully
'
)
);
}
catch
(
error
)
{
}
catch
(
error
)
{
// todo
// todo
this
.
$message
.
error
(
'
服务器异常
'
);
this
.
$message
.
error
(
this
.
$t
(
'
user.serverException
'
)
);
}
}
this
.
loading
=
false
;
this
.
loading
=
false
;
})
})
...
...
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