index.js
546 Bytes
import Request from '../../request/index'
import webwx from './helper'
class Version {
constructor(options = {}) {
options.alert = options.alert || function () {}
options.request.returnAll = false
this.request = new Request(options)
}
async get(data) {
const versionInfo = await this.request.get(data)
this.version = versionInfo
return this.compare()
}
set(version) {
webwx.setVersion(version)
return this.compare()
}
compare() {
return webwx.getResult(this.version)
}
}
export default Version