Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mini-program-wepy
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
ui
mini-program-wepy
Commits
ffb4efd1
Commit
ffb4efd1
authored
May 19, 2020
by
ziyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improvement: 测试全局变量
parent
cbffa4f7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
0 deletions
+5
-0
app.wpy
src/app.wpy
+4
-0
index.wpy
src/pages/index.wpy
+1
-0
No files found.
src/app.wpy
View file @
ffb4efd1
...
@@ -9,7 +9,11 @@ wepy.app({
...
@@ -9,7 +9,11 @@ wepy.app({
// App 级别 hook,对整个 App 生效
// App 级别 hook,对整个 App 生效
// 同时存在 Page hook 和 App hook 时,优先执行 Page hook,返回值再交由 App hook 处
// 同时存在 Page hook 和 App hook 时,优先执行 Page hook,返回值再交由 App hook 处
},
},
globalData: {
info:''
},
onLaunch() {
onLaunch() {
// this.$options.globalData.info = '333';
wx.checkSession({
wx.checkSession({
success () {
success () {
console.log('已登录')
console.log('已登录')
...
...
src/pages/index.wpy
View file @
ffb4efd1
...
@@ -467,6 +467,7 @@
...
@@ -467,6 +467,7 @@
},
},
onLoad () {
onLoad () {
let that = this;
let that = this;
// console.log(this.$app.$options.globalData.info,111)
//如果已经存在store里就不用再获取用户信息了
//如果已经存在store里就不用再获取用户信息了
if(this.userInfo) return;
if(this.userInfo) return;
wx.getSetting({
wx.getSetting({
...
...
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