Browse Source

fix: 修复国内站订单管理显示问题

周玉环 4 days ago
parent
commit
f7a09da815

+ 9 - 3
xinkeaboard-seller/src/models/menu.js

@@ -96,16 +96,22 @@ export default {
   },
 
   effects: {
-    * getMenuData({ payload }, { put }) {
+    * getMenuData({ payload }, { put,select }) {
       let { routes, authority } = payload;
       let routes_copy = JSON.parse(JSON.stringify(routes));
       //根据接口返回数据组装菜单
       let tmp_data = JSON.parse(localStorage.getItem('sld_menu_data'));
-
+      const currentSite = yield select(state => state.global.currentSite);
       let tmp_data_array = [];//把返回的二维数组修改为一维数组
       for (let s in tmp_data) {
         tmp_data[s].children.map(item => {
-          tmp_data_array.push(item);
+          if (currentSite !== '1') {
+            if (item.frontPath !== '/order/order') {
+              tmp_data_array.push(item);
+            }
+          } else {
+            tmp_data_array.push(item);
+          }
         });
       }
       for (var i = 0; i < routes.length; i++) {

+ 42 - 20
xinkeaboard-seller/src/pages/order/enquiry/order.js

@@ -1,22 +1,44 @@
-import React from 'react';
+import { Component } from "react";
+import { connect } from "dva";
+import router from "umi/router";
 
-let userInfo = JSON.parse(localStorage.user_info);
-const userName = userInfo.user_name;
-const url9710 = userInfo.url_9710;
-const src = `${url9710}&username=${userName}`;
-const BasicIframe = () => {
-  return (
-    <div style={{ width: '100%', height: '100%' }}>
-      <iframe
-        src={url9710}
-        title="Example Page"
-        width="100%"
-        height="100%"
-        frameBorder="0"
-        allowFullScreen
-      />
-    </div>
-  );
-};
+@connect(({ global }) => ({
+  global,
+}))
+export default class BasicIframe extends Component {
+  constructor(props) {
+    super(props);
+    this.userInfo = JSON.parse(localStorage.user_info);
+    this.userName = this.userInfo.user_name;
+    (this.url_9710 = this.userInfo.url_9710),
+      (this.state = {
+        userName: this.userName,
+        url9710: this.url_9710,
+        src: `${this.url9710}&username=${this.userName}`,
+        currentSite: props.global.currentSite,
+      });
+  }
 
-export default BasicIframe;
+  componentDidMount() {
+    const { currentSite } = this.state;
+    if (currentSite !== "1") {
+      router.push("/order/enquiry");
+    }
+  }
+
+  render() {
+    const { url9710 } = this.state;
+    return (
+      <div style={{ width: "100%", height: "100%" }}>
+        <iframe
+          src={url9710}
+          title="Example Page"
+          width="100%"
+          height="100%"
+          frameBorder="0"
+          allowFullScreen
+        />
+      </div>
+    );
+  }
+}