|
@@ -44,13 +44,16 @@ const Http = (options = { data: {} }) => {
|
|
|
const { statusCode } = res
|
|
|
if (statusCode === 200) {
|
|
|
const msg = res.data || ''
|
|
|
- const key = CJ.enc.Utf8.parse(HLKEY)
|
|
|
- const bytes = CJ.AES.decrypt(msg, key, {
|
|
|
- mode: CJ.mode.ECB,
|
|
|
- padding: CJ.pad.Pkcs7
|
|
|
- })
|
|
|
- const originalText = bytes.toString(CJ.enc.Utf8)
|
|
|
- const data = JSON.parse(originalText)
|
|
|
+ let data = msg
|
|
|
+ if (typeof(msg) === 'string') {
|
|
|
+ const key = CJ.enc.Utf8.parse(HLKEY)
|
|
|
+ const bytes = CJ.AES.decrypt(msg, key, {
|
|
|
+ mode: CJ.mode.ECB,
|
|
|
+ padding: CJ.pad.Pkcs7
|
|
|
+ })
|
|
|
+ const originalText = bytes.toString(CJ.enc.Utf8)
|
|
|
+ data = JSON.parse(originalText)
|
|
|
+ }
|
|
|
// console.log(data)
|
|
|
// const data = res.data
|
|
|
const { errno } = data
|