(extra = {})
| 156 | } |
| 157 | |
| 158 | saveCache(extra = {}) { |
| 159 | const cache = readCache(); |
| 160 | cache[this.cacheKey] = { |
| 161 | ...(cache[this.cacheKey] || {}), |
| 162 | ...(this.openid ? { openid: this.openid } : {}), |
| 163 | ...(this.token ? { token: this.token } : {}), |
| 164 | ...(this.userInfo?.userId ? { userId: this.userInfo.userId } : {}), |
| 165 | ...(this.userInfo?.mobile ? { mobile: this.userInfo.mobile } : {}), |
| 166 | ...extra, |
| 167 | updatedAt: new Date().toISOString(), |
| 168 | }; |
| 169 | writeCache(cache); |
| 170 | } |
| 171 | |
| 172 | removeToken() { |
| 173 | const cache = readCache(); |
no test coverage detected