Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
biz-trina5-app
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
贺双
biz-trina5-app
Commits
de139d4c
Commit
de139d4c
authored
May 26, 2025
by
贺世双
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
获取用户
parent
4848750c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
50 deletions
+52
-50
apiList.js
api/apiList.js
+3
-4
login.vue
pages/login/login.vue
+44
-42
user.vue
pages/user/user.vue
+5
-4
No files found.
api/apiList.js
View file @
de139d4c
...
...
@@ -5,9 +5,8 @@ import downloadFile from "./downloadFile";
// 登录接口
// mimi: 项目名:biz-carrier-wxapp LOGIN_ACTION: loginByUserInfo; miniAppDriverLogin/miniAppServLogin
export
function
userLogin
(
loginAction
,
loginCode
,
data
)
{
return
Request
(
`/api/auth/app-login/{mini}/miniAppDriverLogin?weixin_config_key={mini}&code=
${
loginCode
}
`
,
data
);
return
Request
(
`/api/auth/app-login/{mini}/miniAppDriverLogin?weixin_config_key={mini}&code=
${
loginCode
}
`
,
data
);
}
export
function
userCarrierLogin
(
loginAction
,
loginCode
,
data
)
{
...
...
@@ -28,7 +27,7 @@ export function userMobileOperation(action, data) {
//退出登录
return
Request
(
`/logout`
,
data
,
"GET"
);
// data: {openId, entryName}
}
else
{
return
Request
(
`/api/entry/{mini}/m-action/
${
action
}
`
,
data
);
return
Request
(
`/api/entry/{mini}/m-action/
getUserInfo`
,
data
);
}
}
//获取地图key
...
...
pages/login/login.vue
View file @
de139d4c
...
...
@@ -200,27 +200,30 @@
title
:
'登录成功!'
,
duration
:
1000
})
/*setTimeout(() => {
uni.switchTab({
url: "/pages/order/order",
})
}, 1500)*/
getApp
().
globalData
.
tabList
=
[{
"pagePath"
:
"pages/carrierMenu/carrierMenu"
,
"text"
:
"承运商"
,
"iconPath"
:
"../../static/img/tabbar/shipment.png"
,
"selectedIconPath"
:
"../../static/img/tabbar/shipment-active.png"
},
{
"pagePath"
:
"pages/user/user"
,
"text"
:
"我的"
,
"iconPath"
:
"../../static/img/tabbar/user.png"
,
"selectedIconPath"
:
"../../static/img/tabbar/user-active.png"
//获取用户信息
userMobileOperation
(
'getUserInfo'
).
then
(
res
=>
{
var
user
=
res
.
data
.
data
if
(
user
.
user_gid
!=
"DEFAULT.CARRIER_ADMIN"
){
getApp
().
globalData
.
tabList
=
[{
"pagePath"
:
"pages/carrierMenu/carrierMenu"
,
"text"
:
"承运商"
,
"iconPath"
:
"../../static/img/tabbar/shipment.png"
,
"selectedIconPath"
:
"../../static/img/tabbar/shipment-active.png"
},
{
"pagePath"
:
"pages/user/user"
,
"text"
:
"我的"
,
"iconPath"
:
"../../static/img/tabbar/user.png"
,
"selectedIconPath"
:
"../../static/img/tabbar/user-active.png"
}
]
uni
.
switchTab
({
url
:
"/pages/carrierMenu/carrierMenu"
,
})
}
]
uni
.
switchTab
({
url
:
"/pages/carrierMenu/carrierMenu"
,
})
}
}).
catch
(
err
=>
{
uni
.
showToast
({
...
...
@@ -231,9 +234,6 @@
})
}
else
{
userLogin
(
loginAction
,
res
.
code
,
reqData
).
then
(
res
=>
{
console
.
log
(
'222======='
)
console
.
log
(
res
)
let
token
=
res
.
data
.
renewedToken
if
(
res
.
header
[
'Set-Cookie'
])
{
const
XSRFToken
=
res
.
header
[
'Set-Cookie'
].
split
(
';'
)[
0
].
split
(
'='
)[
1
]
...
...
@@ -250,27 +250,29 @@
title
:
'登录成功!'
,
duration
:
1000
})
/*setTimeout(() => {
uni.switchTab({
url: "/pages/order/order",
})
}, 1500)*/
getApp
().
globalData
.
tabList
=
[{
"pagePath"
:
"pages/dirverMenu/dirverMenu"
,
"text"
:
"司机"
,
"iconPath"
:
"../../static/img/tabbar/receivebill.png"
,
"selectedIconPath"
:
"../../static/img/tabbar/receivebill-active.png"
},
{
"pagePath"
:
"pages/user/user"
,
"text"
:
"我的"
,
"iconPath"
:
"../../static/img/tabbar/user.png"
,
"selectedIconPath"
:
"../../static/img/tabbar/user-active.png"
}
]
uni
.
switchTab
({
url
:
"/pages/dirverMenu/dirverMenu"
,
//获取用户信息
userMobileOperation
(
'getUserInfo'
).
then
(
res
=>
{
var
user
=
res
.
data
.
data
if
(
user
.
user_gid
==
"DEFAULT.CARRIER_ADMIN"
){
getApp
().
globalData
.
tabList
=
[{
"pagePath"
:
"pages/dirverMenu/dirverMenu"
,
"text"
:
"司机"
,
"iconPath"
:
"../../static/img/tabbar/receivebill.png"
,
"selectedIconPath"
:
"../../static/img/tabbar/receivebill-active.png"
},
{
"pagePath"
:
"pages/user/user"
,
"text"
:
"我的"
,
"iconPath"
:
"../../static/img/tabbar/user.png"
,
"selectedIconPath"
:
"../../static/img/tabbar/user-active.png"
}
]
uni
.
switchTab
({
url
:
"/pages/dirverMenu/dirverMenu"
,
})
}
})
}
}).
catch
(
err
=>
{
uni
.
showToast
({
...
...
pages/user/user.vue
View file @
de139d4c
...
...
@@ -7,7 +7,7 @@
<image
src=
"../../static/img/empty/userPhoto.png"
></image>
</view>
<view
class=
"flex_col flex_cen"
style=
"margin-left: 30rpx;"
>
<text
class=
"user-name"
user-select
>
{{
userInfo
.
name
}}
</text>
<text
class=
"user-name"
user-select
>
{{
userInfo
.
common_
name
}}
</text>
<text
class=
"user-phone"
user-select
>
{{
userInfo
.
mobile
}}
</text>
</view>
</view>
...
...
@@ -26,7 +26,7 @@
</u-cell>
-->
<u-line
color=
"#F0F0F0"
/>
<u-cell
title-style=
"font-weight: bolder"
rightIconStyle=
"font-size: 40rpx"
isLink
:border=
"false"
title=
"修改密码"
:url=
"'/subpkg/editPwd/editPwd?userName=' + userInfo.
name
"
>
title=
"修改密码"
:url=
"'/subpkg/editPwd/editPwd?userName=' + userInfo.
user_gid
"
>
<view
slot=
"icon"
class=
"t-icon t-icon-lock"
/>
</u-cell>
</u-cell-group>
...
...
@@ -47,7 +47,7 @@
}
},
onLoad
:
function
(
options
)
{
//
this.getUserInfo()
this
.
getUserInfo
()
},
methods
:
{
//获取Tab菜单索引
...
...
@@ -57,8 +57,9 @@
//获取用户信息
getUserInfo
()
{
userMobileOperation
(
'getUserInfo'
).
then
(
res
=>
{
console
.
log
(
res
)
let
data
=
res
.
data
.
data
data
.
mobile
=
data
.
userExt
.
mobile
||
'暂无'
data
.
mobile
=
data
.
mobile
||
'暂无'
this
.
userInfo
=
{
...
data
}
})
},
...
...
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