-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
74 lines (61 loc) · 1.78 KB
/
app.js
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
// app.js
const utils= require('./utils/util')
wx.cloud.init()
const db = wx.cloud.database().collection("applicationForm")
App({
onLaunch(){
// 展示本地存储能力
const logs = wx.getStorageSync('logs') || []
logs.unshift(Date.now())
wx.setStorageSync('logs', logs)
// 登录
wx.login({
success: res => {
let _this = this
db.where({
StuName : this.userInfo.StuName,
pwd : this.userInfo.pwd
}).get({
success : res => {
_this.userInfo.id = res.data[0]._id
_this.userInfo.StuName = res.data[0].StuName
_this.userInfo.ClassName = res.data[0].ClassName
_this.userInfo.Sed_CollageName = res.data[0].Sed_CollageName
_this.userInfo.deparment = res.data[0].deparment
_this.userInfo.stu_Id = res.data[0].stu_Id
_this.userInfo.permisson = res.data[0].permisson
_this.userInfo.status = res.data[0].status
_this.userInfo.adjust = res.data[0].adjust
console.log('succes')
if(_this.userInfo.StuName !== ''){
_this.userInfo.loginistrue = 1
}
}
})
console.log(this.userInfo)
},
})
wx.cloud.init({
env: 'cloud1-5gny5k5k1dae764d',
//traceUser: true,
})
},
globalData: {
password : '',
name : ''
},
userInfo: {
id : '',
openid : '',
StuName : '',
ClassName : '',
Sed_CollageName : '',
deparment : '',
stu_Id : '',
permisson : '',
status : '',
adjust : '',
pwd : '',
loginistrue : '',
},
})