Przeglądaj źródła

尝试获取blob对象

sophieChenyx 6 lat temu
rodzic
commit
6e7ce0c9a7

+ 2 - 1
src/models/accounts.js

@@ -37,7 +37,8 @@ export default {
     },
     *fetchCampusExcel({ payload }, { call }) {
       //window.open('http://47.95.197.36:8500/stmt/campus/export');
-      // yield call(downloadCampusExcel, payload);
+      const res = yield call(downloadCampusExcel, payload);
+      console.log(' return blob Object res', res);
     },
     *fetchTerminalsList({ payload }, { call, put }) {
       const response = yield call(queryTerminalsList, payload);

+ 2 - 0
src/routes/Dashboard/Accounts/AccountsCampus.js

@@ -25,10 +25,12 @@ export default class CampusAccountsPage extends Component {
       payload: { ...this.state.Queryers }
     })
   }
+
   handleDownloadOperation = () => {
     this.props.dispatch({
       type: 'accounts/fetchCampusExcel'
     })
+    // 点击该链接的具体功能
   };
   handleFilterOperation = (params, states) => {
     this.setState({

+ 1 - 0
src/services/accounts.js

@@ -10,6 +10,7 @@ export async function queryCampusList(params) {
   };
   return request(`${api.accountsCampusList}?${stringify(newParams)}`);
 }
+
 export async function downloadCampusExcel() {
   return request(`${api.accountsCampusDownload}`);
 }

+ 1 - 1
src/utils/config.js

@@ -149,7 +149,7 @@ const apiObj = {
   accountsTerminalsList: '/stmt/terminal/user/page',
   accountsTerminalsDownload: '/stmt/terminal/user/export',
   acconutsTotalList: '/stmt/stats/page',
-  acconutsCampusAmount: '/stmt//stats/campus/totalsize',
+  acconutsCampusAmount: '/stmt/stats/campus/totalsize',
 };
 
 /**