From 5ce658c5cf97b40cc0d84d8bfb37f96053ea8ef1 Mon Sep 17 00:00:00 2001 From: gaoshp <291585735@qq.com> Date: 星期二, 16 四月 2024 00:31:39 +0800 Subject: [PATCH] update --- src/utils/request.js | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/utils/request.js b/src/utils/request.js index d505ec7..3253bbf 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -1,5 +1,5 @@ import axios from 'axios'; -import { ElNotification, ElMessageBox } from 'element-plus'; +import { ElNotification, ElMessageBox, ElMessage } from 'element-plus'; import sysConfig from "@/config"; import tool from '@/utils/tool'; import router from '@/router'; @@ -130,7 +130,14 @@ }).then((response) => { resolve(response.data); }).catch((error) => { - reject(error); + if(error.status == 400) { + ElMessage({ + message: error.data.msg, + type: 'warning', + }) + }else { + reject(error); + } }) }) }, @@ -141,6 +148,7 @@ */ postJ: function(url, data={}, config={}) { return new Promise((resolve, reject) => { + console.log(qsStringify(data)) axios({ method: 'post', url: url, -- Gitblit v1.9.3