小皮2017-06-26 10:57:41 0 2 313
在WxService中有如下语句:
class Service {
....没有找到login和getUserInfo的定义
}
export default Service
在app.js中有如下语句:
import WxService from 'helpers/WxService'
APP({
WxService: new WxService,
getUserInfo() {
return this.WxService.login()
.then(data => {
console.log(data)
return this.WxService.getUserInfo()
})
.then(data => {
console.log(data)
this.globalData.userInfo = data.userInfo
return this.globalData.userInfo
})
},
})
为什么可以执行this.WxService.login()和this.WxService.getUserInfo()?
phpcn_u1582 2017-06-26 10:59:412楼
谢邀。
this.WxService是微信封装的对象,对外是隐藏的。
ps:另外微信还有自己的协议weixin://类似http://
赞 +0添加回复
扔个三星炸死你 2017-06-26 10:59:411楼
this.WxService是微信封装的对象
https://mp.weixin.qq.com/debu...
赞 +0添加回复