Update API types and request handling
This commit is contained in:
@ -19,11 +19,13 @@ const useServerRequest = async <T>(
|
||||
}
|
||||
},
|
||||
onResponse({ response }) {
|
||||
if (+response.status === 200 && +response._data.code !== 200) {
|
||||
console.log('response1---', response);
|
||||
if (+response.status === 200 && +response._data.code !== 0) {
|
||||
process.client && ElMessage.error(response._data.msg);
|
||||
}
|
||||
},
|
||||
onResponseError({ response }) {
|
||||
console.log('response2---', response);
|
||||
process.client &&
|
||||
ElMessage.error(
|
||||
isArray(response._data.data.msg)
|
||||
|
||||
Reference in New Issue
Block a user