(timestamp)
| 74 | } |
| 75 | |
| 76 | function signRequest(timestamp) { |
| 77 | const payload = { |
| 78 | aesEncryptSecret: AES_SECRET, |
| 79 | appId: ROKI_APP_ID, |
| 80 | nonce: AES_SECRET, |
| 81 | secret: SIGN_SECRET, |
| 82 | timestamp, |
| 83 | }; |
| 84 | const raw = getSignString(payload); |
| 85 | return encodeURIComponent(crypto.createHmac("sha256", SIGN_SECRET).update(raw).digest("base64")); |
| 86 | } |
| 87 | |
| 88 | function isTokenError(error) { |
| 89 | return /token|登录|授权|401|10001|unauthorized/i.test(String(error && (error.message || error))); |
no test coverage detected