Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
U
uni-pdtravel
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
panyongping
uni-pdtravel
Commits
21a85664
Commit
21a85664
authored
Aug 28, 2024
by
潘永坪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
登录优化
parent
438d3a35
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
53 additions
and
39 deletions
+53
-39
login.vue
pages/login/login.vue
+53
-39
No files found.
pages/login/login.vue
View file @
21a85664
...
...
@@ -45,6 +45,7 @@ export default {
data
.
companyId
=
uni
.
getStorageSync
(
'enterOptions'
).
query
.
companyId
||
''
}
this
.
$request
(
'wechat/wx/getUserInfoByCode'
,
data
).
then
(
res
=>
{
try
{
if
(
res
.
code
==
'00'
)
{
let
openid
=
res
.
data
.
openid
uni
.
setStorageSync
(
'openid'
,
openid
)
...
...
@@ -56,6 +57,12 @@ export default {
icon
:
'none'
})
}
}
catch
(
e
){
uni
.
showToast
({
title
:
e
,
icon
:
'none'
})
}
}).
catch
(
err
=>
{
uni
.
showToast
({
title
:
'登录失败,请退出并重新登录'
,
...
...
@@ -75,6 +82,7 @@ export default {
login
(
openid
,
userId
,
source
){
let
datas
=
{
openid
,
userId
,
source
}
this
.
$request
(
'wechatUser/login/findWxUserAndLogin'
,
datas
).
then
(
res
=>
{
try
{
//通过openid获取token
if
(
res
.
code
==
'00'
)
{
let
token
=
res
.
data
.
token
||
''
...
...
@@ -106,6 +114,12 @@ export default {
icon
:
'none'
})
}
}
catch
(
e
){
uni
.
showToast
({
title
:
e
,
icon
:
'none'
})
}
}).
catch
(
err
=>
{
uni
.
showToast
({
title
:
'登录失败,请退出并重新登录'
,
...
...
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