From e2a0980e4a701a3dd07c339ff24ec4221dbed2dd Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期五, 12 三月 2021 18:05:28 +0800
Subject: [PATCH] 2021-03-12

---
 src/views/pcdesign/index.jsx |   19 +++++++++++++++----
 1 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/src/views/pcdesign/index.jsx b/src/views/pcdesign/index.jsx
index 515a08f..a6c55e8 100644
--- a/src/views/pcdesign/index.jsx
+++ b/src/views/pcdesign/index.jsx
@@ -67,6 +67,7 @@
   }
 
   UNSAFE_componentWillMount() {
+    if (this.props.memberLevel < 30) return
     try {
       let param = JSON.parse(window.decodeURIComponent(window.atob(this.props.match.params.param)))
 
@@ -110,6 +111,10 @@
   }
 
   componentDidMount () {
+    if (this.props.memberLevel < 30) {
+      document.getElementById('mk-pc-design-view').innerHTML = '<div style="text-align: center; font-size: 30px; margin-top: 40vh; height: 100vh; background: #fff;">鏈簲鐢ㄦ病鏈塒C绔〉闈㈢殑缂栬緫鏉冮檺锛岃鑱旂郴绠$悊鍛橈紒</div>'
+      return
+    }
     MKEmitter.addListener('delButtons', this.delButtons)
     MKEmitter.addListener('thawButtons', this.thawButtons)
     MKEmitter.addListener('copyButtons', this.copyButtons)
@@ -163,7 +168,11 @@
       param.MenuName = menu.MenuName
     }
 
-    this.props.history.push('/pcdesign/' + window.btoa(window.encodeURIComponent(JSON.stringify(param))))
+    param = window.btoa(window.encodeURIComponent(JSON.stringify(param)))
+
+    if (param === this.props.match.params.param) return
+
+    this.props.history.push('/pcdesign/' + param)
   }
 
   getAppMessage = () => {
@@ -1396,7 +1405,7 @@
 
     return (
       <ConfigProvider locale={localedict}>
-        <div className={'mk-pc-view '} id="mk-menu-design-view">
+        <div className={'mk-pc-view '} id="mk-pc-design-view">
           {loading ? <Spin className="view-spin" size="large" /> : null}
           <DndProvider backend={HTML5Backend}>
             <div className={'menu-setting ' + (!settingshow ? 'hidden' : '')}>
@@ -1460,8 +1469,10 @@
   }
 }
 
-const mapStateToProps = () => {
-  return {}
+const mapStateToProps = (state) => {
+  return {
+    memberLevel: state.memberLevel
+  }
 }
 
 const mapDispatchToProps = (dispatch) => {

--
Gitblit v1.8.0