()
| 309 | } |
| 310 | |
| 311 | loadCache() { |
| 312 | const cache = this.getCached(); |
| 313 | if (!this.openid && cache.openid) this.openid = cache.openid; |
| 314 | if (!this.secret && cache.secret) this.secret = cache.secret; |
| 315 | if (!Object.keys(this.cookies).length && cache.cookie) this.cookies = parseCookie(cache.cookie); |
| 316 | this.uid = this.cookies.uid || cache.uid || this.uid || ""; |
| 317 | } |
| 318 | |
| 319 | async login() { |
| 320 | if (!this.openid) throw new Error("缺少 openid,无法自动登录。可设置 wps=openid 或 wps=openid#Cookie"); |
no test coverage detected