Commit 9aa2de26 by 王禹桐

Merge branch 'master_wyt' into 'master'

Master wyt

See merge request iLearning-frontend/sass-admin!1
parents af91e513 81886e11
var os = require('os'), IP = '', ifaces = os.networkInterfaces() // 获取本机IP var os = require('os'), IP = 'http://47.116.126.39:8080', ifaces = os.networkInterfaces() // 获取本机IP
out: out:
for (var i in ifaces) { for (var i in ifaces) {
for (var j in ifaces[i]) { for (var j in ifaces[i]) {
......
This source diff could not be displayed because it is too large. You can view the blob instead.
{"name":"reactCli_library","content":{"../node_modules/react/index.js":{"id":0,"buildMeta":{"providedExports":true}},"../node_modules/prop-types/index.js":{"id":1,"buildMeta":{"providedExports":true}},"../node_modules/react-dom/index.js":{"id":6,"buildMeta":{"providedExports":true}},"../node_modules/webpack/buildin/global.js":{"id":53,"buildMeta":{"providedExports":true}},"../node_modules/react-router/esm/react-router.js":{"id":60,"buildMeta":{"exportsType":"namespace","providedExports":["MemoryRouter","Prompt","Redirect","Route","Router","StaticRouter","Switch","__HistoryContext","__RouterContext","generatePath","matchPath","useHistory","useLocation","useParams","useRouteMatch","withRouter"]}},"../node_modules/react-is/index.js":{"id":63,"buildMeta":{"providedExports":true}},"../node_modules/object-assign/index.js":{"id":66,"buildMeta":{"providedExports":true}},"../node_modules/@babel/runtime/helpers/esm/extends.js":{"id":69,"buildMeta":{"exportsType":"namespace","providedExports":["default"]}},"../node_modules/@babel/runtime/helpers/esm/inheritsLoose.js":{"id":95,"buildMeta":{"exportsType":"namespace","providedExports":["default"]}},"../node_modules/tiny-invariant/dist/tiny-invariant.esm.js":{"id":96,"buildMeta":{"exportsType":"namespace","providedExports":["default"]}},"../node_modules/history/esm/history.js":{"id":106,"buildMeta":{"exportsType":"namespace","providedExports":["createBrowserHistory","createHashHistory","createMemoryHistory","createLocation","locationsAreEqual","parsePath","createPath"]}},"../node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js":{"id":216,"buildMeta":{"exportsType":"namespace","providedExports":["default"]}},"../node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js":{"id":326,"buildMeta":{"providedExports":true}},"../node_modules/react/cjs/react.production.min.js":{"id":456,"buildMeta":{"providedExports":true}},"../node_modules/react-dom/cjs/react-dom.production.min.js":{"id":466,"buildMeta":{"providedExports":true}},"../node_modules/scheduler/index.js":{"id":467,"buildMeta":{"providedExports":true}},"../node_modules/scheduler/cjs/scheduler.production.min.js":{"id":468,"buildMeta":{"providedExports":true}},"../node_modules/react-is/cjs/react-is.production.min.js":{"id":469,"buildMeta":{"providedExports":true}},"../node_modules/prop-types/factoryWithThrowingShims.js":{"id":470,"buildMeta":{"providedExports":true}},"../node_modules/prop-types/lib/ReactPropTypesSecret.js":{"id":471,"buildMeta":{"providedExports":true}},"../node_modules/mini-create-react-context/dist/esm/index.js":{"id":650,"buildMeta":{"exportsType":"namespace","providedExports":["default"]}},"../node_modules/path-to-regexp/index.js":{"id":651,"buildMeta":{"providedExports":true}},"../node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js":{"id":1198,"buildMeta":{"exportsType":"namespace","providedExports":["default"]}},"../node_modules/resolve-pathname/esm/resolve-pathname.js":{"id":1199,"buildMeta":{"exportsType":"namespace","providedExports":["default"]}},"../node_modules/value-equal/esm/value-equal.js":{"id":1200,"buildMeta":{"exportsType":"namespace","providedExports":["default"]}},"../node_modules/react-router-dom/esm/react-router-dom.js":{"id":1785,"buildMeta":{"exportsType":"namespace","providedExports":["MemoryRouter","Prompt","Redirect","Route","Router","StaticRouter","Switch","generatePath","matchPath","useHistory","useLocation","useParams","useRouteMatch","withRouter","BrowserRouter","HashRouter","Link","NavLink"]}},"../node_modules/path-to-regexp/node_modules/isarray/index.js":{"id":1786,"buildMeta":{"providedExports":true}}}} {"name":"reactCli_library","content":{"../node_modules/react/index.js":{"id":0,"buildMeta":{"providedExports":true}},"../node_modules/prop-types/index.js":{"id":1,"buildMeta":{"providedExports":true}},"../node_modules/react-dom/index.js":{"id":6,"buildMeta":{"providedExports":true}},"../node_modules/webpack/buildin/global.js":{"id":53,"buildMeta":{"providedExports":true}},"../node_modules/react-router/esm/react-router.js":{"id":60,"buildMeta":{"exportsType":"namespace","providedExports":["MemoryRouter","Prompt","Redirect","Route","Router","StaticRouter","Switch","__HistoryContext","__RouterContext","generatePath","matchPath","useHistory","useLocation","useParams","useRouteMatch","withRouter"]}},"../node_modules/object-assign/index.js":{"id":65,"buildMeta":{"providedExports":true}},"../node_modules/@babel/runtime/helpers/esm/extends.js":{"id":68,"buildMeta":{"exportsType":"namespace","providedExports":["default"]}},"../node_modules/history/esm/history.js":{"id":90,"buildMeta":{"exportsType":"namespace","providedExports":["createBrowserHistory","createHashHistory","createMemoryHistory","createLocation","locationsAreEqual","parsePath","createPath"]}},"../node_modules/tiny-invariant/dist/tiny-invariant.esm.js":{"id":95,"buildMeta":{"exportsType":"namespace","providedExports":["default"]}},"../node_modules/@babel/runtime/helpers/esm/inheritsLoose.js":{"id":105,"buildMeta":{"exportsType":"namespace","providedExports":["default"]}},"../node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js":{"id":215,"buildMeta":{"exportsType":"namespace","providedExports":["default"]}},"../node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js":{"id":325,"buildMeta":{"providedExports":true}},"../node_modules/react/cjs/react.production.min.js":{"id":454,"buildMeta":{"providedExports":true}},"../node_modules/react-dom/cjs/react-dom.production.min.js":{"id":464,"buildMeta":{"providedExports":true}},"../node_modules/scheduler/index.js":{"id":465,"buildMeta":{"providedExports":true}},"../node_modules/scheduler/cjs/scheduler.production.min.js":{"id":466,"buildMeta":{"providedExports":true}},"../node_modules/prop-types/factoryWithThrowingShims.js":{"id":467,"buildMeta":{"providedExports":true}},"../node_modules/prop-types/lib/ReactPropTypesSecret.js":{"id":468,"buildMeta":{"providedExports":true}},"../node_modules/hoist-non-react-statics/node_modules/react-is/index.js":{"id":505,"buildMeta":{"providedExports":true}},"../node_modules/hoist-non-react-statics/node_modules/react-is/cjs/react-is.production.min.js":{"id":506,"buildMeta":{"providedExports":true}},"../node_modules/path-to-regexp/index.js":{"id":650,"buildMeta":{"providedExports":true}},"../node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js":{"id":1206,"buildMeta":{"exportsType":"namespace","providedExports":["default"]}},"../node_modules/resolve-pathname/esm/resolve-pathname.js":{"id":1207,"buildMeta":{"exportsType":"namespace","providedExports":["default"]}},"../node_modules/value-equal/esm/value-equal.js":{"id":1208,"buildMeta":{"exportsType":"namespace","providedExports":["default"]}},"../node_modules/react-router-dom/esm/react-router-dom.js":{"id":1803,"buildMeta":{"exportsType":"namespace","providedExports":["MemoryRouter","Prompt","Redirect","Route","Router","StaticRouter","Switch","generatePath","matchPath","useHistory","useLocation","useParams","useRouteMatch","withRouter","BrowserRouter","HashRouter","Link","NavLink"]}},"../node_modules/path-to-regexp/node_modules/isarray/index.js":{"id":1804,"buildMeta":{"providedExports":true}},"../node_modules/react-router/node_modules/react-is/index.js":{"id":1805,"buildMeta":{"providedExports":true}},"../node_modules/react-router/node_modules/react-is/cjs/react-is.production.min.js":{"id":1806,"buildMeta":{"providedExports":true}}}}
\ No newline at end of file \ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -705,16 +705,20 @@ class homePage extends Component { ...@@ -705,16 +705,20 @@ class homePage extends Component {
/> />
</span> </span>
<Card <Card
style={{ width: "100%", backgroundColor: "#ffffff"}} style={{ width: "100%", backgroundColor: "#ffffff" }}
bordered={false} bordered={false}
> >
{/* bug-11956-jmy 百分比显示不全 bug-12345-jmy 百分比后的箭头显示不出来*/} {/* bug-11956-jmy 百分比显示不全 bug-12345-jmy 百分比后的箭头显示不出来*/}
<Meta <Meta
style={{marginRight: "-10px"}} style={{ marginRight: "-10px" }}
avatar={ avatar={
<Icon <Icon
type="user" type="user"
style={{ fontSize: "48px",marginRight:'-10px', marginLeft:"-16px"}} style={{
fontSize: "48px",
marginRight: "-10px",
marginLeft: "-16px",
}}
/> />
} }
title={ title={
...@@ -799,11 +803,15 @@ class homePage extends Component { ...@@ -799,11 +803,15 @@ class homePage extends Component {
> >
{/* bug-11956-jmy 百分比显示不全 bug-12345-jmy 百分比后的箭头显示不出来*/} {/* bug-11956-jmy 百分比显示不全 bug-12345-jmy 百分比后的箭头显示不出来*/}
<Meta <Meta
style={{marginRight: "-10px"}} style={{ marginRight: "-10px" }}
avatar={ avatar={
<Icon <Icon
type="calendar" type="calendar"
style={{ fontSize: "48px",marginRight:'-10px', marginLeft:"-16px"}} style={{
fontSize: "48px",
marginRight: "-10px",
marginLeft: "-16px",
}}
/> />
} }
title={ title={
...@@ -880,11 +888,15 @@ class homePage extends Component { ...@@ -880,11 +888,15 @@ class homePage extends Component {
> >
{/* bug-11956-jmy 百分比显示不全 bug-12345-jmy 百分比后的箭头显示不出来*/} {/* bug-11956-jmy 百分比显示不全 bug-12345-jmy 百分比后的箭头显示不出来*/}
<Meta <Meta
style={{marginRight: "-10px"}} style={{ marginRight: "-10px" }}
avatar={ avatar={
<Icon <Icon
type="play-square" type="play-square"
style={{ fontSize: "48px",marginRight:'-10px', marginLeft:"-16px"}} style={{
fontSize: "48px",
marginRight: "-10px",
marginLeft: "-16px",
}}
/> />
} }
title={ title={
...@@ -959,11 +971,15 @@ class homePage extends Component { ...@@ -959,11 +971,15 @@ class homePage extends Component {
> >
{/* bug-11956-jmy 百分比显示不全 bug-12345-jmy 百分比后的箭头显示不出来*/} {/* bug-11956-jmy 百分比显示不全 bug-12345-jmy 百分比后的箭头显示不出来*/}
<Meta <Meta
style={{marginRight: "-10px"}} style={{ marginRight: "-10px" }}
avatar={ avatar={
<Icon <Icon
type="desktop" type="desktop"
style={{ fontSize: "48px",marginRight:'-10px', marginLeft:"-16px"}} style={{
fontSize: "48px",
marginRight: "-10px",
marginLeft: "-16px",
}}
/> />
} }
title={ title={
...@@ -1094,9 +1110,7 @@ class homePage extends Component { ...@@ -1094,9 +1110,7 @@ class homePage extends Component {
/> />
</Col> </Col>
<Col span={2}> <Col span={2}>
<div> <div></div>
</div>
<Select <Select
style={{ style={{
width: "150px", width: "150px",
......
...@@ -9,11 +9,14 @@ import { Button, Form, Input, message } from "antd"; ...@@ -9,11 +9,14 @@ import { Button, Form, Input, message } from "antd";
import style from "./Style/login.less"; import style from "./Style/login.less";
import { exfetchR, getSkinData, toAssToken } from "./redux/actions"; import { exfetchR, getSkinData, toAssToken } from "./redux/actions";
import commonFunc from "@/util/commonFunc"; import commonFunc from "@/util/commonFunc";
import SelectLang from "@/common/Layout/Header/SelectLang"; {/* bug-11961-cwj暂时注释 2期上 */ } import SelectLang from "@/common/Layout/Header/SelectLang";
import moment from 'moment' {
/* bug-11961-cwj暂时注释 2期上 */
}
import moment from "moment";
import md5 from "md5"; import md5 from "md5";
import { sm2 } from 'sm-crypto' import { sm2 } from "sm-crypto";
import intl from 'react-intl-universal'; import intl from "react-intl-universal";
const FormItem = Form.Item; const FormItem = Form.Item;
const companySiteCode = `${commonFunc.companyCode}/${commonFunc.siteCode}`; const companySiteCode = `${commonFunc.companyCode}/${commonFunc.siteCode}`;
...@@ -27,14 +30,54 @@ class Login extends React.Component { ...@@ -27,14 +30,54 @@ class Login extends React.Component {
componentDidMount() { componentDidMount() {
const { getSkinData } = this.props; const { getSkinData } = this.props;
getSkinData((res) => { getSkinData(res => {
console.log("primary-color:", res) console.log("primary-color:", res);
document.documentElement.style.setProperty('--primary-color', res.data.themeColor); document.documentElement.style.setProperty(
}) "--primary-color",
res.data.themeColor
);
});
} }
generateCharacter(n) { generateCharacter(n) {
var chars = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'] var chars = [
"0",
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9",
"A",
"B",
"C",
"D",
"E",
"F",
"G",
"H",
"I",
"J",
"K",
"L",
"M",
"N",
"O",
"P",
"Q",
"R",
"S",
"T",
"U",
"V",
"W",
"X",
"Y",
"Z",
];
var res = ""; var res = "";
for (var i = 0; i < n; i++) { for (var i = 0; i < n; i++) {
var id = Math.ceil(Math.random() * 35); var id = Math.ceil(Math.random() * 35);
...@@ -45,61 +88,67 @@ class Login extends React.Component { ...@@ -45,61 +88,67 @@ class Login extends React.Component {
} }
getCurrentDay() { getCurrentDay() {
let date = "" let date = "";
date = moment(new Date()).format("YYYYMMDD") date = moment(new Date()).format("YYYYMMDD");
return date return date;
} }
// 提交登录按钮发送给后台json // 提交登录按钮发送给后台json
handleSubmit = e => { handleSubmit = e => {
e.preventDefault(); e.preventDefault();
this.props.form.validateFields((errors, values) => { this.props.form.validateFields((errors, values) => {
if (errors) { if (errors) {
return; return;
} }
const { exfetchR, toAssToken } = this.props; const { exfetchR, toAssToken } = this.props;
const public_key = '047214fe3a249b75b6ba92ee494e0a8a68c0a19893a480b3c28bf06cd5b7d621243c7f6704caa3b43ade6be15de11cabd185611a9edfdcf1b11d7a2478c67b4c1c' const public_key =
"047214fe3a249b75b6ba92ee494e0a8a68c0a19893a480b3c28bf06cd5b7d621243c7f6704caa3b43ade6be15de11cabd185611a9edfdcf1b11d7a2478c67b4c1c";
const private_key = '00a2bbe941a177ca9f200d1c4d37e8f0b43b9cd2ea662304a05c064c6416e74d49' const private_key =
"00a2bbe941a177ca9f200d1c4d37e8f0b43b9cd2ea662304a05c064c6416e74d49";
let salt = "" let salt = "";
let date = "" let date = "";
let key = "" let key = "";
let sign = "" let sign = "";
let password = "" let password = "";
let account = "" let account = "";
salt = this.generateCharacter(16) salt = this.generateCharacter(16);
console.log("validate-salt", salt) console.log("validate-salt", salt);
date = this.getCurrentDay() date = this.getCurrentDay();
console.log("validate-date", date) console.log("validate-date", date);
password = sm2.doEncrypt(values.password + salt, public_key, 1); password = sm2.doEncrypt(values.password + salt, public_key, 1);
account = sm2.doEncrypt(values.account.trim() + salt, public_key, 1) account = sm2.doEncrypt(values.account.trim() + salt, public_key, 1);
password = "04" + password password = "04" + password;
account = "04" + account account = "04" + account;
if (salt && date) { if (salt && date) {
key = salt + date key = salt + date;
console.log("validate-key", key) console.log("validate-key", key);
} }
sign = "account=" + account + "&password=" + password + "&salt=" + salt + "&key=" + key sign =
"account=" +
console.log("validate-sign", md5(sign)) account +
"&password=" +
password +
"&salt=" +
salt +
"&key=" +
key;
console.log("validate-sign", md5(sign));
let parms = { let parms = {
account, account,
password, password,
salt: salt, salt: salt,
sign: md5(sign), sign: md5(sign),
languageCode: sessionStorage.getItem("lang") || null //用户选择的语种,否则为null languageCode: sessionStorage.getItem("lang") || null, //用户选择的语种,否则为null
} };
// let data = { // let data = {
// account: String(values.account).trim(), // account: String(values.account).trim(),
...@@ -108,7 +157,7 @@ class Login extends React.Component { ...@@ -108,7 +157,7 @@ class Login extends React.Component {
exfetchR(parms, res => { exfetchR(parms, res => {
//只有社群的话直接滚走去社群 //只有社群的话直接滚走去社群
if (res.data.isOnlyCommunity) { if (res.data.isOnlyCommunity) {
toAssToken() toAssToken();
} else { } else {
if (res.code == 1000) { if (res.code == 1000) {
console.log( console.log(
...@@ -116,22 +165,22 @@ class Login extends React.Component { ...@@ -116,22 +165,22 @@ class Login extends React.Component {
"===========重定向=========" "===========重定向========="
); );
if (location.search) { if (location.search) {
if (location.search.split("?referrer=")[1] == `/${companySiteCode}/`) { if (
location.search.split("?referrer=")[1] == `/${companySiteCode}/`
) {
this.props.history.push(`/${companySiteCode}/index/homepage`); this.props.history.push(`/${companySiteCode}/index/homepage`);
} else { } else {
this.props.history.push(location.search.split("?referrer=")[1]); this.props.history.push(location.search.split("?referrer=")[1]);
} }
} else { } else {
this.props.history.push(`/${companySiteCode}/index/homepage`); this.props.history.push(`/${companySiteCode}/index/homepage`);
} }
// this.props.history.push(`/${companySiteCode}/index/homepage`); // this.props.history.push(`/${companySiteCode}/index/homepage`);
} else { } else {
message.error(res.msg) message.error(res.msg);
} }
} }
}); });
}); });
}; };
...@@ -158,12 +207,12 @@ class Login extends React.Component { ...@@ -158,12 +207,12 @@ class Login extends React.Component {
> >
<div className={style.top}> <div className={style.top}>
<div className={style.left}> <div className={style.left}>
{companySiteCode === shenWanHongYuanCode ? null : ( {/* {companySiteCode === shenWanHongYuanCode ? null : (
<img <img
src={require("./imgages/logo1.png")} src={require("./imgages/logo1.png")}
style={{ height: "30px", width: "92px", marginRight: "13px" }} style={{ height: "30px", width: "92px", marginRight: "13px" }}
/> />
)} )} */}
企业学习平台管理后台 企业学习平台管理后台
</div> </div>
{/* 暂时注释 2期上 */} {/* 暂时注释 2期上 */}
...@@ -239,10 +288,9 @@ class Login extends React.Component { ...@@ -239,10 +288,9 @@ class Login extends React.Component {
</div> </div>
</div> </div>
<div className={style.bottom}> {/* <div className={style.bottom}>
版权所有 上海复深蓝软件股份有限公司 备案号:<a href='https://beian.miit.gov.cn' style={{color:"#666"}} target="_blank" rel="noopener">沪ICP备11042121号-5</a> 版权所有 上海复深蓝软件股份有限公司 备案号:<a href='https://beian.miit.gov.cn' style={{color:"#666"}} target="_blank" rel="noopener">沪ICP备11042121号-5</a>
</div> </div> */}
</div> </div>
); );
} }
...@@ -254,7 +302,7 @@ function mapStateToProps(state, ownProps) { ...@@ -254,7 +302,7 @@ function mapStateToProps(state, ownProps) {
function mapDispatchToProps(dispatch) { function mapDispatchToProps(dispatch) {
return { return {
exfetchR: (data, cb) => dispatch(exfetchR(data, cb)), exfetchR: (data, cb) => dispatch(exfetchR(data, cb)),
getSkinData: (cb) => dispatch(getSkinData(cb)), getSkinData: cb => dispatch(getSkinData(cb)),
toAssToken: (data, cb) => dispatch(toAssToken(data, cb)), toAssToken: (data, cb) => dispatch(toAssToken(data, cb)),
}; };
} }
......
...@@ -73,8 +73,6 @@ class Head extends React.PureComponent { ...@@ -73,8 +73,6 @@ class Head extends React.PureComponent {
collapsed, collapsed,
}); });
}); });
}; };
render() { render() {
let pathnames = getPathname(); let pathnames = getPathname();
...@@ -89,7 +87,7 @@ class Head extends React.PureComponent { ...@@ -89,7 +87,7 @@ class Head extends React.PureComponent {
companyCode, companyCode,
match, match,
history, history,
toAssToken toAssToken,
} = this.props; } = this.props;
const { collapsed } = this.state; const { collapsed } = this.state;
const { onCollapseChange } = this; const { onCollapseChange } = this;
...@@ -125,7 +123,7 @@ class Head extends React.PureComponent { ...@@ -125,7 +123,7 @@ class Head extends React.PureComponent {
username: null, username: null,
fixed: true, fixed: true,
onToAss() { onToAss() {
toAssToken() toAssToken();
}, },
onSignOut() { onSignOut() {
dispatch({ type: "app/signOut" }); dispatch({ type: "app/signOut" });
...@@ -138,7 +136,7 @@ class Head extends React.PureComponent { ...@@ -138,7 +136,7 @@ class Head extends React.PureComponent {
}, },
onMenuClick() { onMenuClick() {
cookie.remove("token", ""); cookie.remove("token", "");
sessionStorage.clear("mgtk") sessionStorage.clear("mgtk");
history.push(`${match.url}/login`); history.push(`${match.url}/login`);
}, },
}; };
...@@ -150,12 +148,22 @@ class Head extends React.PureComponent { ...@@ -150,12 +148,22 @@ class Head extends React.PureComponent {
<div <div
className={styles.container} className={styles.container}
// style={{ paddingTop: pathnames.includes("homepage")!=true ? 132 : 60 }} // style={{ paddingTop: pathnames.includes("homepage")!=true ? 132 : 60 }}
style={{ paddingTop: pathnames.includes("homepage") != true ? 64 : 64 }} style={{
paddingTop: pathnames.includes("homepage") != true ? 64 : 64,
}}
id="primaryLayout" id="primaryLayout"
> >
<Header {...headerProps} /> <Header {...headerProps} />
{/*{!pathnames.includes("homepage")&&<Breadcrumb collapsed={collapsed}/>}*/} {/*{!pathnames.includes("homepage")&&<Breadcrumb collapsed={collapsed}/>}*/}
<Content className={!pathnames.includes("homepage") ? styles.content : styles.contentnopadding}>{children}</Content > <Content
className={
!pathnames.includes("homepage")
? styles.content
: styles.contentnopadding
}
>
{children}
</Content>
{/* {footerVisible && <GlobalFooter className={styles.footer} copyright={copyright} />} liyuan */} {/* {footerVisible && <GlobalFooter className={styles.footer} copyright={copyright} />} liyuan */}
</div> </div>
...@@ -165,8 +173,6 @@ class Head extends React.PureComponent { ...@@ -165,8 +173,6 @@ class Head extends React.PureComponent {
} }
} }
function mapStateToProps(state, ownProps) { function mapStateToProps(state, ownProps) {
const { login } = state; const { login } = state;
...@@ -178,13 +184,13 @@ function mapStateToProps(state, ownProps) { ...@@ -178,13 +184,13 @@ function mapStateToProps(state, ownProps) {
let nav = {}; let nav = {};
let menuList = []; let menuList = [];
if (login.siteData && login.siteData.length > 0) { if (login.siteData && login.siteData.length > 0) {
debugger;
// 根据后台返回每个站点目录 // 根据后台返回每个站点目录
nav = login.siteData.filter(item => siteCode === item.siteCode)[0]; nav = login.siteData.filter(item => siteCode === item.siteCode)[0];
// 数据整合渲染menu // 数据整合渲染menu
nav.menus.map((item, index) => { nav.menus.map((item, index) => {
if (item.children.length > 0) { if (item.children.length > 0) {
item.node.url = '' item.node.url = "";
} }
// 一级菜单 // 一级菜单
menuList.push({ menuList.push({
...@@ -192,36 +198,34 @@ function mapStateToProps(state, ownProps) { ...@@ -192,36 +198,34 @@ function mapStateToProps(state, ownProps) {
name: item.name, name: item.name,
icon: item.node.icon, icon: item.node.icon,
// activeIcon: item.node.activeIcon, // activeIcon: item.node.activeIcon,
menuType: item.node.menuType menuType: item.node.menuType,
}); });
// //
// 二级菜单 // 二级菜单
item.children.map((chilid, childIndex) => { item.children.map((chilid, childIndex) => {
if (chilid.children.length > 0) { if (chilid.children.length > 0) {
chilid.node.url = '' chilid.node.url = "";
} }
menuList.push({ menuList.push({
id: index + 100000000 + "" + (childIndex + 1), id: index + 100000000 + "" + (childIndex + 1),
menuParentId: index + 100000 + "", menuParentId: index + 100000 + "",
name: chilid.name, name: chilid.name,
icon: "", icon: "",
url: chilid.node.url || '', url: chilid.node.url || "",
menuType: chilid.node.menuType menuType: chilid.node.menuType,
}); });
// 三级菜单 // 三级菜单
chilid.children && chilid.children.map((grandson, grandsonIndex) => { chilid.children &&
chilid.children.map((grandson, grandsonIndex) => {
menuList.push({ menuList.push({
id: index + 1 + "" + (childIndex + 1) + (grandsonIndex + 1), id: index + 1 + "" + (childIndex + 1) + (grandsonIndex + 1),
menuParentId: index + 100000000 + "" + (childIndex + 1), menuParentId: index + 100000000 + "" + (childIndex + 1),
name: grandson.name, name: grandson.name,
icon: "", icon: "",
url: grandson.node.url || '', url: grandson.node.url || "",
menuType: grandson.node.menuType menuType: grandson.node.menuType,
}); });
}); });
}); });
......
// let baseUrl = API_CONFIG.BASE_URL; // let baseUrl = API_CONFIG.BASE_URL;
const { const { IP } = require("../../build/Ip");
IP
} = require('../../build/Ip');
// let baseUrl = "http://172.16.1.208"; // let baseUrl = "http://172.16.1.208";
let baseUrl = ''; let baseUrl = "";
if (location.host.includes("localhost")) { if (location.host.includes("localhost")) {
baseUrl = IP + '/admin'; // baseUrl = IP + '/admin';
baseUrl = IP;
// baseUrl="http://dev.mg.kmelearning.com"; // baseUrl="http://dev.mg.kmelearning.com";
} }
const service = { const service = {
webManage: `${baseUrl}/web-manage/manage`, webManage: `${baseUrl}/web-manage/manage`,
webMall: `${baseUrl}/mall`, webMall: `${baseUrl}/mall`,
webLog: `${baseUrl}/cloud-logging`, webLog: `${baseUrl}/cloud-logging`,
...@@ -28,5 +27,5 @@ if (location.host.includes("localhost")) { ...@@ -28,5 +27,5 @@ if (location.host.includes("localhost")) {
pcDomen: "https://pc.kmelearning.com", pcDomen: "https://pc.kmelearning.com",
lacales: `https://cloud-wmy.oss-cn-shanghai.aliyuncs.com`, //语言包域名 lacales: `https://cloud-wmy.oss-cn-shanghai.aliyuncs.com`, //语言包域名
}; };
export default service; export default service;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment