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:
for (var i in ifaces) {
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}}}}
\ No newline at end of file
{"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
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 {
/>
</span>
<Card
style={{ width: "100%", backgroundColor: "#ffffff"}}
style={{ width: "100%", backgroundColor: "#ffffff" }}
bordered={false}
>
{/* bug-11956-jmy 百分比显示不全 bug-12345-jmy 百分比后的箭头显示不出来*/}
<Meta
style={{marginRight: "-10px"}}
style={{ marginRight: "-10px" }}
avatar={
<Icon
type="user"
style={{ fontSize: "48px",marginRight:'-10px', marginLeft:"-16px"}}
style={{
fontSize: "48px",
marginRight: "-10px",
marginLeft: "-16px",
}}
/>
}
title={
......@@ -799,11 +803,15 @@ class homePage extends Component {
>
{/* bug-11956-jmy 百分比显示不全 bug-12345-jmy 百分比后的箭头显示不出来*/}
<Meta
style={{marginRight: "-10px"}}
style={{ marginRight: "-10px" }}
avatar={
<Icon
type="calendar"
style={{ fontSize: "48px",marginRight:'-10px', marginLeft:"-16px"}}
style={{
fontSize: "48px",
marginRight: "-10px",
marginLeft: "-16px",
}}
/>
}
title={
......@@ -880,11 +888,15 @@ class homePage extends Component {
>
{/* bug-11956-jmy 百分比显示不全 bug-12345-jmy 百分比后的箭头显示不出来*/}
<Meta
style={{marginRight: "-10px"}}
style={{ marginRight: "-10px" }}
avatar={
<Icon
type="play-square"
style={{ fontSize: "48px",marginRight:'-10px', marginLeft:"-16px"}}
style={{
fontSize: "48px",
marginRight: "-10px",
marginLeft: "-16px",
}}
/>
}
title={
......@@ -959,11 +971,15 @@ class homePage extends Component {
>
{/* bug-11956-jmy 百分比显示不全 bug-12345-jmy 百分比后的箭头显示不出来*/}
<Meta
style={{marginRight: "-10px"}}
style={{ marginRight: "-10px" }}
avatar={
<Icon
type="desktop"
style={{ fontSize: "48px",marginRight:'-10px', marginLeft:"-16px"}}
style={{
fontSize: "48px",
marginRight: "-10px",
marginLeft: "-16px",
}}
/>
}
title={
......@@ -1094,9 +1110,7 @@ class homePage extends Component {
/>
</Col>
<Col span={2}>
<div>
</div>
<div></div>
<Select
style={{
width: "150px",
......
......@@ -9,11 +9,14 @@ import { Button, Form, Input, message } from "antd";
import style from "./Style/login.less";
import { exfetchR, getSkinData, toAssToken } from "./redux/actions";
import commonFunc from "@/util/commonFunc";
import SelectLang from "@/common/Layout/Header/SelectLang"; {/* bug-11961-cwj暂时注释 2期上 */ }
import moment from 'moment'
import SelectLang from "@/common/Layout/Header/SelectLang";
{
/* bug-11961-cwj暂时注释 2期上 */
}
import moment from "moment";
import md5 from "md5";
import { sm2 } from 'sm-crypto'
import intl from 'react-intl-universal';
import { sm2 } from "sm-crypto";
import intl from "react-intl-universal";
const FormItem = Form.Item;
const companySiteCode = `${commonFunc.companyCode}/${commonFunc.siteCode}`;
......@@ -27,14 +30,54 @@ class Login extends React.Component {
componentDidMount() {
const { getSkinData } = this.props;
getSkinData((res) => {
console.log("primary-color:", res)
document.documentElement.style.setProperty('--primary-color', res.data.themeColor);
})
getSkinData(res => {
console.log("primary-color:", res);
document.documentElement.style.setProperty(
"--primary-color",
res.data.themeColor
);
});
}
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 = "";
for (var i = 0; i < n; i++) {
var id = Math.ceil(Math.random() * 35);
......@@ -45,61 +88,67 @@ class Login extends React.Component {
}
getCurrentDay() {
let date = ""
date = moment(new Date()).format("YYYYMMDD")
return date
let date = "";
date = moment(new Date()).format("YYYYMMDD");
return date;
}
// 提交登录按钮发送给后台json
handleSubmit = e => {
e.preventDefault();
this.props.form.validateFields((errors, values) => {
if (errors) {
return;
}
const { exfetchR, toAssToken } = this.props;
const public_key = '047214fe3a249b75b6ba92ee494e0a8a68c0a19893a480b3c28bf06cd5b7d621243c7f6704caa3b43ade6be15de11cabd185611a9edfdcf1b11d7a2478c67b4c1c'
const public_key =
"047214fe3a249b75b6ba92ee494e0a8a68c0a19893a480b3c28bf06cd5b7d621243c7f6704caa3b43ade6be15de11cabd185611a9edfdcf1b11d7a2478c67b4c1c";
const private_key = '00a2bbe941a177ca9f200d1c4d37e8f0b43b9cd2ea662304a05c064c6416e74d49'
const private_key =
"00a2bbe941a177ca9f200d1c4d37e8f0b43b9cd2ea662304a05c064c6416e74d49";
let salt = ""
let date = ""
let key = ""
let sign = ""
let password = ""
let account = ""
let salt = "";
let date = "";
let key = "";
let sign = "";
let password = "";
let account = "";
salt = this.generateCharacter(16)
console.log("validate-salt", salt)
date = this.getCurrentDay()
console.log("validate-date", date)
salt = this.generateCharacter(16);
console.log("validate-salt", salt);
date = this.getCurrentDay();
console.log("validate-date", date);
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
account = "04" + account
password = "04" + password;
account = "04" + account;
if (salt && date) {
key = salt + date
console.log("validate-key", key)
key = salt + date;
console.log("validate-key", key);
}
sign = "account=" + account + "&password=" + password + "&salt=" + salt + "&key=" + key
console.log("validate-sign", md5(sign))
sign =
"account=" +
account +
"&password=" +
password +
"&salt=" +
salt +
"&key=" +
key;
console.log("validate-sign", md5(sign));
let parms = {
account,
password,
salt: salt,
sign: md5(sign),
languageCode: sessionStorage.getItem("lang") || null //用户选择的语种,否则为null
}
languageCode: sessionStorage.getItem("lang") || null, //用户选择的语种,否则为null
};
// let data = {
// account: String(values.account).trim(),
......@@ -108,7 +157,7 @@ class Login extends React.Component {
exfetchR(parms, res => {
//只有社群的话直接滚走去社群
if (res.data.isOnlyCommunity) {
toAssToken()
toAssToken();
} else {
if (res.code == 1000) {
console.log(
......@@ -116,22 +165,22 @@ class Login extends React.Component {
"===========重定向========="
);
if (location.search) {
if (location.search.split("?referrer=")[1] == `/${companySiteCode}/`) {
if (
location.search.split("?referrer=")[1] == `/${companySiteCode}/`
) {
this.props.history.push(`/${companySiteCode}/index/homepage`);
} else {
this.props.history.push(location.search.split("?referrer=")[1]);
}
} else {
this.props.history.push(`/${companySiteCode}/index/homepage`);
}
// this.props.history.push(`/${companySiteCode}/index/homepage`);
} else {
message.error(res.msg)
message.error(res.msg);
}
}
});
});
};
......@@ -158,12 +207,12 @@ class Login extends React.Component {
>
<div className={style.top}>
<div className={style.left}>
{companySiteCode === shenWanHongYuanCode ? null : (
{/* {companySiteCode === shenWanHongYuanCode ? null : (
<img
src={require("./imgages/logo1.png")}
style={{ height: "30px", width: "92px", marginRight: "13px" }}
/>
)}
)} */}
企业学习平台管理后台
</div>
{/* 暂时注释 2期上 */}
......@@ -239,10 +288,9 @@ class Login extends React.Component {
</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>
</div>
</div> */}
</div>
);
}
......@@ -254,7 +302,7 @@ function mapStateToProps(state, ownProps) {
function mapDispatchToProps(dispatch) {
return {
exfetchR: (data, cb) => dispatch(exfetchR(data, cb)),
getSkinData: (cb) => dispatch(getSkinData(cb)),
getSkinData: cb => dispatch(getSkinData(cb)),
toAssToken: (data, cb) => dispatch(toAssToken(data, cb)),
};
}
......
......@@ -73,8 +73,6 @@ class Head extends React.PureComponent {
collapsed,
});
});
};
render() {
let pathnames = getPathname();
......@@ -89,7 +87,7 @@ class Head extends React.PureComponent {
companyCode,
match,
history,
toAssToken
toAssToken,
} = this.props;
const { collapsed } = this.state;
const { onCollapseChange } = this;
......@@ -125,7 +123,7 @@ class Head extends React.PureComponent {
username: null,
fixed: true,
onToAss() {
toAssToken()
toAssToken();
},
onSignOut() {
dispatch({ type: "app/signOut" });
......@@ -138,7 +136,7 @@ class Head extends React.PureComponent {
},
onMenuClick() {
cookie.remove("token", "");
sessionStorage.clear("mgtk")
sessionStorage.clear("mgtk");
history.push(`${match.url}/login`);
},
};
......@@ -150,12 +148,22 @@ class Head extends React.PureComponent {
<div
className={styles.container}
// 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"
>
<Header {...headerProps} />
{/*{!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 */}
</div>
......@@ -165,8 +173,6 @@ class Head extends React.PureComponent {
}
}
function mapStateToProps(state, ownProps) {
const { login } = state;
......@@ -178,13 +184,13 @@ function mapStateToProps(state, ownProps) {
let nav = {};
let menuList = [];
if (login.siteData && login.siteData.length > 0) {
debugger;
// 根据后台返回每个站点目录
nav = login.siteData.filter(item => siteCode === item.siteCode)[0];
// 数据整合渲染menu
nav.menus.map((item, index) => {
if (item.children.length > 0) {
item.node.url = ''
item.node.url = "";
}
// 一级菜单
menuList.push({
......@@ -192,36 +198,34 @@ function mapStateToProps(state, ownProps) {
name: item.name,
icon: item.node.icon,
// activeIcon: item.node.activeIcon,
menuType: item.node.menuType
menuType: item.node.menuType,
});
//
// 二级菜单
item.children.map((chilid, childIndex) => {
if (chilid.children.length > 0) {
chilid.node.url = ''
chilid.node.url = "";
}
menuList.push({
id: index + 100000000 + "" + (childIndex + 1),
menuParentId: index + 100000 + "",
name: chilid.name,
icon: "",
url: chilid.node.url || '',
menuType: chilid.node.menuType
url: chilid.node.url || "",
menuType: chilid.node.menuType,
});
// 三级菜单
chilid.children && chilid.children.map((grandson, grandsonIndex) => {
chilid.children &&
chilid.children.map((grandson, grandsonIndex) => {
menuList.push({
id: index + 1 + "" + (childIndex + 1) + (grandsonIndex + 1),
menuParentId: index + 100000000 + "" + (childIndex + 1),
name: grandson.name,
icon: "",
url: grandson.node.url || '',
menuType: grandson.node.menuType
url: grandson.node.url || "",
menuType: grandson.node.menuType,
});
});
});
......
// let baseUrl = API_CONFIG.BASE_URL;
const {
IP
} = require('../../build/Ip');
const { IP } = require("../../build/Ip");
// let baseUrl = "http://172.16.1.208";
let baseUrl = '';
let baseUrl = "";
if (location.host.includes("localhost")) {
baseUrl = IP + '/admin';
// baseUrl = IP + '/admin';
baseUrl = IP;
// baseUrl="http://dev.mg.kmelearning.com";
}
}
const service = {
const service = {
webManage: `${baseUrl}/web-manage/manage`,
webMall: `${baseUrl}/mall`,
webLog: `${baseUrl}/cloud-logging`,
......@@ -28,5 +27,5 @@ if (location.host.includes("localhost")) {
pcDomen: "https://pc.kmelearning.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