diff --git a/src/api/config.js b/src/api/config.js index b570c677..8035a778 100644 --- a/src/api/config.js +++ b/src/api/config.js @@ -6,7 +6,7 @@ * @FilePath: /fe-manage/src/api/config.js * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE */ -import { message } from "ant-design-vue"; +import {message} from "ant-design-vue"; import axios from "axios"; import router from "@/router"; // import { getCookie } from '../api/method' @@ -14,13 +14,13 @@ import router from "@/router"; // axios.defaults.headers.post["Content-Type"] = // "application/x-www-form-urlencoded"; - +export const FILE_UPLOAD_URL = process.env.VUE_APP_BASE_API + '/file/upload' axios.defaults.withCredentials = true; const http = axios.create({ baseURL: process.env.VUE_APP_BASE_API, timeout: 1000 * 15, // headers: { "Content-Type": "multipart/form-data" }, - headers: { "Content-Type": "application/json" }, + headers: {"Content-Type": "application/json"}, }); http.interceptors.request.use( @@ -50,14 +50,14 @@ http.interceptors.response.use( (response) => { // console.log('response', response) const { - data: { code, msg }, + data: {code, msg}, } = response; // console.log('code', code) if (code === 0 || code === 200) { return response; } else { if (code === 1000) { - process.env.NODE_ENV === 'development' ? router.push({ path: 'login' }) : (window.location.href = process.env.VUE_APP_LOGIN_URL) + process.env.NODE_ENV === 'development' ? router.push({path: 'login'}) : (window.location.href = process.env.VUE_APP_LOGIN_URL) } console.log("api %o", msg); } diff --git a/src/components/common/BaseUpload.vue b/src/components/common/BaseUpload.vue index 3a3406d3..b9146eeb 100644 --- a/src/components/common/BaseUpload.vue +++ b/src/components/common/BaseUpload.vue @@ -1,7 +1,7 @@