Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
user
Overview
Overview
Details
Activity
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
hooloo
mp
user
Commits
4abfb26c
Commit
4abfb26c
authored
Sep 01, 2022
by
songbingqi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复部分bug
parent
372ab1e2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
9 deletions
+10
-9
request/user/index.js
+10
-9
No files found.
request/user/index.js
View file @
4abfb26c
...
@@ -109,7 +109,7 @@ export default {
...
@@ -109,7 +109,7 @@ export default {
})
})
},
},
loginDecrypt
(
res
){
loginDecrypt
(
res
){
const
{
faceInfoId
}
=
res
.
data
const
{
faceInfoId
}
=
res
return
uni
.
$u
.
http
.
post
(
'/weixin/decrypt '
,
{
return
uni
.
$u
.
http
.
post
(
'/weixin/decrypt '
,
{
session_key
:
res
.
loginInfo
.
session_key
,
session_key
:
res
.
loginInfo
.
session_key
,
openId
:
res
.
loginInfo
.
openid
,
openId
:
res
.
loginInfo
.
openid
,
...
@@ -121,25 +121,26 @@ export default {
...
@@ -121,25 +121,26 @@ export default {
},
},
// 手机号授权登录
// 手机号授权登录
getPhoneNumber
(
res
,
callback
)
{
getPhoneNumber
(
res
,
callback
)
{
console
.
log
(
res
)
uni
.
setStorage
({
key
:
'userPhoneInfo'
,
data
:
res
});
uni
.
setStorage
({
key
:
'userPhoneInfo'
,
data
:
res
});
Store
.
commit
(
'setUserPhoneInfo'
,
res
);
Store
.
commit
(
'setUserPhoneInfo'
,
res
);
uni
.
setStorage
({
key
:
'phoneInfo'
,
data
:
res
});
uni
.
setStorage
({
key
:
'phoneInfo'
,
data
:
res
});
const
loginInfo
=
res
.
loginInfo
const
loginInfo
=
res
.
loginInfo
const
iv
=
res
.
detail
.
iv
const
iv
=
res
.
detail
.
iv
const
data
=
res
.
detail
.
encryptedData
const
data
=
res
.
detail
.
encryptedData
if
(
res
.
faceInfoId
){
const
faceInfoId
=
res
.
faceInfoId
data
.
faceInfoId
=
res
.
faceInfoId
// data.faceInfoId = String(res.faceInfoId)
}
// if(res.faceInfoId){
// data.faceInfoId = res.faceInfoId
// }
wx
.
checkSession
({
wx
.
checkSession
({
success
:
(
res
)
=>
{
success
:
(
res
)
=>
{
console
.
log
(
'seeion未过期'
)
console
.
log
(
'seeion未过期'
)
this
.
onLogin
(
loginInfo
,
iv
,
data
,
callback
)
this
.
onLogin
(
loginInfo
,
iv
,
data
,
faceInfoId
,
callback
)
},
},
fail
:
(
res
)
=>
{
fail
:
(
res
)
=>
{
console
.
log
(
'seeion已过期'
)
console
.
log
(
'seeion已过期'
)
this
.
wxLoginAndGetOpenid
(
true
).
then
(
loginInfo
=>
{
this
.
wxLoginAndGetOpenid
(
true
).
then
(
loginInfo
=>
{
this
.
onLogin
(
loginInfo
,
iv
,
data
,
callback
)
this
.
onLogin
(
loginInfo
,
iv
,
data
,
faceInfoId
,
callback
)
})
})
}
}
})
})
...
@@ -205,8 +206,8 @@ export default {
...
@@ -205,8 +206,8 @@ export default {
context
.
showToast
({
title
:
'服务器错误'
,
icon
:
'none'
});
context
.
showToast
({
title
:
'服务器错误'
,
icon
:
'none'
});
});
});
},
},
onLogin
(
loginInfo
,
iv
,
data
,
callback
)
{
onLogin
(
loginInfo
,
iv
,
data
,
faceInfoId
,
callback
)
{
this
.
loginDecrypt
({
loginInfo
:
JSON
.
parse
(
loginInfo
),
iv
,
data
}).
then
(
res
=>
{
this
.
loginDecrypt
({
loginInfo
:
JSON
.
parse
(
loginInfo
),
faceInfoId
,
iv
,
data
}).
then
(
res
=>
{
const
{
statusCode
,
data
}
=
res
;
const
{
statusCode
,
data
}
=
res
;
const
{
code
,
token
,
phoneNumber
}
=
data
;
const
{
code
,
token
,
phoneNumber
}
=
data
;
if
(
statusCode
==
200
&&
data
&&
code
==
200
)
{
if
(
statusCode
==
200
&&
data
&&
code
==
200
)
{
...
...
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