完善登录逻辑和个人资料完善
This commit is contained in:
@@ -290,6 +290,22 @@ export class AkReq {
|
||||
data ?? {},
|
||||
res.header as UTSJSONObject
|
||||
);
|
||||
if (res.statusCode >= 400) {
|
||||
let bodyPreview = ''
|
||||
try {
|
||||
if (typeof res.data == 'string') {
|
||||
bodyPreview = (res.data as string).substring(0, 500)
|
||||
} else {
|
||||
bodyPreview = JSON.stringify(res.data).substring(0, 500)
|
||||
}
|
||||
} catch (e) {
|
||||
bodyPreview = '[unserializable response body]'
|
||||
}
|
||||
console.error('[ak-req] HTTP error response')
|
||||
console.error('[ak-req] status:', res.statusCode)
|
||||
console.error('[ak-req] url:', options.url)
|
||||
console.error('[ak-req] body:', bodyPreview)
|
||||
}
|
||||
resolve(result);
|
||||
},
|
||||
fail: (err) => {
|
||||
|
||||
Reference in New Issue
Block a user