-- 附件上传url

This commit is contained in:
yuping
2022-12-22 22:30:37 +08:00
parent b44e070069
commit 6fa476aa1c
4 changed files with 13 additions and 8 deletions

View File

@@ -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);
}