()
| 170 | } |
| 171 | |
| 172 | async refreshToken() { |
| 173 | if (!this.session.openid) return false; |
| 174 | try { |
| 175 | const res = await this.request("/cgs-api/wxApi/wechatLogin", { openid: this.session.openid }, ""); |
| 176 | const token = res.data?.token || res.token; |
| 177 | if (!token) return false; |
| 178 | this.session.token = token; |
| 179 | this.saveCachedToken(); |
| 180 | return true; |
| 181 | } catch (e) { |
| 182 | return false; |
| 183 | } |
| 184 | } |
| 185 | |
| 186 | async getSignInfo() { |
| 187 | const res = await this.request("/cgs-api/wxApi/wechatUser/wechatInfoSignIn"); |
no test coverage detected