eims-ui-mobile/src/utils/http.ts
@@ -36,10 +36,12 @@ uni.navigateTo({ url: redirectRoute }) reject(res) } else { // 其他错误 -> 根据后端错误信息轻提示 uni.showToast({ icon: 'none', title: (res.data as IResData<T>).msg || '请求错误', }) reject(res) } } else if (res.statusCode === 401) { // 401错误 -> 清理用户信息,跳转到登录页 @@ -117,6 +119,14 @@ }) } export const httpDel = <T>(url: string) => { return http<T>({ url, method: 'DELETE', }) } http.get = httpGet http.post = httpPost http.put = httpPut http.del = httpDel