You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
1.0 KiB
JavaScript
40 lines
1.0 KiB
JavaScript
// app.js
|
|
var $ = require("./utils/util.js");
|
|
App({
|
|
onLaunch: function() {
|
|
let that = this;
|
|
// 从本地调取缓存
|
|
if ($.getLocalStorage('token') !== undefined && $.getLocalStorage('userInfo') !== undefined) {
|
|
that.globalData.userInfo = $.getLocalStorage('userInfo')
|
|
}else{
|
|
wx.navigateTo({
|
|
url: '/pages/authorize/authorize',
|
|
})
|
|
}
|
|
console.log('that.globalData',that.globalData)
|
|
let url
|
|
if(that.globalData.userInfo.phone){
|
|
url = that.globalData.API + '/api/CbfInfo/GetCbfByPhoneNum?PhoneNum=' + that.globalData.userInfo.phone
|
|
}else{
|
|
url = that.globalData.API + '/api/CbfInfo/GetCbfByPhoneNum?PhoneNum=' + '18865538935'
|
|
}
|
|
|
|
wx.request({
|
|
url: url,
|
|
data: {},
|
|
method: 'POST',
|
|
header: {
|
|
'content-type': 'application/json' // 默认值
|
|
},
|
|
success (res) {
|
|
that.globalData.cbfbm = res.data.result.cbfbm
|
|
}
|
|
})
|
|
},
|
|
globalData: {
|
|
userInfo: null,
|
|
cbfbm: null,
|
|
API: 'https://ssl.hopetrytech.com:9097',
|
|
}
|
|
})
|