weapp-api,export wx

This commit is contained in:
张鹏波
2019-01-08 16:59:37 +08:00
parent 9989c26e92
commit 537fd9a06d
2 changed files with 5 additions and 2 deletions
+2
View File
@@ -1403,3 +1403,5 @@ declare function setInterval(callback: functions, delay: number, rest: any): num
* @param timeoutID 要取消的定时器的ID
*/
declare function clearInterval(timeoutID: number): number;
export default wx
+3 -2
View File
@@ -1,12 +1,13 @@
import wx from './index'
App({
onLaunch: function () {
//调用API从本地缓存中获取数据
var logs = wx.getStorageSync('logs') as Array<any> || []
let logs = wx.getStorageSync('logs') as Array<any> || []
logs.unshift(Date.now())
wx.setStorageSync('logs', logs)
},
getUserInfo: function (cb: Function) {
var that = this;
let that = this;
if (this.globalData.userInfo) {
typeof cb == "function" && cb(this.globalData.userInfo)
} else {