Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
J
jd-vx-app
Project
Project
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
Administrator
jd-vx-app
Commits
0820f3c8
Commit
0820f3c8
authored
Apr 20, 2022
by
肖健
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
小程序登录调整
parent
7c363b63
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
+24
-0
index.vue
pages/binding/index.vue
+24
-0
No files found.
pages/binding/index.vue
View file @
0820f3c8
...
...
@@ -53,6 +53,28 @@ export default {
title
:
'登录中...'
})
},
async
wechatLogin
()
{
wx
.
login
({
success
:
(
res
)
=>
{
this
.
code
=
res
.
code
this
.
wechatSession
(
res
.
code
)
}
})
},
//获取session_key
async
wechatSession
(
code
)
{
let
that
=
this
let
param
=
{
code
:
code
,
}
let
opts
=
{
url
:
'/xcx/code/session'
,
method
:
'post'
}
await
that
.
http
.
httpRequest
(
opts
,
param
).
then
(
res
=>
{
if
(
res
.
data
.
code
==
200
)
{
that
.
openid
=
res
.
data
.
data
.
openid
}
})
},
//解析手机号
getPhoneNumber
(
e
)
{
let
that
=
this
...
...
@@ -70,6 +92,7 @@ export default {
let
param
=
{
code
:
detail
.
code
,
openid
:
that
.
openid
}
let
opts
=
{
url
:
'/xcx/login'
,
method
:
'post'
}
...
...
@@ -106,6 +129,7 @@ export default {
}
},
onLoad
()
{
//默认加载
this
.
wechatLogin
()
let
userToken
=
uni
.
getStorageSync
(
'userToken'
)
if
(
userToken
)
{
let
that
=
this
...
...
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