文件上传加头部参数

master
anthonywj 4 years ago
parent d01d1f43fd
commit 6f7e4ec2d2

@ -503,14 +503,14 @@ export const asyncRouterMap = [
authRule: ["thrsys/thrCorpsImport"] authRule: ["thrsys/thrCorpsImport"]
} }
}, },
{ // {
path: "thrCorpsExport", // path: "thrCorpsExport",
name: "往来单位导出", // name: "往来单位导出",
component: thrCorpsExport, // component: thrCorpsExport,
meta: { // meta: {
authRule: ["thrsys/thrCorpsExport"] // authRule: ["thrsys/thrCorpsExport"]
} // }
} // }
], ],
}, },

@ -1,5 +1,6 @@
import {getStore, setStore} from "../../utils/store"; import {getStore, setStore} from "../../utils/store";
import * as types from "../mutation-types"; import * as types from "../mutation-types";
import store from "@/store";
const state = { const state = {
sidebar: { sidebar: {
@ -65,9 +66,11 @@ const mutations = {
} }
}; };
export default { export default {
state, state,
getters, getters,
actions, actions,
mutations mutations,
}; };

@ -28,6 +28,7 @@
:action="uploadFileUrl" :action="uploadFileUrl"
multiple multiple
:limit="3" :limit="3"
:headers="headers"
:show-file-list="false" :show-file-list="false"
:on-success="handleChange" :on-success="handleChange"
:file-list="fileList" :file-list="fileList"
@ -145,6 +146,7 @@ import {
import modifyDialog from "./BussinessTypeModify"; import modifyDialog from "./BussinessTypeModify";
import axios from "axios"; import axios from "axios";
import store from "@/store";
export default { export default {
data() { data() {
@ -197,6 +199,8 @@ export default {
total: 0, total: 0,
multipleSelection: [], multipleSelection: [],
uploadFileUrl: null, uploadFileUrl: null,
headers: {},
}; };
}, },
@ -359,6 +363,10 @@ export default {
let response = res.data.BASE_URL; let response = res.data.BASE_URL;
this.uploadFileUrl = response + "/udiwms/busstiness/file/upload"; this.uploadFileUrl = response + "/udiwms/busstiness/file/upload";
}); });
this.headers = {
ADMIN_ID: store.getters.adminId,
ADMIN_TOKEN: store.getters.token,
};
}, },
}, },
components: { components: {

@ -36,10 +36,10 @@
:action="uploadFileUrl" :action="uploadFileUrl"
multiple multiple
:limit="3" :limit="3"
:headers="headers"
:data="uploadData" :data="uploadData"
:show-file-list="false" :show-file-list="false"
:on-success="handleChange" :on-success="handleChange"
:file-list="fileList" :file-list="fileList"
> >
<el-button size="mini" type="primary">导入往来单位</el-button> <el-button size="mini" type="primary">导入往来单位</el-button>
@ -158,6 +158,7 @@
import thrCorpsImportDetail from "./ThrCorpsImportDetail"; import thrCorpsImportDetail from "./ThrCorpsImportDetail";
import thrCorpSelect from "./ThrCorpSelect"; import thrCorpSelect from "./ThrCorpSelect";
import axios from "axios"; import axios from "axios";
import store from "@/store";
export default { export default {
data() { data() {
@ -174,6 +175,7 @@
thrCorpSelectVisible: false, thrCorpSelectVisible: false,
checked: false, checked: false,
list: [], list: [],
headers: {},
detailList: [], detailList: [],
thirdSys: [], thirdSys: [],
thirdSysDetail: null, thirdSysDetail: null,
@ -416,6 +418,10 @@
}, },
components: {thrCorpsImportDetail, thrCorpSelect}, components: {thrCorpsImportDetail, thrCorpSelect},
created() { created() {
this.headers = {
ADMIN_ID: store.getters.adminId,
ADMIN_TOKEN: store.getters.token,
};
this.getBasicThirdSys(); this.getBasicThirdSys();
// this.getList(); // this.getList();
}, },

@ -37,6 +37,7 @@
multiple multiple
:limit="3" :limit="3"
:data="uploadData" :data="uploadData"
:headers="headers"
:show-file-list="false" :show-file-list="false"
:on-success="handleChange" :on-success="handleChange"
:file-list="fileList" :file-list="fileList"
@ -159,6 +160,7 @@
import thrProductsImportDetail from "./ThrProductsImportDetail"; import thrProductsImportDetail from "./ThrProductsImportDetail";
import thrProductsSelect from "./ThrProductsSelect"; import thrProductsSelect from "./ThrProductsSelect";
import axios from "axios"; import axios from "axios";
import store from "@/store";
export default { export default {
data() { data() {
@ -171,6 +173,7 @@
limit: 20, limit: 20,
thirdSysFk: null, thirdSysFk: null,
}, },
headers:{},
udiImportDetailVisible: false, udiImportDetailVisible: false,
thrProductsSelectVisible: false, thrProductsSelectVisible: false,
checked: false, checked: false,
@ -396,6 +399,10 @@
}, },
components: {thrProductsImportDetail,thrProductsSelect}, components: {thrProductsImportDetail,thrProductsSelect},
created() { created() {
this.headers = {
ADMIN_ID: store.getters.adminId,
ADMIN_TOKEN: store.getters.token,
};
this.getBasicThirdSys(); this.getBasicThirdSys();
// this.getList(); // this.getList();
}, },

Loading…
Cancel
Save