()
| 244 | } |
| 245 | } |
| 246 | async getToken() { //初次获取token |
| 247 | //log(this.ck) |
| 248 | this.ck = this.ck.replaceAll('/u003d', "="); // 把ASCII码为61的字符替换为等号 |
| 249 | |
| 250 | if ('QL_BRANCH' in process.env) { |
| 251 | //log(`是青龙环境`) |
| 252 | if (!compareVersion(process.env['QL_BRANCH']) || process.env['QL_BRANCH'] == 'master') { //如果小于返回true !true为false !false为 true |
| 253 | //log(`版本大于15.0`) |
| 254 | let regexp = new RegExp('\\\\', 'g'); |
| 255 | this.ck = this.ck.replace(regexp, '/'); |
| 256 | } |
| 257 | } |
| 258 | //log(this.ck) |
| 259 | |
| 260 | try { |
| 261 | this.ck = JSON.parse(this.ck); |
| 262 | } catch (e) { |
| 263 | this.ck = this.ck |
| 264 | } |
| 265 | |
| 266 | this.User_encryptData = this.ck["encryptData"] |
| 267 | this.User_encryptKey = this.ck["encryptKey"] |
| 268 | //log(this.User_encryptKey) |
| 269 | this.deEnData = getRSADecryptResult_android(this.User_encryptKey) |
| 270 | //log( this.deEnData) |
| 271 | if (!this.deEnData) { |
| 272 | this.deEnDataKey = 'ajgekbmgfkasefqk' |
| 273 | this.deEnDataIv = "cd1d955be8e4c11a" |
| 274 | this.User_Data = AES_CBC_Decrypt(this.User_encryptData, this.deEnDataKey, this.deEnDataIv) |
| 275 | this.User_AccessToken = this.User_Data["body"]['accessToken'] |
| 276 | this.User_RefreshToken = this.User_Data["body"]['refreshToken'] |
| 277 | await this.refresh_token() |
| 278 | } else { |
| 279 | //log(this.deEnData) |
| 280 | this.deEnDataKey = this.deEnData.split("@DS@")[0]; |
| 281 | this.deEnDataIv = this.deEnData.split("@DS@")[1]; |
| 282 | this.User_Data = AES_CBC_Decrypt(this.User_encryptData, this.deEnDataKey, this.deEnDataIv) |
| 283 | this.User_AccessToken = this.User_Data["body"]['accessToken'] |
| 284 | this.User_RefreshToken = this.User_Data["body"]['refreshToken'] |
| 285 | await this.refresh_token() |
| 286 | } |
| 287 | |
| 288 | } |
| 289 | |
| 290 | async user_info() { |
| 291 | try { |
nothing calls this directly
no test coverage detected