提交 6530ea9f authored 作者: 钟是志's avatar 钟是志

27774 就业系统导入 接口带token hulinnaAdmin 123456

上级 40c5f10e
...@@ -7,6 +7,7 @@ import moment from 'moment'; ...@@ -7,6 +7,7 @@ import moment from 'moment';
import { Icon, message, notification } from 'antd'; import { Icon, message, notification } from 'antd';
import { getOneStopActiveMenus, getOnestopKey } from '../../Services'; import { getOneStopActiveMenus, getOnestopKey } from '../../Services';
import FormdataWrapper from './object-to-formdata-custom'; import FormdataWrapper from './object-to-formdata-custom';
import { getToken } from '@/webPublic/one_stop_public/utils/token';
let messageTime = new Date().getTime() - 3000; let messageTime = new Date().getTime() - 3000;
...@@ -278,13 +279,22 @@ export function diGuiTree(treeData = [], i = 0) { ...@@ -278,13 +279,22 @@ export function diGuiTree(treeData = [], i = 0) {
* 本地开发可能会存在跨域问题 * 本地开发可能会存在跨域问题
* */ * */
export function downloadFile(url, params, fileName = '导出文件', ext = 'xlsx', method = 'POST') { export function downloadFile(url, params, fileName = '导出文件', ext = 'xlsx', method = 'POST') {
console.log(arguments);
if(process.env.NODE_ENV === 'development' && getIsBei_Dian()){
url = url.replace('https://yx.bpi.edu.cn/produce', 'http://localhost:8010/produce');
}
fetch(url, { fetch(url, {
method, method,
body: method === 'GET' ? undefined : FormdataWrapper(params), body: method === 'GET' ? undefined : FormdataWrapper(params),
// credentials: 'omit', // credentials: 'omit',
// mode: 'cors', // mode: 'cors',
// headers: {Accept: 'application/json'} // headers: {
// // Accept: 'application/json',
//
// },
headers: {
Authorization: `bearer ${getToken()}`,
},
}) })
.then((res) => { .then((res) => {
if (res.status + '' !== '200') { if (res.status + '' !== '200') {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论