| | |
| | | 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'; |
| | |
| | | }).then((response) => { |
| | | resolve(response.data); |
| | | }).catch((error) => { |
| | | reject(error); |
| | | if(error.status == 400) { |
| | | ElMessage({ |
| | | message: error.data.msg, |
| | | type: 'warning', |
| | | }) |
| | | }else { |
| | | reject(error); |
| | | } |
| | | }) |
| | | }) |
| | | }, |
| | |
| | | */ |
| | | postJ: function(url, data={}, config={}) { |
| | | return new Promise((resolve, reject) => { |
| | | console.log(qsStringify(data)) |
| | | axios({ |
| | | method: 'post', |
| | | url: url, |
| | |
| | | axios({ |
| | | method: 'delete', |
| | | url: url, |
| | | params: data, |
| | | data: data, |
| | | ...config |
| | | }).then((response) => { |
| | | resolve(response.data); |
| | | }).catch((error) => { |
| | | reject(error); |
| | | if(error.status == 400) { |
| | | ElMessage({ |
| | | message: error.data.msg, |
| | | type: 'warning', |
| | | }) |
| | | }else { |
| | | reject(error); |
| | | } |
| | | }) |
| | | }) |
| | | }, |