Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
X
xgdlapp
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李苏
xgdlapp
Commits
5b183a3c
Commit
5b183a3c
authored
Feb 01, 2023
by
李苏
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改个人组件,修改密码+base64
parent
2700e536
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
203 additions
and
18 deletions
+203
-18
dlapi.js
api/dlapi.js
+8
-0
routes.js
common/router/modules/routes.js
+8
-0
pages.json
pages.json
+11
-0
modifyPw.vue
pages/user/modifyPw.vue
+97
-0
people.vue
pages/user/people.vue
+79
-18
No files found.
api/dlapi.js
View file @
5b183a3c
...
...
@@ -21,6 +21,14 @@ function filter(e) {
tip
.
toast
(
e
.
data
.
message
||
"操作失败"
)
}
}
/* userapi-查询用户信息 */
export
function
queryUser
(
params
)
{
return
http
.
post
(
'/kzzx/user/query'
,
filterSpace
(
params
)).
then
(
e
=>
{
return
filter
(
e
)
})
}
export
function
login
(
params
)
{
return
http
.
post
(
'/login'
,
filterSpace
(
params
)).
then
(
e
=>
{
return
filter
(
e
)
...
...
common/router/modules/routes.js
View file @
5b183a3c
...
...
@@ -36,6 +36,14 @@ const routes = [
title
:
'个人中心'
,
},
},
/* 修改密码 */
{
path
:
'/pages/user/modifyPw'
,
name
:
'modifyPw'
,
meta
:
{
title
:
'修改密码'
,
},
},
{
path
:
'/pages/user/userdetail'
,
name
:
'userdetail'
,
...
...
pages.json
View file @
5b183a3c
...
...
@@ -109,7 +109,18 @@
"enablePullDownRefresh"
:
false
}
},
/*
修改密码界面
*/
{
"path"
:
"pages/user/modifyPw"
,
"style"
:
{
"navigationBarTitleText"
:
""
,
"enablePullDownRefresh"
:
false
}
}
],
"globalStyle"
:
{
"navigationBarBackgroundColor"
:
"#0081ff"
,
...
...
pages/user/modifyPw.vue
0 → 100644
View file @
5b183a3c
<
template
>
<view
class=
"bg-white"
style=
"height: 100vh;"
>
<scroll-view
scroll-y
class=
"page"
>
<cu-custom
bgColor=
"bg-gradual-blue"
:isBack=
"true"
>
<block
slot=
"backText"
>
返回
</block>
<block
slot=
"content"
>
修改密码
</block>
</cu-custom>
<view
class=
"cu-list menu"
>
<view
class=
"cu-item animation-slide-bottom"
:style=
"[
{animationDelay: '0.3s'}]">
<view
class=
"content"
>
<text
class=
"text-grey"
>
旧密码:
</text>
</view>
<view
class=
"action"
>
<input
class=
"inputCenter"
v-model=
"oldPassword"
:focus=
"true"
type=
"password"
>
</view>
</view>
<view
class=
"cu-item animation-slide-bottom"
:style=
"[
{animationDelay: '0.3s'}]">
<view
class=
"content"
>
<text
class=
"text-grey"
>
新密码:
</text>
</view>
<view
class=
"action"
>
<input
class=
"inputCenter"
type=
"password"
v-model=
"newPassword"
>
</view>
</view>
<view
class=
"cu-item animation-slide-bottom"
:style=
"[
{animationDelay: '0.3s'}]" style="border-bottom: 1px solid #eee;">
<view
class=
"content"
>
<text
class=
"text-grey"
>
密码确认:
</text>
</view>
<view
class=
"action"
>
<input
class=
"inputCenter"
v-model=
"newPasswordConfirm"
type=
"password"
>
</view>
</view>
</view>
<view
class=
"flex justify-center"
>
<button
class=
"cu-btn bg-blue lg margin-left shadow"
style=
"margin-top: 30px;"
@
tap=
"confirm()"
>
修改密码
</button>
</view>
</scroll-view>
</view>
</
template
>
<
script
>
import
api
from
'@/api/api.js'
import
http
from
'@/common/service/service.js'
;
export
default
{
data
:
function
(){
return
{
api
:
'kzzx/user/password/update'
,
oldPassword
:
""
,
newPassword
:
""
,
newPasswordConfirm
:
""
,
}
},
methods
:{
passWord
(
password
)
{
return
/^
(?=
.*
\d)(?=
.*
[
a-zA-Z
])
.
{6,}
$/
.
test
(
password
);
},
confirm
(){
let
that
=
this
if
(
!
this
.
passWord
(
this
.
newPassword
)){
console
.
log
(
this
.
newPassword
)
this
.
$tip
.
toast
(
'密码格式需要6位以上,数字字母组合'
);
return
}
if
(
this
.
newPassword
!=
this
.
newPasswordConfirm
){
this
.
$tip
.
toast
(
'密码确认不一致'
);
return
}
if
(
!
this
.
oldPassword
){
this
.
$tip
.
toast
(
'请输入旧密码'
);
return
}
let
data
=
{
newPassword
:
new
Buffer
(
this
.
newPassword
).
toString
(
'base64'
),
oldPassword
:
new
Buffer
(
this
.
oldPassword
).
toString
(
'base64'
),
newPasswordConfirm
:
new
Buffer
(
this
.
newPasswordConfirm
).
toString
(
'base64'
)
}
that
.
$http
.
post
(
that
.
api
,
data
).
then
(
e
=>
{
if
(
e
.
data
.
success
){
this
.
$tip
.
toast
(
'修改成功'
);
uni
.
removeStorage
({
key
:
"ACCESS_TOKEN"
})
this
.
$Router
.
replaceAll
({
name
:
"login"
})
}
else
{
this
.
$tip
.
toast
(
e
.
data
.
message
||
"修改失败"
);
}
})
}
}
}
</
script
>
<
style
>
.inputCenter
{
text-align
:
center
;
}
</
style
>
\ No newline at end of file
pages/user/people.vue
View file @
5b183a3c
...
...
@@ -6,25 +6,60 @@
<image
src=
"../../static/home/u3.png"
mode=
""
style=
"height: 100%;width: 100%;"
></image>
</view>
<view
class=
"padding flex text-center text-grey bg-white shadow-warp"
>
<view
class=
"flex flex-sub flex-direction solid-right animation-slide-top"
:style=
"[
{animationDelay: '0.2s'}]">
<view
class=
"text-xl text-orange"
>
{{
personalList
.
username
}}
</view>
<view
class=
"margin-top-sm"
><text
class=
"cuIcon-people"
></text>
用户
</view>
</view>
<view
class=
"flex flex-sub flex-direction animation-slide-top"
:style=
"[
{animationDelay: '0.2s'}]">
<view
class=
"text-xl text-green"
>
{{
personalList
.
post
?
personalList
.
post
:
'员工'
}}
</view>
<view
class=
"margin-top-sm"
><text
class=
"cuIcon-news"
></text>
职务
</view>
</view>
</view>
<!-- 列表list-->
<view
class=
"cu-list menu card-menu margin-top-xl margin-bottom-xl shadow-lg radius"
>
<view
class=
"cu-item arrow animation-slide-bottom"
:style=
"[
{animationDelay: '0.7s'}]">
<navigator
class=
"content"
url=
"/pages/login/login"
hover-class=
"none"
@
tap=
"logout"
>
<text
class=
"cuIcon-exit text-cyan"
></text>
<text
class=
"text-grey"
>
退出
</text>
</navigator>
</view>
<!-- 个人信息-->
<view
class=
"cu-item animation-slide-bottom"
:style=
"[
{animationDelay: '0.2s'}]">
<view
class=
"content"
>
<text
class=
"text-grey"
>
姓名
</text>
</view>
<view
class=
"action"
>
<text
class=
"text-grey"
>
{{
userinfo
.
username
}}
</text>
</view>
</view>
<view
class=
"cu-item animation-slide-bottom"
:style=
"[
{animationDelay: '0.3s'}]">
<view
class=
"content"
>
<text
class=
"text-grey"
>
手机号
</text>
</view>
<view
class=
"action"
>
<text
class=
"text-grey"
>
{{
userinfo
.
phone
||
"未设置"
}}
</text>
</view>
</view>
<view
class=
"cu-item animation-slide-bottom"
:style=
"[
{animationDelay: '0.3s'}]">
<view
class=
"content"
>
<text
class=
"text-grey"
>
邮箱
</text>
</view>
<view
class=
"action"
>
<text
class=
"text-grey"
>
{{
userinfo
.
email
||
"未设置"
}}
</text>
</view>
</view>
<view
class=
"cu-item animation-slide-bottom"
:style=
"[
{animationDelay: '0.3s'}]">
<view
class=
"content"
>
<text
class=
"text-grey"
>
部门
</text>
</view>
<view
class=
"action"
>
<text
class=
"text-grey"
>
{{
userinfo
.
bmmc
||
"未设置"
}}
</text>
</view>
</view>
<view
class=
"cu-list menu"
>
<view
class=
"cu-item animation-slide-bottom"
:style=
"[
{animationDelay: '0.5s'}]">
<view
class=
"content"
>
<text
class=
"text-grey"
>
修改密码
</text>
</view>
<view
class=
"action"
>
<text
class=
"text-grey "
@
tap=
"modify()"
style=
"color: cornflowerblue;cursor: pointer;"
>
{{
'前往修改'
}}
</text>
</view>
</view>
<view
class=
"cu-item arrow animation-slide-bottom"
:style=
"[
{animationDelay: '0.7s'}]">
<navigator
class=
"content"
url=
"/pages/login/login"
hover-class=
"none"
@
tap=
"logout"
>
<text
class=
"cuIcon-exit text-cyan"
></text>
<text
class=
"text-grey"
>
退出
</text>
</navigator>
</view>
</view>
<!-- 分割-->
</view>
<view
class=
"cu-tabbar-height"
></view>
</scroll-view>
...
...
@@ -34,10 +69,32 @@
<
script
>
import
appUpdate
from
'common/util/appUpdate.js'
import
api
from
'@/api/api'
import
{
queryUser
}
from
'@/api/dlapi.js'
export
default
{
name
:
"people"
,
mounted
()
{
let
that
=
this
uni
.
getStorage
({
key
:
'login_user_info'
,
success
:
function
(
res
)
{
if
(
res
&&
res
.
data
&&
res
.
data
.
userkey
){
const
{
userkey
}
=
res
.
data
queryUser
({
id
:
userkey
}).
then
(
e
=>
{
that
.
userinfo
=
e
.
records
[
0
]
})
}
}
})
},
data
()
{
return
{
userinfo
:{
username
:
''
,
phone
:
''
,
email
:
''
,
bmmc
:
''
},
personalList
:{
avatar
:
''
,
realname
:
''
,
...
...
@@ -67,6 +124,10 @@
},
},
methods
:
{
/* 修改密码 */
modify
(){
this
.
$Router
.
push
({
name
:
"modifyPw"
})
},
remove
(){
uni
.
removeStorageSync
(
'Access-Token'
)
},
...
...
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