提交 8dea8c22 authored 作者: 钟是志's avatar 钟是志

token 放在headers 里面

上级 b5298737
......@@ -11,6 +11,7 @@ import FormdataWrapper from '../../utils/object-to-formdata-custom';
import ButtonDiy from '../ButtonDiy/ButtonDiy';
import { giveFilePostData, giveFilePostDataInfoForTrue } from '@/webPublic/one_stop_public/Base16';
import SelectModal from '@/webPublic/one_stop_public/App/ExportCurrentInfo/SelectModal';
import { getHeaders } from '@/webPublic/zyd_public/utils/utils';
/**
*
* 2019/02/21 修改导出方式为fetch
......@@ -79,6 +80,7 @@ export default class ExportCurrentInfo extends React.Component {
method: 'POST',
body: FormdataWrapper(newApi.datas,
),
...getHeaders(),
})
.then((res) => {
if (res.status != '200') {
......
......@@ -22,6 +22,7 @@ import OrderItem from './OrderItem';
import FormdataWrapper from '../utils/object-to-formdata-custom';
import ButtonDiy from './ButtonDiy/ButtonDiy';
import { getHeaders } from '@/webPublic/zyd_public/utils/utils';
const Option = Select.Option;
var keyX = 1;
......@@ -366,6 +367,7 @@ export default class ExportInfo extends React.Component {
fetch(url, {
method: 'POST',
body: FormdataWrapper(params),
...getHeaders()
})
.then((res) => {
if (res.status != '200') {
......
......@@ -22,6 +22,7 @@ import OrderItem from './OrderItem';
import FormdataWrapper from '../utils/object-to-formdata-custom';
import ButtonDiy from './ButtonDiy/ButtonDiy';
import { getHeaders } from '@/webPublic/zyd_public/utils/utils';
const Option = Select.Option;
var keyX = 1;
......@@ -293,6 +294,7 @@ export default class SearchInfo extends React.Component {
fetch(url, {
method: 'POST',
body: FormdataWrapper(params),
...getHeaders(),
})
.then((res) => {
if (res.status != '200') {
......
......@@ -8,6 +8,7 @@ import styles from '../Ability.css';
import FormdataWrapper from '../../utils/object-to-formdata-custom';
import ButtonDiy from '../ButtonDiy/ButtonDiy';
import { nameSpan, nameSpan3, nameSpan2 } from './config';
import { getHeaders } from '@/webPublic/zyd_public/utils/utils';
const Option = Select.Option;
const FormItem = Form.Item;
......@@ -277,7 +278,9 @@ export default class StatisticsInfo extends React.Component {
fetch(url, {
method: 'POST',
body: FormdataWrapper(params),
})
...getHeaders(),
})
.then((res) => {
if (res.status != '200') {
return res.json();
......
import { giveFilePostDataInfoForTrue } from '@/webPublic/one_stop_public/Base16';
import { queryOauthActionPath } from '@/webPublic/one_stop_public/utils/queryConfig';
import { getToken } from '@/webPublic/one_stop_public/utils/token';
import { deepCopy } from '@/webPublic/zyd_public/utils/utils';
import { deepCopy, getHeaders } from '@/webPublic/zyd_public/utils/utils';
const apiUrl = queryOauthActionPath();
......@@ -600,6 +600,7 @@ function downloadFile(url, params, fileName = '导出文件', ext = 'xlsx') {
fetch(url, {
method: 'POST',
body: FormdataWrapper(params),
...getHeaders(),
})
.then((res) => {
if (res.status + '' !== '200') {
......
差异被折叠。
......@@ -422,6 +422,9 @@ export default class StatisticsInfo extends React.Component {
fetch(url, {
method: 'POST',
body: FormdataWrapper(params),
headers: {
Authorization: `bearer ${getToken()}`,
},
})
.then((res) => {
if (res.status != '200') {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论