Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
business-assistant
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit bd08a3f9
authored
Oct 19, 2022
by
李伟康
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
增加获取微信用户信息方法
1 parent
53dc6d7f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
api/usersApi/UsersApi.js
api/usersApi/UsersApi.js
View file @
bd08a3f
...
@@ -138,6 +138,15 @@ class UsersApi {
...
@@ -138,6 +138,15 @@ class UsersApi {
* 只传loginToken就返回unionId和openid
* 只传loginToken就返回unionId和openid
* 传加密信息就解析手机号
* 传加密信息就解析手机号
*/
*/
/**获取微信用户信息 */
async
getWXUserInfo
()
{
let
wx_user_info
=
wx
.
$storage
.
get
(
'wx_user_info'
)
if
(
!
wx_user_info
)
{
const
data
=
await
this
.
getUserProfile
()
wx
.
$storage
.
set
(
'wx_user_info'
,
data
)
return
data
}
else
return
wx_user_info
}
async
getUserProfile
(
loginToken
,
detail
=
{})
{
async
getUserProfile
(
loginToken
,
detail
=
{})
{
if
(
detail
.
errMsg
&&
detail
.
errMsg
==
'getPhoneNumber:fail user deny'
)
Promise
.
reject
()
if
(
detail
.
errMsg
&&
detail
.
errMsg
==
'getPhoneNumber:fail user deny'
)
Promise
.
reject
()
delete
detail
.
errMsg
delete
detail
.
errMsg
...
@@ -150,8 +159,7 @@ class UsersApi {
...
@@ -150,8 +159,7 @@ class UsersApi {
method
:
'scrm.api.sso.wechat.applets.phone.grant.analysis'
,
method
:
'scrm.api.sso.wechat.applets.phone.grant.analysis'
,
...
detail
,
...
detail
,
platformEntrance
:
'BUSINESS_ASSISTANT'
platformEntrance
:
'BUSINESS_ASSISTANT'
}
})
)
}
}
}
}
export
default
UsersApi
export
default
UsersApi
\ No newline at end of file
\ No newline at end of file
Write
Preview
Markdown
is supported
Attach a file
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 post a comment