mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-12 12:26:47 +08:00
-- 附件上传url
This commit is contained in:
@@ -6,7 +6,7 @@
|
|||||||
* @FilePath: /fe-manage/src/api/config.js
|
* @FilePath: /fe-manage/src/api/config.js
|
||||||
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
* @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 axios from "axios";
|
||||||
import router from "@/router";
|
import router from "@/router";
|
||||||
// import { getCookie } from '../api/method'
|
// import { getCookie } from '../api/method'
|
||||||
@@ -14,13 +14,13 @@ import router from "@/router";
|
|||||||
|
|
||||||
// axios.defaults.headers.post["Content-Type"] =
|
// axios.defaults.headers.post["Content-Type"] =
|
||||||
// "application/x-www-form-urlencoded";
|
// "application/x-www-form-urlencoded";
|
||||||
|
export const FILE_UPLOAD_URL = process.env.VUE_APP_BASE_API + '/file/upload'
|
||||||
axios.defaults.withCredentials = true;
|
axios.defaults.withCredentials = true;
|
||||||
const http = axios.create({
|
const http = axios.create({
|
||||||
baseURL: process.env.VUE_APP_BASE_API,
|
baseURL: process.env.VUE_APP_BASE_API,
|
||||||
timeout: 1000 * 15,
|
timeout: 1000 * 15,
|
||||||
// headers: { "Content-Type": "multipart/form-data" },
|
// headers: { "Content-Type": "multipart/form-data" },
|
||||||
headers: { "Content-Type": "application/json" },
|
headers: {"Content-Type": "application/json"},
|
||||||
});
|
});
|
||||||
|
|
||||||
http.interceptors.request.use(
|
http.interceptors.request.use(
|
||||||
@@ -50,14 +50,14 @@ http.interceptors.response.use(
|
|||||||
(response) => {
|
(response) => {
|
||||||
// console.log('response', response)
|
// console.log('response', response)
|
||||||
const {
|
const {
|
||||||
data: { code, msg },
|
data: {code, msg},
|
||||||
} = response;
|
} = response;
|
||||||
// console.log('code', code)
|
// console.log('code', code)
|
||||||
if (code === 0 || code === 200) {
|
if (code === 0 || code === 200) {
|
||||||
return response;
|
return response;
|
||||||
} else {
|
} else {
|
||||||
if (code === 1000) {
|
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);
|
console.log("api %o", msg);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<a-upload
|
<a-upload
|
||||||
:file-list="files"
|
:file-list="files"
|
||||||
:action="`${process.env.VUE_APP_BASE_API}/file/upload`"
|
:action="FILE_UPLOAD_URL"
|
||||||
:show-upload-list="showUploadList"
|
:show-upload-list="showUploadList"
|
||||||
:multiple="multiple"
|
:multiple="multiple"
|
||||||
:before-upload="beforeUpload"
|
:before-upload="beforeUpload"
|
||||||
@@ -16,6 +16,7 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import {defineProps, defineEmits, defineExpose, ref, watch} from "vue";
|
import {defineProps, defineEmits, defineExpose, ref, watch} from "vue";
|
||||||
import {message} from "ant-design-vue";
|
import {message} from "ant-design-vue";
|
||||||
|
import {FILE_UPLOAD_URL} from "@/api/config";
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
value: {
|
value: {
|
||||||
|
|||||||
@@ -354,7 +354,7 @@
|
|||||||
<div class="btnbox">
|
<div class="btnbox">
|
||||||
<a-upload
|
<a-upload
|
||||||
@change="handleChange"
|
@change="handleChange"
|
||||||
:action="`${process.env.VUE_APP_BASE_API}/file/upload`"
|
:action="FILE_UPLOAD_URL"
|
||||||
v-model:file-list="fileList"
|
v-model:file-list="fileList"
|
||||||
>
|
>
|
||||||
<button class="xkbtn">上传附件</button>
|
<button class="xkbtn">上传附件</button>
|
||||||
@@ -392,6 +392,7 @@ import { detail } from "../../api/indexCourse";
|
|||||||
import { queryAppraiseDetailById } from "../../api/indexInvist";
|
import { queryAppraiseDetailById } from "../../api/indexInvist";
|
||||||
import { queryWorkDetailById } from "@/api/indexWork";
|
import { queryWorkDetailById } from "@/api/indexWork";
|
||||||
import { queryExaminationDetailById } from "@/api/indexExam";
|
import { queryExaminationDetailById } from "@/api/indexExam";
|
||||||
|
import {FILE_UPLOAD_URL} from "@/api/config";
|
||||||
export default {
|
export default {
|
||||||
name: "AddFaceteach",
|
name: "AddFaceteach",
|
||||||
components: {
|
components: {
|
||||||
@@ -841,6 +842,7 @@ export default {
|
|||||||
};
|
};
|
||||||
return {
|
return {
|
||||||
...toRefs(state),
|
...toRefs(state),
|
||||||
|
FILE_UPLOAD_URL,
|
||||||
showDrawerSelFacet,
|
showDrawerSelFacet,
|
||||||
showDrawerAddHomework,
|
showDrawerAddHomework,
|
||||||
showDrawerAddTest,
|
showDrawerAddTest,
|
||||||
|
|||||||
@@ -45,7 +45,7 @@
|
|||||||
<span style="margin-right: 3px">附件:</span>
|
<span style="margin-right: 3px">附件:</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="btnbox">
|
<div class="btnbox">
|
||||||
<a-upload v-model:file-list="fileList" name="file" action="/manageApi/file/upload"
|
<a-upload v-model:file-list="fileList" name="file" :action="FILE_UPLOAD_URL"
|
||||||
@change="handleChange">
|
@change="handleChange">
|
||||||
<button class="xkbtn" type="button">上传附件</button>
|
<button class="xkbtn" type="button">上传附件</button>
|
||||||
</a-upload>
|
</a-upload>
|
||||||
@@ -82,6 +82,7 @@ import {
|
|||||||
import { ProjectEditTask, RouterEditTask } from "@/api/indexTask";
|
import { ProjectEditTask, RouterEditTask } from "@/api/indexTask";
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
import { addTempTask } from "../../api/indexTaskadd";
|
import { addTempTask } from "../../api/indexTaskadd";
|
||||||
|
import {FILE_UPLOAD_URL} from "@/api/config";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "AddHomework",
|
name: "AddHomework",
|
||||||
@@ -513,6 +514,7 @@ export default {
|
|||||||
disabledDate,
|
disabledDate,
|
||||||
disabledDateTime,
|
disabledDateTime,
|
||||||
afterVisibleChange,
|
afterVisibleChange,
|
||||||
|
FILE_UPLOAD_URL,
|
||||||
closeDrawer,
|
closeDrawer,
|
||||||
closeDrawer2,
|
closeDrawer2,
|
||||||
handleChange,
|
handleChange,
|
||||||
|
|||||||
Reference in New Issue
Block a user