Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
store-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 4d363e76
authored
Oct 27, 2022
by
前端
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'zq_dev_3.0' into 'v3.0'
手机号解密失败 See merge request
!89
2 parents
0e547e1c
a8ba5dbf
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
19 deletions
api/usersApi/UsersApi.js
pages/authentication/login/login.js
pages/authentication/register/register.js
pages/authentication/registerInfo/registerInfo.js
api/usersApi/UsersApi.js
View file @
4d363e7
...
...
@@ -45,13 +45,11 @@ class UsersApi {
}
/**授权手机号登录 */
async
authUserPhone
(
detail
,
loginToken
)
{
console
.
log
(
221
)
if
(
!
loginToken
)
{
wx
.
$api
.
showToast
(
'缺少loginToken'
)
Promise
.
reject
()
return
}
console
.
log
(
111
)
if
(
detail
.
errMsg
&&
detail
.
errMsg
==
'getPhoneNumber:fail user deny'
)
Promise
.
reject
()
delete
detail
.
errMsg
if
(
detail
.
iv
&&
detail
.
encryptedData
)
{
...
...
pages/authentication/login/login.js
View file @
4d363e7
...
...
@@ -42,7 +42,7 @@ Page({
this
.
init
()
},
async
init
()
{
async
init
(
tip
)
{
try
{
const
{
data
,
...
...
@@ -51,12 +51,15 @@ Page({
}
=
await
USERAPI
.
wxCodeLogin
()
if
(
code
==
'0'
)
{
this
.
loginToken
=
data
if
(
tip
){
wx
.
$api
.
showToast
(
`
${
tip
==
1
?
'登录'
:
'注册'
}
信息已失效,请重试`
)
}
}
else
this
.
reLogin
(
message
)
wx
.
hideLoading
()
}
catch
({
errMsg
})
{
console
.
error
(
errMsg
)
console
.
log
(
errMsg
)
this
.
reLogin
(
errMsg
)
}
},
...
...
@@ -101,15 +104,15 @@ Page({
mobile
:
formData
.
phone
,
code
:
formData
.
code
}
wx
.
showLoading
()
if
(
this
.
data
.
showLoading
||
this
.
data
.
disabled
)
return
;
this
.
setShowLoading
(
true
)
USERAPI
.
phoneSmsLogin
(
obj
).
then
(({
code
,
data
,
message
,
errId
})
=>
{
this
.
setShowLoading
(
false
)
wx
.
hideLoading
(
)
if
(
code
==
'0'
)
{
this
.
checkLoginUserInfo
(
data
)
}
else
if
(
errId
==
'30990103'
)
{
...
...
@@ -120,7 +123,7 @@ Page({
wx
.
$api
.
showToast
(
message
||
'系统异常'
)
}
}).
catch
(
err
=>
{
this
.
setShowLoading
(
false
)
wx
.
hideLoading
(
)
wx
.
$api
.
showToast
(
'系统异常'
)
})
},
...
...
@@ -132,7 +135,7 @@ Page({
/**多个账号 */
console
.
log
(
loginUserInfoList
,
'loginUserInfoList'
)
if
(
loginUserInfoList
.
length
>
1
)
wx
.
$router
.
go
(
'/pages/authentication/accountItems/accountItems'
,
{
if
(
loginUserInfoList
.
length
>
1
)
wx
.
$router
.
reLaunch
(
'/pages/authentication/accountItems/accountItems'
,
{
sessionId
,
...
this
.
options
})
...
...
@@ -184,8 +187,12 @@ Page({
// this.setData({
// smsLoading: false
// })
if
(
code
==
'0'
)
this
.
countDown
(
countDown
)
else
wx
.
$api
.
showToast
(
message
||
'发送验证码失败'
)
if
(
code
==
'0'
)
{
wx
.
$api
.
showToast
(
'验证码已发送'
)
this
.
countDown
(
countDown
)
}
else
{
wx
.
$api
.
showToast
(
message
||
'发送验证码失败'
)
}
}).
catch
(
err
=>
{
// this.setData({
// smsLoading: false
...
...
@@ -220,27 +227,30 @@ Page({
detail
})
{
if
(
!
detail
.
code
||
this
.
data
.
showLoading
)
return
this
.
setShowLoading
(
true
)
// this.setShowLoading(true)
wx
.
showLoading
()
USERAPI
.
authUserPhone
(
detail
,
this
.
loginToken
).
then
(({
code
,
data
,
message
,
errId
})
=>
{
this
.
setShowLoading
(
false
)
wx
.
hideLoading
(
)
if
(
code
==
'0'
){
this
.
checkLoginUserInfo
(
data
)
}
else
if
(
errId
==
'30990103'
){
this
.
setData
({
authorized
:
true
})
}
else
if
(
errId
==
'200122'
){
this
.
init
(
1
)
}
else
{
wx
.
$api
.
showToast
(
message
||
'系统异常'
)
}
}).
catch
(({
errMsg
})
=>
{
this
.
setShowLoading
(
false
)
wx
.
hideLoading
(
)
wx
.
$api
.
showToast
(
'系统异常'
)
})
},
...
...
pages/authentication/register/register.js
View file @
4d363e7
...
...
@@ -22,7 +22,7 @@ Page({
headerHeight
:
height
,
});
},
async
init
()
{
async
init
(
tip
)
{
try
{
const
{
data
,
...
...
@@ -30,10 +30,10 @@ Page({
message
}
=
await
USERAPI
.
wxCodeLogin
()
if
(
code
==
'0'
)
{
this
.
setData
({
disabled
:
false
})
this
.
loginToken
=
data
if
(
tip
){
wx
.
$api
.
showToast
(
`
${
tip
==
1
?
'登录'
:
'注册'
}
信息已失效,请重试`
)
}
}
else
this
.
reLogin
(
message
)
wx
.
hideLoading
()
}
catch
({
...
...
@@ -83,9 +83,12 @@ Page({
},
register
(
params
,
detail
){
USERAPI
.
register
(
params
).
then
((
res
)
=>
{
console
.
log
(
res
,
'errId'
)
if
(
res
.
code
==
'0'
){
this
.
toLogin
(
detail
)
}
else
{
}
else
if
(
res
.
errId
==
'200122'
){
this
.
init
(
2
)
}
else
{
wx
.
$api
.
showToast
(
res
.
message
||
'系统异常'
)
}
})
...
...
@@ -99,6 +102,8 @@ Page({
})
=>
{
if
(
code
==
'0'
){
this
.
checkLoginUserInfo
(
data
)
}
else
if
(
errId
==
'200122'
){
this
.
init
(
1
)
}
else
{
wx
.
$api
.
showToast
(
message
||
'系统异常'
)
}
...
...
pages/authentication/registerInfo/registerInfo.js
View file @
4d363e7
...
...
@@ -42,7 +42,7 @@ Page({
onLoad
(
options
)
{
this
.
init
()
},
async
init
()
{
async
init
(
tip
)
{
try
{
const
{
data
,
...
...
@@ -51,6 +51,9 @@ Page({
}
=
await
USERAPI
.
wxCodeLogin
()
if
(
code
==
'0'
)
{
this
.
loginToken
=
data
if
(
tip
){
wx
.
$api
.
showToast
(
`
${
tip
==
1
?
'登录'
:
'注册'
}
信息已失效,请重试`
)
}
}
else
this
.
reLogin
(
message
)
wx
.
hideLoading
()
}
catch
({
...
...
@@ -111,6 +114,8 @@ Page({
USERAPI
.
register
(
params
).
then
((
res
)
=>
{
if
(
res
.
code
==
'0'
){
this
.
toLogin
()
}
else
if
(
res
.
errId
==
'200122'
){
this
.
init
(
2
)
}
else
{
wx
.
$api
.
showToast
(
res
.
message
||
'系统异常'
)
}
...
...
@@ -126,6 +131,8 @@ Page({
})
=>
{
if
(
code
==
'0'
){
this
.
checkLoginUserInfo
(
data
)
}
else
if
(
errId
==
'200122'
){
this
.
init
(
1
)
}
else
{
wx
.
$api
.
showToast
(
message
||
'系统异常'
)
}
...
...
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