Commit e1f44abd authored by 杨思琦's avatar 杨思琦

Merge branch 'dev' into 'master'

Dev See merge request !32
parents 12c3832a 579f0834
Pipeline #79134 waiting for manual action with stages
......@@ -42,9 +42,7 @@ const proxy = require('../../../../config/proxy');
const keywordStorage = new Storage(`__global_search_keywords__micro_${window.location.hostname}`);
const recentVisitedStorage = new Storage(`__global_recent_visited__micro_${window.location.hostname}`);
const recentProductStorage = new Storage(`__global__recent_product__micro_${window.location.hostname}`);
const currentProduct = `__global__recent_productIndex__micro_${window.location.hostname}_${params.getParams('client') ||
sessionStorage.getItem('client') ||
'city'}`;
const currentProduct = `__global__recent_productIndex__micro_${window.location.hostname}_${sessionStorage.getItem('client') || params.getParams('client') || 'city'}`;
sessionStorage.setItem(currentProduct, 0);
Cookies.set('loginMode', Cookies.get('loginMode') || 'pdw');
export const initialState = fromJS({
......@@ -102,27 +100,27 @@ const appReducer = (state = initialState, action) => {
const { homepage } = window.globalConfig;
const modulePkg = {};
window.globalConfig && window.globalConfig.products && Array.isArray(window.globalConfig.products) && window.globalConfig.products.map(item => {
modulePkg[item.PackageName] = item;
modulePkg[item.PackageName] = item;
});
config.widgets =transformWidgets(config.widgets);
config.widgets = transformWidgets(config.widgets);
// const pickMenus = memoized(() => )
const generMenu = generMainRoutes(config.widgets || [], null, 0, modulePkg);
let flatMenu = [];
if (generMenu) {
const flat = state.toJS();
const data =_.uniqBy(generFlatRoutes(generMenu || [], null, null, modulePkg), 'path');
if(_.isEqualWith(flat.flatMenu, data, (value, other) => {
if(value.path === other.path) {
const data = _.uniqBy(generFlatRoutes(generMenu || [], null, null, modulePkg), 'path');
if (_.isEqualWith(flat.flatMenu, data, (value, other) => {
if (value.path === other.path) {
return true
}
})) {
flatMenu = data
flatMenu = data
} else {
flatMenu = flat.flatMenu
}
const index = flatMenu.findIndex(item => item.name === '首页');
if(index === -1) {
if (index === -1) {
flatMenu.push({
path: `/${homepage}`,
href: `/${homepage}`,
......@@ -141,7 +139,7 @@ const appReducer = (state = initialState, action) => {
return currentPath === decodeURI(homepage);
});
let currentMenuIndex = 0;
if (home) {
......@@ -204,9 +202,10 @@ const appReducer = (state = initialState, action) => {
recentVisited: [],
});
case GET_CURRENT_INDEX:
sessionStorage.setItem(currentProduct, action.data)
const currentProductNew = `__global__recent_productIndex__micro_${window.location.hostname}_${sessionStorage.getItem('client') || window.globalConfig?.client || 'city'}`;
sessionStorage.setItem(currentProductNew, action.data)
return state.merge({
currentMenuIndex: Number(sessionStorage.getItem(currentProduct)),
currentMenuIndex: Number(sessionStorage.getItem(currentProductNew)),
});
case SLIDER_MENU_MODE:
return state.merge({
......
......@@ -227,76 +227,6 @@ const renderSite = ({ data, config, loading, setLoading, action, actionRef, setM
);
};
// const renderIntegration = (inData, loginAction, props) => {
// const [visible, setVisible] = useState(false);
// if (inData.length <= 1) {
// return <></>
// }
// let choiceOne = inData?.find(function (a) {
// return a.url?.indexOf(window?.globalConfig?.client) >= 0
// })
// //切换集成站点
// const checkIntegration = (val, loginAction, props) => {
// if (val.subType == '外链') {
// window.open(val.url, "_blank");
// } else {
// let cli = val.url?.indexOf('client=') >= 0 ? val.url.split('client=')[1] : '';
// const config = props.global;
// config.uiwidgets = [];
// config.widgets = [];
// config.allWidgets = [];
// if (cli) {
// config.client = cli;
// }
// props.instance && props.instance.updateConfig(config);
// loginAction && loginAction.getUserInfoAndConfig('', true, val.type, cli);
// // props.history.push(`/?client=${cli}`);
// // props.updateCurrentIndex(0);
// // defaultApp();
// }
// }
// return (
// <>
// <Popover
// placement="bottomLeft"
// trigger="click"
// visible={visible}
// content={
// <div className={layoutStyles.integrationList}>
// {
// inData && inData.map((val) => (
// <p onClick={() => checkIntegration(val, loginAction, props)}>{val.name}</p>
// ))
// }
// </div>
// }
// arrowPointAtCenter
// overlayClassName={classNames(layoutStyles.stationsWrapper, layoutStyles.stationsTop2)}
// onVisibleChange={visible => setVisible(visible)}
// >
// {inData.length > 1 ? (
// <div className={layoutStyles.toggleSite}>
// <img src={require('../assets/basic/site.png')} className={layoutStyles.site} />
// <span className={layoutStyles.name}>{choiceOne?.name ?? ''}</span>
// <ArrowIcon
// className={layoutStyles.arrow}
// style={{
// transform: !visible ? `rotate(0deg)` : `rotate(180deg)`,
// }}
// />
// </div>
// ) : null}
// </Popover>
// </>
// )
// }
// import defaultProps from '../defaultProps';
const pickRoutes = memoized((routes, pathname, locale) => {
const matches = matchRoutes(routes, { pathname });
......@@ -564,9 +494,39 @@ const Layout = props => {
//切换集成站点
const checkIntegration = (val, loginAction, props) => {
if (val.subType == '外链') {
window.open(val.url, "_blank");
if (val.paramValue == 'ticket') {
//获取临时token
appService.getTicketByToken({ token: window.globalConfig?.token }).then(res => {
if (res.code === 0) {
setVisible(false);
let url = val.url + (val.url.indexOf('?') > 0 ? '&' : '?') + val.paramName + '=' + res.data;
window.open(url, "_blank");
} else {
setVisible(false);
notification.error({
message: '提示',
duration: 3,
description: res.msg,
});
}
});
} else {
setVisible(false);
let url = val.url + (val.url.indexOf('?') > 0 ? '&' : '?') + val.paramName + '=' + window.globalConfig?.token;
window.open(url, "_blank");
}
} else {
let cli = val.url?.indexOf('client=') >= 0 ? val.url.split('client=')[1] : '';
Cookies.set('client', cli, {
expires: 86400000 / (24 * 60 * 60 * 1000),
path: '/',
});
sessionStorage.setItem('client', cli);
const currentProduct = `__global__recent_productIndex__micro_${window.location.hostname}_${window.globalConfig?.client ?? 'city'}`;
sessionStorage.removeItem(currentProduct);
const currentProductNew = `__global__recent_productIndex__micro_${window.location.hostname}_${cli || 'city'}`;
sessionStorage.setItem(currentProductNew, 0);
setIntegrationLoading(true);
const config = props.global;
config.uiwidgets = [];
......@@ -576,7 +536,7 @@ const Layout = props => {
config.client = cli;
}
props.instance && props.instance.updateConfig(config);
loginAction && loginAction.getUserInfoAndConfig('', true, val.type, cli);
loginAction && loginAction.getUserInfoAndConfig('', true, val.type);
// props.history.push(`/?client=${cli}`);
// props.updateCurrentIndex(0);
// defaultApp();
......
......@@ -8,6 +8,7 @@ import { useDocumentTitle } from '@ant-design/pro-utils';
import defaultSetting from '@wisdom-utils/components/lib/AppLayout/layouts/defaultSettings';
import { actionCreators } from '@/containers/App/store';
import LoginAction from '@/pages/user/login/login';
import Cookies from 'js-cookie';
import { defaultApp } from '@/micro';
import { appService } from '@/api';
import { SERVICE_INTERFACE_SUCCESS_CODE } from '@/constants';
......@@ -24,6 +25,7 @@ const Integration = props => {
const [client, setClient] = useState('');
//子站跳转
const handlePage = (item, loginAction) => {
let count = 1;
setPercentBottom(-40 + Math.ceil(Math.random() * 8 * count));
......@@ -41,9 +43,37 @@ const Integration = props => {
}, 3000);
if (item.subType == '外链') {
window.open(item.url, "_blank");
if (item.paramValue == 'ticket') {
//获取临时token
appService.getTicketByToken({ token: window.globalConfig?.token }).then(res => {
if (res.code === 0) {
let url = item.url + (item.url.indexOf('?') > 0 ? '&' : '?') + item.paramName + '=' + res.data;
window.open(url, "_blank");
} else {
notification.error({
message: '提示',
duration: 3,
description: res.msg,
});
}
});
} else {
let url = item.url + (item.url.indexOf('?') > 0 ? '&' : '?') + item.paramName + '=' + window.globalConfig?.token;
window.open(url, "_blank");
}
} else {
let cli = item.url?.indexOf('client=') >= 0 ? item.url.split('client=')[1] : '';
Cookies.set('client', cli, {
expires: 86400000 / (24 * 60 * 60 * 1000),
path: '/',
});
sessionStorage.setItem('client', cli);
const currentProduct = `__global__recent_productIndex__micro_${window.location.hostname}_${window.globalConfig?.client ?? 'city'}`;
sessionStorage.removeItem(currentProduct);
const currentProductNew = `__global__recent_productIndex__micro_${window.location.hostname}_${cli || 'city'}`;
sessionStorage.setItem(currentProductNew, 0);
setClient(cli);
setCurrentType(item.name);
......@@ -55,7 +85,7 @@ const Integration = props => {
config.client = cli
}
// props.instance && props.instance.updateConfig(config);
props.instance && props.instance.updateConfig(config);
loginAction && loginAction.getUserInfoAndConfig('', true, item.type, cli);
}
};
......
......@@ -911,19 +911,11 @@ class Login {
});
}
getUserInfoAndConfig(failCallback, flag, industry, client) {
getUserInfoAndConfig(failCallback, flag, industry) {
const { token: tk } = this.globalConfig;
const token = tk || Cookies.get('token');
const site = Cookies.get('site');
const self = this;
if (client) {
self.globalConfig.client = client;
Cookies.set('client', client, {
expires: 86400000 / (24 * 60 * 60 * 1000),
path: '/',
});
sessionStorage.setItem('client', client);
}
/* eslint-disable */
let _industrySite = null;
......
.queshanlogin {
width: 100%;
height: 100%;
background: url('./images/5.png') no-repeat;
background: url('./images/queshan_bg.png') no-repeat center center;
background-size: 100% 100%;
background-clip: border-box;
position: relative;
......@@ -16,8 +15,8 @@
width: 100%;
// height: 100%;
padding-top: 280px;
&>div {
width: 70%;
margin: 0 auto;
......@@ -36,8 +35,8 @@
// margin-bottom: 100px;
}
.title-image{
background: url('./images/3.png') no-repeat;
.title-image {
background: url('./images/queshan_3.png') no-repeat;
width: 466px;
height: 42px;
background-size: 100% 100%;
......@@ -57,20 +56,20 @@
-webkit-box-shadow: none;
box-shadow: none;
}
.inner-center {
position: relative;
width: 543px;
height: 615px;
background: rgba(255,255,255, 1);
background: rgba(255, 255, 255, 1);
// border: 1px solid #FFFFFF;
// box-shadow: 0px 15px 15px 3px rgba(140,142,145,0.52);
border-radius: 10px;
background: url(./images/6.png) no-repeat;
background: url(./images/queshan_6.png) no-repeat;
}
.welcome-title{
.welcome-title {
width: 100%;
height: 100px;
background: linear-gradient(0deg, rgba(9, 128, 238, 1) 0%, rgba(0, 182, 251, 1) 100%);
......@@ -82,13 +81,13 @@
margin-bottom: 40px;
}
.welcome-bg{
.welcome-bg {
background: url('./images/4.png') no-repeat;
width: 358px;
height: 35px;
background-size: 100% 100%;
}
.formgroup2 {
display: flex;
align-items: center;
......@@ -107,7 +106,7 @@
cursor: pointer;
position: relative;
}
.APPCtext {
font-size: 14px;
font-family: Microsoft YaHei;
......@@ -117,7 +116,7 @@
opacity: 0.75;
}
.login-header{
.login-header {
width: 100%;
position: absolute;
top: 0;
......@@ -127,26 +126,31 @@
justify-content: space-between;
align-items: center;
box-shadow: 0px 1px 3px 0px rgba(0, 73, 188, 0.24);
.left-title{
.left-title {
display: flex;
justify-content: center;
align-items: center;
.cn-title{
.cn-title {
font-size: 28px;
font-weight: 400;
color: #FFFFFF;
}
.logo-png{
.logo-png {
width: 372px;
margin-right: 20px;
}
}
.right-timebox{
.right-timebox {
display: flex;
justify-content: center;
align-items: center;
height: 60px;
.curr-time{
.curr-time {
width: 160px;
font-size: 40px;
font-family: Microsoft YaHei;
......@@ -154,15 +158,18 @@
color: #FFFFFF;
text-align: center;
}
.curr-week-date{
.curr-week-date {
margin-left: 10px;
.curr-week{
.curr-week {
font-size: 16px;
font-family: Microsoft YaHei;
font-weight: 400;
color: #FFFFFF;
}
.curr-date{
.curr-date {
font-size: 14px;
font-family: Microsoft YaHei;
font-weight: 400;
......@@ -171,7 +178,8 @@
}
}
}
.copyright{
.copyright {
position: absolute;
bottom: 50px;
width: 100%;
......@@ -185,32 +193,53 @@
justify-content: center;
align-items: center;
}
.qrcode-box{
.qrcode-box {
width: 19px;
height: 19px;
cursor: pointer;
}
.copyrightName{
.copyrightName {
font-size: 14px;
color: rgba(105,164,252,1);
color: rgba(105, 164, 252, 1);
font-weight: 500;
}
.line-tree{
.line-tree {
width: 1px;
height: 14px;
background: rgba(105,164,252,1);
background: rgba(105, 164, 252, 1);
margin: 0 10px;
}
}
:global{
.queshan{
:global {
.queshanLogin {
input:-webkit-autofill {
box-shadow: 0 0 0 1000px rgba(1,12,47,0.1) inset;
-webkit-text-fill-color: #fff;
}
input:-internal-autofill-previewed,
input:-internal-autofill-selected {
-webkit-text-fill-color: #807c7c !important;
transition: background-color 5000s ease-out 0.5s !important;
background-color: transparent !important;
}
.panda-console-base-input-password-icon.anticon {
color: #fff !important;
}
}
.queshan {
.@{ant-prefix}-input-affix-wrapper-lg {
background-color: transparent;
background-color: transparent!important;
}
.@{ant-prefix}-input-affix-wrapper {
......@@ -218,9 +247,9 @@
border-bottom: 1px solid #076aca;
}
.@{ant-prefix}-input-affix-wrapper > input.@{ant-prefix}-input {
background: transparent;
color: #FFFFFF;
.@{ant-prefix}-input-affix-wrapper>input.@{ant-prefix}-input {
background: transparent!important;
color: #FFFFFF!important;
padding-left: 20px;
}
......@@ -229,50 +258,56 @@
border-bottom: 1px solid #076aca;
}
.@{ant-prefix}-input-affix-wrapper:focus, .@{ant-prefix}-input-affix-wrapper-focused {
.@{ant-prefix}-input-affix-wrapper:focus,
.@{ant-prefix}-input-affix-wrapper-focused {
border: none;
border-bottom: 1px solid #076aca;
}
.@{ant-prefix}-input-affix-wrapper:focus, .@{ant-prefix}-input-affix-wrapper-focused {
.@{ant-prefix}-input-affix-wrapper:focus,
.@{ant-prefix}-input-affix-wrapper-focused {
box-shadow: none;
}
.@{ant-prefix}-input-affix-wrapper-status-error:not(.@{ant-prefix}-input-affix-wrapper-disabled):not(.@{ant-prefix}-input-affix-wrapper-borderless).@{ant-prefix}-input-affix-wrapper, .@{ant-prefix}-input-affix-wrapper-status-error:not(.@{ant-prefix}-input-affix-wrapper-disabled):not(.@{ant-prefix}-input-affix-wrapper-borderless).@{ant-prefix}-input-affix-wrapper:hover{
.@{ant-prefix}-input-affix-wrapper-status-error:not(.@{ant-prefix}-input-affix-wrapper-disabled):not(.@{ant-prefix}-input-affix-wrapper-borderless).@{ant-prefix}-input-affix-wrapper,
.@{ant-prefix}-input-affix-wrapper-status-error:not(.@{ant-prefix}-input-affix-wrapper-disabled):not(.@{ant-prefix}-input-affix-wrapper-borderless).@{ant-prefix}-input-affix-wrapper:hover {
background: transparent;
}
.@{ant-prefix}-input-affix-wrapper-status-error:not(.@{ant-prefix}-input-affix-wrapper-disabled):not(.@{ant-prefix}-input-affix-wrapper-borderless).@{ant-prefix}-input-affix-wrapper:focus, .@{ant-prefix}-input-affix-wrapper-status-error:not(.@{ant-prefix}-input-affix-wrapper-disabled):not(.@{ant-prefix}-input-affix-wrapper-borderless).@{ant-prefix}-input-affix-wrapper-focused {
.@{ant-prefix}-input-affix-wrapper-status-error:not(.@{ant-prefix}-input-affix-wrapper-disabled):not(.@{ant-prefix}-input-affix-wrapper-borderless).@{ant-prefix}-input-affix-wrapper:focus,
.@{ant-prefix}-input-affix-wrapper-status-error:not(.@{ant-prefix}-input-affix-wrapper-disabled):not(.@{ant-prefix}-input-affix-wrapper-borderless).@{ant-prefix}-input-affix-wrapper-focused {
box-shadow: none;
}
.@{ant-prefix}-checkbox + span {
.@{ant-prefix}-checkbox+span {
color: #FFFFFF;
}
.@{ant-prefix}src-pages-user-login-components-login-index-login .@{ant-prefix}src-pages-user-login-components-login-index-prefixIcon{
.@{ant-prefix}src-pages-user-login-components-login-index-login .@{ant-prefix}src-pages-user-login-components-login-index-prefixIcon {
color: #FFFFFF;
}
.@{ant-prefix}src-pages-user-login-components-login-index-login .@{ant-prefix}src-pages-user-login-components-login-index-submit {
border-radius: 20px;
}
}
.popover-style{
.@{ant-prefix}-popover-inner-content{
.popover-style {
.@{ant-prefix}-popover-inner-content {
display: flex;
justify-content: center;
align-items: center;
}
.@{ant-prefix}-popover-title{
.@{ant-prefix}-popover-title {
display: flex;
justify-content: center;
align-items: center;
}
}
}
@keyframes waving {
from {
......@@ -292,12 +327,4 @@
to {
left: -9999px;
}
}
}
\ No newline at end of file
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