From a02fc6a77fa1b35c6516b2d37108d80e260c6c85 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 07 十一月 2024 22:05:08 +0800 Subject: [PATCH] 2024-11-07 --- src/views/appcheck/index.jsx | 27 ++++++++++++++++++++++----- 1 files changed, 22 insertions(+), 5 deletions(-) diff --git a/src/views/appcheck/index.jsx b/src/views/appcheck/index.jsx index c1a2e1e..5e669d2 100644 --- a/src/views/appcheck/index.jsx +++ b/src/views/appcheck/index.jsx @@ -1,4 +1,5 @@ import React, {Component} from 'react' +import { withRouter } from 'react-router-dom' import { Spin, notification, Table, Typography, Row, Col, Tooltip } from 'antd' import { QuestionCircleOutlined } from '@ant-design/icons' @@ -26,7 +27,7 @@ bg_black_style_magenta: {name: '娲嬬孩鑹�', color: '#eb2f96'}, bg_black_style_grass_green: {name: '鑽夌豢鑹�', color: '#aeb303'}, bg_black_style_deep_red: {name: '娣辩孩鑹�', color: '#c32539'}, - bg_black_style_deep_blue: {name: '娣辩孩鑹�', color: '#1d3661'} + bg_black_style_deep_blue: {name: '娣辫摑鑹�', color: '#1d3661'} } class AppCheck extends Component { @@ -42,7 +43,17 @@ UNSAFE_componentWillMount() { document.body.className = '' - this.getAppList() + if (sessionStorage.getItem('UserID')) { + this.getAppList() + return + } + } + + componentDidMount() { + if (!sessionStorage.getItem('UserID')) { + this.props.history.replace('/login') + return + } } /** @@ -86,6 +97,8 @@ cell.logo = _param.logo || '' cell.wxAppId = _param.wxAppId || '' cell.wxAppName = _param.wxAppName || '' + cell.wxMerchId = _param.wxMerchId || '' + cell.wxMerchName = _param.wxMerchName || '' } return cell @@ -136,6 +149,8 @@ render () { const { loading, columns, applist, selectApp } = this.state + + if (!sessionStorage.getItem('UserID')) return null return ( <div className="mk-app-check"> @@ -195,8 +210,10 @@ </Col> <Col span={12}> <div className="app-item"> - {item.wxAppName ? <div className="label">鍏宠仈鍏紬鍙�:</div> : null} - {item.wxAppName ? <div className="content">{item.wxAppName}</div> : null} + {item.wxAppName || item.wxMerchName ? <> + <div className="label">鍏宠仈搴旂敤:</div> + <div className="content">{`${item.wxAppName}${item.wxAppName && item.wxMerchName ? ' / ' + item.wxMerchName : item.wxMerchName || ''}`}</div> + </> : null} </div> </Col> <Col span={12}> @@ -254,4 +271,4 @@ } } -export default AppCheck \ No newline at end of file +export default withRouter(AppCheck) \ No newline at end of file -- Gitblit v1.8.0