import HTTP from './http';
export default class Login {
constructor() {
this.abcHttp = new HTTP({
serverType: 'abc'
});
this.bcdHttp = new HTTP({
serverType: 'bcd'
});
}
static instance;
static getInstance() {
if (false === this.instance instanceof this) {
this.instance = new this;
}
return this.instance;
}
loginAfter(){
this.abcHttp.post().then(
res => {
...
})
}
getToken() {
}
}
import loginManager from './loginManager.js'
export default class http{
constructor(params) {
this.serverType = params.serverType || 'abc';
}
post() {
const login = loginManager.getInstance();
login.getToken()
wx.requset({
})
}
}
是不是插件和正式小程序的模块加载方式不同,求官方大大回答一下