|
@@ -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>
|
|
|
+ );
|
|
|
+ }
|
|
|
+}
|