fix response obj is null
This commit is contained in:
		
							parent
							
								
									8cbffe42bd
								
							
						
					
					
						commit
						3a08cbb1fb
					
				| @ -81,7 +81,7 @@ const resObject = (key = null, message = null, msgCode = null) => { | ||||
| 
 | ||||
|   if (typeof message === 'string' && message.trim().length > 0) { | ||||
|     resObj.obj.message = message.trim() | ||||
|   } else if (typeof message === 'object') { | ||||
|   } else if (message !== null && typeof message === 'object') { | ||||
|     resObj.obj = message | ||||
|   } | ||||
|   return resObj | ||||
|  | ||||
| @ -23,7 +23,6 @@ r.use(async (c, n) => { | ||||
|   } catch (err) { | ||||
|     console.log(err) | ||||
|     obj = resObject(err instanceof APIError ? err.resKey : 'InternalError', err.apiMsg || null, err.msgCode || null) | ||||
|     console.log(obj) | ||||
|   } | ||||
| 
 | ||||
|   if (Object.keys(c.obj).length > 0 && 'status' in c.obj && 'obj' in c.obj) { | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user