From 4b467effbc0e3a9199146573c0ceedf404bd07c5 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 07 九月 2023 17:16:01 +0800
Subject: [PATCH] 2023-09-07

---
 src/menu/components/share/sourcecomponent/index.jsx |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/menu/components/share/sourcecomponent/index.jsx b/src/menu/components/share/sourcecomponent/index.jsx
index e6657c0..bf42033 100644
--- a/src/menu/components/share/sourcecomponent/index.jsx
+++ b/src/menu/components/share/sourcecomponent/index.jsx
@@ -20,11 +20,13 @@
   }
 
   UNSAFE_componentWillMount () {
-    const { value } = this.props
+    const { value, initialValue } = this.props
     let val = ''
 
     if (value) {
       val = value
+    } else if (initialValue) {
+      val = initialValue
     } else if (this.props['data-__meta']) {
       val = this.props['data-__meta'].initialValue || ''
     }
@@ -35,7 +37,7 @@
   }
 
   shouldComponentUpdate (nextProps, nextState) {
-    return !is(fromJS(this.state), fromJS(nextState))
+    return !is(fromJS(this.state), fromJS(nextState)) || nextProps.type !== this.props.type
   }
 
   deleteUrl = () => {
@@ -76,7 +78,7 @@
           <DeleteOutlined title="鍒犻櫎鏂囦欢" onClick={this.deleteUrl}/>
         </div> : null}
         {url && type !== 'video' && url !== '@icon@' ? <div className="mk-source-item-info picture">
-          <img src={url} alt="" />
+          <img src={url.replace(/@mywebsite@\//ig, window.GLOB.baseurl)} alt="" />
           <a target="_blank" rel="noopener noreferrer" href={url}>{name}</a>
           <DeleteOutlined title="鍒犻櫎鏂囦欢" onClick={this.deleteUrl}/>
         </div> : null}

--
Gitblit v1.8.0