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

token 放在headers 里面

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