-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathApp.vue
50 lines (46 loc) · 868 Bytes
/
App.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<script>
export default {
onLaunch: function() {
uni.clearStorageSync()
uni.setStorage({
key: 'INDEX_TO_STUDY_TYPRID',
data: 1
})
// uni.setStorage({
// key: 'USERINFO_OPENID',
// data: 'oeSEv5pCmNXV_LOOJtQZ2v9UsonQ',
// success: (res) => {
// this.getUserInfo(res.data)
// }
// })
/* uni.setStorage({
key: 'USER_ID',
data: 1
}) */
},
onShow: function() {
},
onHide: function() {
},
methods: {
async getUserInfo(openId) {
uni.getStorage({
key: 'USERINFO_OPENID',
success: (result) => {
const res = this.$myRequest({
url: '/user/getByOpenId?openId=' + result.data
})
console.log(res)
uni.setStorage({
key: 'USERID',
data: res.data.data.id
})
}
})
},
}
}
</script>
<style>
/*每个页面公共css */
</style>