Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
self-support
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
李俊赕
self-support
Commits
c202011f
Commit
c202011f
authored
May 24, 2021
by
刘用法
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of
https://git.banshouhui.com/lijundan/self-support
into dev
parents
35484f29
8ca8e38f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
372 additions
and
331 deletions
+372
-331
index.vue
src/pages/login/index.vue
+372
-331
No files found.
src/pages/login/index.vue
View file @
c202011f
...
...
@@ -45,6 +45,7 @@ export default {
bindTitle
:
'立即绑定'
,
bindPhone
:
'绑定手机'
,
bindTips
:
'首次登录的用户需绑定手机才可接单'
,
code
:
''
}
},
computed
:
{
...
...
@@ -63,8 +64,14 @@ export default {
if
(
app
.
globalData
.
authUserInfo
)
{
this
.
needAuth
=
false
}
this
.
getCode
()
},
methods
:
{
async
getCode
()
{
login
.
appLogin
().
then
(
res
=>
{
this
.
code
=
res
.
code
})
},
// 微信授权用户信息
getUserProfile
()
{
var
that
=
this
...
...
@@ -144,10 +151,12 @@ export default {
encryptedData
:
e
.
detail
.
encryptedData
,
iv
:
e
.
detail
.
iv
,
}
login
.
appLogin
().
then
(
res
=>
{
params
.
code
=
res
.
code
return
login
.
signup
(
params
);
}).
then
(
res
=>
{
if
(
that
.
code
)
{
uni
.
checkSession
({
success
()
{
//session_key 未过期,并且在本生命周期一直有效
params
.
code
=
that
.
code
login
.
signup
(
params
).
then
(
res
=>
{
uni
.
hideLoading
()
if
(
res
)
{
app
.
setUserData
(
res
.
data
,
that
)
...
...
@@ -164,6 +173,15 @@ export default {
uni
.
hideLoading
()
this
.
setLoginStatus
(
false
)
})
},
fail
()
{
// session_key 已经失效,需要重新执行登录流程
that
.
toLogin
(
params
)
}
})
}
else
{
this
.
toLogin
(
params
)
}
}
else
{
uni
.
showModal
({
title
:
'提示'
,
...
...
@@ -179,7 +197,29 @@ export default {
});
}
},
toLogin
(
params
)
{
login
.
appLogin
().
then
(
res
=>
{
params
.
code
=
res
.
code
console
.
log
(
"params3"
,
params
)
return
login
.
signup
(
params
);
}).
then
(
res
=>
{
uni
.
hideLoading
()
if
(
res
)
{
app
.
setUserData
(
res
.
data
,
this
)
app
.
getBaseInfo
(
this
)
this
.
goBackPage
()
}
else
{
uni
.
showToast
({
title
:
'授权失败,请重新授权'
,
icon
:
'none'
});
this
.
setLoginStatus
(
false
)
}
}).
catch
(
res
=>
{
uni
.
hideLoading
()
this
.
setLoginStatus
(
false
)
})
},
goBackPage
()
{
let
pages
=
getCurrentPages
();
if
(
pages
.
length
)
{
...
...
@@ -206,6 +246,7 @@ export default {
},
setLoginStatus
(
authed
=
true
)
{
getApp
().
globalData
.
logout
=
false
this
.
code
=
''
if
(
authed
)
{
this
.
needAuth
=
false
uni
.
setNavigationBarTitle
({
...
...
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