VM78:1 thirdScriptError
Bmob.User is not a constructor;at App lifeCycleMethod onLaunch function
TypeError: Bmob.User is not a constructor
at pe.onLaunch (http:
at pe. (http://127.0.0.1:33337/appservice/__dev__/WAService.js:2:1646604)
at new pe (http://127.0.0.1:33337/appservice/__dev__/WAService.js:2:1647269)
at Function. (http://127.0.0.1:33337/appservice/__dev__/WAService.js:2:1647683)
at http:
at http:
at require (http://127.0.0.1:33337/appservice/__dev__/WAService.js:2:1681923)
at :1:1
at HTMLScriptElement.scriptLoaded (http://127.0.0.1:33337/appservice/appservice?t=1580722672169:2097:21)
at HTMLScriptElement.script.onload (http://127.0.0.1:33337/appservice/appservice?t=1580722672169:2109:20)
var Bmob = require('/utils/Bmob-2.2.2.min.js');
Bmob.initialize('0bbf738b4c5401ee', '147258');
App({
onLaunch: function () {
var user = new Bmob.User() //开始注册用户
user.auth().then(function (obj) {
console.log('登陆成功')
},
function (err) {
console.log('失败了', err)
});
},
getUserInfo: function (cb) {
var that = this
if (this.globalData.userInfo) {
typeof cb == 'function' && cb(this.globalData.userInfo)
} else {
//调用登录接口
wx.login({
success: function () {
wx.getUserInfo({
success: function (res) {
that.globalData.userInfo = res.userInfo
typeof cb == 'function' && cb(that.globalData.userInfo)
}
})
}
})
}
},
globalData: {
userInfo: null
}
})
解决了么好兄弟