Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
tjty-app
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
王永飞
tjty-app
Commits
46fe7575
Commit
46fe7575
authored
Nov 28, 2022
by
LiZongLin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
登录bug
parent
92cee925
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
21 deletions
+29
-21
tjty_home_page.vue
tjty-app/pages_home/tjty_home_page/tjty_home_page.vue
+29
-21
No files found.
tjty-app/pages_home/tjty_home_page/tjty_home_page.vue
View file @
46fe7575
...
...
@@ -187,31 +187,35 @@
icon
:
'none'
})
},
getWXUserCode
()
{
return
new
Promise
((
resolve
,
reject
)
=>
{
if
(
!
this
.
token
){
resolve
();
return
}
console
.
log
(
this
.
token
);
console
.
log
(
"获取登录信息"
)
new
uni
.
login
({
provider
:
'weixin'
,
success
:
res
=>
{
console
.
log
(
"uni.login res"
,
res
.
code
)
let
code
=
res
.
code
getToken
(
code
,
this
.
token
).
then
(
res
=>
{
console
.
log
(
res
);
this
.
updateToken
(
res
.
data
.
token
)
this
.
updateUserInfo
(
res
.
data
.
user
)
})
}
})
resolve
();
})
},
//登录判断
login
()
{
// if (!this.token) {
this
.
getActivityList
()
this
.
getExerciseList
()
// } else {
// this.getExerciseListHaveToken()
// this.getActivityListHaveToken()
// }
},
// getExerciseListHaveToken() {
// listExerciseHaveToken().then(res => {
// this.exerciseList = [...this.exerciseList, ...res.data] || []
// }).catch(err => {
// })
// },
// getActivityListHaveToken() {
// listActivityStartHaveToken().then(res => {
// this.activityList = [...this.activityList, ...res.data] || []
// }).catch(err => {
// })
// },
getActivityList
()
{
listActivityStart
().
then
(
res
=>
{
this
.
activityList
=
[...
this
.
activityList
,
...
res
.
data
]
||
[]
...
...
@@ -269,8 +273,12 @@
}
},
onLoad
()
{
this
.
login
()
this
.
marginHight
=
uni
.
getStorageSync
(
'menuInfo'
).
statusBarHeight
+
9
+
'px'
},
onShow
()
{
this
.
getWXUserCode
().
then
(()
=>
{
this
.
login
()
})
}
}
</
script
>
...
...
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