Commit 1d1f62dc authored by 周宏民's avatar 周宏民

fix: 修改新产品跳转可按site

parent 81b90a4e
Pipeline #86366 passed with stages
......@@ -9,7 +9,7 @@ import classNames from 'classnames';
import DataCarousel from '../DataCarousel';
import styles from './index.less';
const RightItem = props => {
const { listData, handToPage, handToProduct } = props;
const { listData, handToPage, handlePage, handToProduct } = props;
const toPage = row => {
if (row.site) {
handToProduct(row);
......
......@@ -114,10 +114,9 @@ const Demonstration = props => {
loginAction && loginAction.getUserInfoAndConfig(failCallback, true, type);
};
const updateConfig = (config, data) => {
// props.instance && props.instance.updateConfig(config);
props.updateConfig && props.updateConfig(config);
const newLoginAction = new LoginAction({ ...props, global: config });
newLoginAction && newLoginAction.getUserInfoAndConfig(failCallback, true, data.industry);
newLoginAction && newLoginAction.getUserInfoAndConfig(failCallback, true, data.industry, data.site);
};
// 新产品跳转
......@@ -452,7 +451,12 @@ const Demonstration = props => {
<VideoItem ref={videoRef} selectKey={selectKey} setSelectKey={setSelectKey} />
</div>
<div className={styles.row_r}>
<RightItem listData={productData} handToPage={handToPage} handToProduct={handToProduct} />
<RightItem
listData={productData}
handlePage={handlePage}
handToPage={handToPage}
handToProduct={handToProduct}
/>
</div>
</div>
<div className={classNames(styles.center_wrap, 'animate__fadeIn', 'animate__animated', 'duration-500ms')}>
......
/* eslint-disable no-underscore-dangle */
import 'kit_logger';
import { log, params } from '@wisdom-utils/utils/lib/helpers';
import { log, params, encipher } from '@wisdom-utils/utils/lib/helpers';
import { message } from 'antd';
import { decode, encode } from 'js-base64';
import Cookies from 'js-cookie';
import { encipher } from '@wisdom-utils/utils/lib/helpers';
import { SlideVerify } from '@wisdom-utils/components';
import { appService, noticeService } from '@/api';
import { getUserInfo, getWebSiteConfig } from '@/api/service/base';
......@@ -31,10 +30,14 @@ class Login {
this.globalConfig = getGlobalConfig();
};
//单点登录_xule_20231214
let queryString = window.location.search.substring(1);
let params = queryString.split("&");
let paramsFind = params && params.find(function (a) { return a.split('=')[0] == 'uniwater_utoken' });
// 单点登录_xule_20231214
const queryString = window.location.search.substring(1);
const params = queryString.split('&');
const paramsFind =
params &&
params.find(function(a) {
return a.split('=')[0] == 'uniwater_utoken';
});
this.uniwater_utoken = paramsFind?.split('=')[1] ?? '';
if (this.uniwater_utoken) {
......@@ -52,9 +55,9 @@ class Login {
}
}
//单点登录接口_xule_20231214
// 单点登录接口_xule_20231214
getTokenForThird() {
let self = this;
const self = this;
appService
.HDAuthLogin({
token: self.uniwater_utoken,
......@@ -64,7 +67,7 @@ class Login {
if (res.success === 'OK') {
const tk = res.token;
self.globalConfig.token = tk;
let param = {
const param = {
subOID: 'subOID',
site: this.getLocalSiteBytoken(tk),
ignoreSite: true,
......@@ -119,7 +122,7 @@ class Login {
Logger.log('获取用户配置失败');
});
}
})
});
}
gzlogin(userPhone) {
......@@ -254,7 +257,7 @@ class Login {
this.globalConfig.token = token;
const self = this;
// eslint-disable-next-line no-undef
let param = {
const param = {
subOID: 'subOID',
site: noTokenSite ?? this.getLocalSiteBytoken(token),
'request.preventCache': Date.now(),
......@@ -309,7 +312,7 @@ class Login {
? this.globalConfig.userInfo.fullName
: '',
})
.catch(error => { });
.catch(error => {});
}
if (window.location.host === 'panda-water.com') {
......@@ -323,7 +326,7 @@ class Login {
? this.globalConfig.userInfo.fullName
: '',
})
.catch(error => { });
.catch(error => {});
}
}
......@@ -431,7 +434,7 @@ class Login {
// eslint-disable-next-line no-undef
// 获取网站配置的同时,预先获取到mqtt配置,注册进子应用
// 兼容云平台子站不更新的情况
let param = {
const param = {
client: self.globalConfig.client,
'request.preventCache': Date.now(),
};
......@@ -440,10 +443,7 @@ class Login {
} else {
param.identity = token;
}
Promise.allSettled([
noticeService.getMqttSiteCode({ 'request.preventCache': Date.now() }),
getWebSiteConfig(param),
])
Promise.allSettled([noticeService.getMqttSiteCode({ 'request.preventCache': Date.now() }), getWebSiteConfig(param)])
.then(results => {
const promise = results[0];
const site = results[1];
......@@ -495,7 +495,8 @@ class Login {
mqttConfig.mqtt_mess.TcpPort = DEFAULT_TCP_PORT;
mqttConfig.mqtt_IsSSL = `${mqttConfig.mqtt_mess.TcpIP}:${mqttConfig.mqtt_mess.TcpPort}`;
}
mqttConfig.mqtt_iotIP = `${mqttConfig.mqtt_mess.TcpIP}:${mqttConfig.mqtt_mess.TcpPort ? mqttConfig.mqtt_mess.TcpPort : '443'
mqttConfig.mqtt_iotIP = `${mqttConfig.mqtt_mess.TcpIP}:${
mqttConfig.mqtt_mess.TcpPort ? mqttConfig.mqtt_mess.TcpPort : '443'
}`;
self.globalConfig = Object.assign(self.globalConfig, {
...mqttConfig,
......@@ -566,7 +567,7 @@ class Login {
self.updateConfig && self.updateConfig(self.globalConfig);
}
self.getProjectItems().then((res) => {
self.getProjectItems().then(res => {
window.subSysCfg = {};
self.globalConfig = Object.assign(self.globalConfig, {
mapsettings: res,
......@@ -755,7 +756,7 @@ class Login {
});
}
}
this.globalConfig.mapsettings.initareasettings = {... this.globalConfig.mapsettings.areasettings}
this.globalConfig.mapsettings.initareasettings = { ...this.globalConfig.mapsettings.areasettings };
if (layer.areaName) {
this.globalConfig.mapsettings.areasettings.areaName = layer.areaName;
}
......@@ -887,7 +888,7 @@ class Login {
height: '400',
});
const handleMessage = function (event) {
const handleMessage = function(event) {
const { origin } = event;
// Logger.log('origin', event.origin);
if (origin === 'https://login.dingtalk.com') {
......@@ -1005,7 +1006,7 @@ class Login {
const tk = response.token;
self.globalConfig.token = tk;
// eslint-disable-next-line no-undef,no-debugger
let param = {
const param = {
subOID: 'subOID',
site: this.getLocalSiteBytoken(tk),
ignoreSite: true,
......@@ -1080,20 +1081,25 @@ class Login {
});
}
getUserInfoAndConfig(failCallback, flag, industry) {
getUserInfoAndConfig(failCallback, flag, industry, toSite) {
const { token: tk } = this.globalConfig;
const token = tk || Cookies.get('token');
const site = Cookies.get('site');
const self = this;
/* eslint-disable */
let _industrySite = null;
if (industry) {
const userInfo =
let userInfo =
self.globalConfig.userInfo &&
self.globalConfig.userInfo.Groups &&
self.globalConfig.userInfo.Groups instanceof Array
? self.globalConfig.userInfo.Groups.find(enter => enter.industry === industry)
? self.globalConfig.userInfo.Groups.find(enter => {
if(toSite){
return enter.site === toSite
}else{
return enter.industry === industry
}
})
: null;
if (industry === '熊猫新产品' && site) {
......
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