From cc810edac6aec3c858fb352091ad8c11332447a5 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期日, 10 十二月 2023 19:12:53 +0800
Subject: [PATCH] Merge branch 'develop'

---
 src/tabviews/zshare/actionList/normalbutton/index.jsx |  167 +++++++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 154 insertions(+), 13 deletions(-)

diff --git a/src/tabviews/zshare/actionList/normalbutton/index.jsx b/src/tabviews/zshare/actionList/normalbutton/index.jsx
index d6c0450..fb4502b 100644
--- a/src/tabviews/zshare/actionList/normalbutton/index.jsx
+++ b/src/tabviews/zshare/actionList/normalbutton/index.jsx
@@ -2356,7 +2356,7 @@
     const { btn } = this.props
 
     if (!btn.verify) return
-    if (btn.verify.noteEnable !== 'true' && btn.verify.wxNote !== 'true' && btn.verify.printEnable !== 'true') return
+    if (btn.verify.noteEnable !== 'true' && btn.verify.wxNote !== 'true' && btn.verify.printEnable !== 'true' && btn.verify.emailEnable !== 'true') return
 
     let id = ''
     if (btn.output) {
@@ -2371,6 +2371,9 @@
 
     if (btn.verify.noteEnable === 'true') {
       this.sendMessage(btn.verify, id)
+    }
+    if (btn.verify.emailEnable === 'true') {
+      this.sendEmail(btn.verify, id)
     }
     if (btn.verify.wxNote === 'true') {
       if (btn.verify.wxTemplateId === 'mk_category_temp') {
@@ -2550,8 +2553,8 @@
   sendMessage = (verify, id) => {
     let param = {
       func: 's_get_sms_local',
-      TypeCharOne: verify.noteTemp, // N涓嶅悓鍐呭锛孻鐩稿悓鍐呭
-      TypeCharTwo: verify.noteType, // N瀹氭椂锛孻瀹炴椂
+      TypeCharOne: verify.noteTemp || 'Y', // N涓嶅悓鍐呭锛孻鐩稿悓鍐呭
+      TypeCharTwo: verify.noteType || 'N', // N瀹氭椂锛孻瀹炴椂
       upid: id
     }
 
@@ -2570,9 +2573,9 @@
       }
 
       let _param = {
-        templatecode: verify.noteCode, // 妯℃澘缂栫爜
-        TypeCharOne: verify.noteTemp,  // N涓嶅悓鍐呭锛孻鐩稿悓鍐呭
-        ID: verify.noteId || ''        // 妯℃澘Id锛屾殏鏃舵湭浣跨敤
+        templatecode: verify.noteCode,        // 妯℃澘缂栫爜
+        TypeCharOne: verify.noteTemp || 'Y',  // N涓嶅悓鍐呭锛孻鐩稿悓鍐呭
+        ID: verify.noteId || ''               // 妯℃澘Id锛屾殏鏃舵湭浣跨敤
       }
 
       _param.submitdate = res.submitdate
@@ -2580,17 +2583,17 @@
       let limit = 5 // 瀹炴椂鏈�澶т负5鏉★紝瀹氭椂鏈�澶т负100鏉�
       let mobMap = new Map()
 
-      if (verify.noteType === 'N') {
+      if (verify.noteType === 'Y') {
+        _param.func = 's_get_sms_sso_realtime'
+      } else {
         _param.func = 's_get_sms_sso_timer'
         limit = 100
-      } else if (verify.noteType === 'Y') {
-        _param.func = 's_get_sms_sso_realtime'
       }
 
       let Ltext = []
       let error = false
 
-      if (verify.noteTemp === 'Y') {
+      if (verify.noteTemp !== 'N') {
         _param.p1 = res.p1 || ''
         _param.p2 = res.p2 || ''
         _param.p3 = res.p3 || ''
@@ -2599,25 +2602,156 @@
 
         let _p = _param.p1 + _param.p2 + _param.p3 + _param.p4 + _param.p5
 
-        if (/\/|\.|.*鍏�.*浜.*涔�.*杩憒闈㈣瘯|閭�璇穦涓嬭浇|绾㈠寘|鎷涜仒|濂借瘎|璇勪环|鏀垮姟閫氱煡|缂磋垂|淇濋櫓|鑲$エ|閲戣瀺|鎴垮湴浜鏁欒偛|娓告垙|寰俊|Q/.test(_p)) {
+        if (/\/|.*鍏�.*浜.*涔�.*杩憒闈㈣瘯|閭�璇穦涓嬭浇|绾㈠寘|鎷涜仒|濂借瘎|璇勪环|鏀垮姟閫氱煡|缂磋垂|淇濋櫓|鑲$エ|閲戣瀺|鎴垮湴浜鏁欒偛|娓告垙|寰俊/.test(_p)) {
           error = true
         }
       }
 
       res.send_data && res.send_data.forEach(item => {
         if (item.mob && !mobMap.has(item.mob) && Ltext.length < limit) {
-          if (verify.noteTemp === 'Y') {
+          if (verify.noteTemp !== 'N') {
             Ltext.push(`'${item.mob}'`)
           } else {
             let _p = `'${item.p1 || ''}','${item.p2 || ''}','${item.p3 || ''}','${item.p4 || ''}','${item.p5 || ''}','${item.mob}'`
 
-            if (/\/|\.|.*鍏�.*浜.*涔�.*杩憒闈㈣瘯|閭�璇穦涓嬭浇|绾㈠寘|鎷涜仒|濂借瘎|璇勪环|鏀垮姟閫氱煡|缂磋垂|淇濋櫓|鑲$エ|閲戣瀺|鎴垮湴浜鏁欒偛|娓告垙|寰俊|Q/.test(_p)) {
+            if (/\/|.*鍏�.*浜.*涔�.*杩憒闈㈣瘯|閭�璇穦涓嬭浇|绾㈠寘|鎷涜仒|濂借瘎|璇勪环|鏀垮姟閫氱煡|缂磋垂|淇濋櫓|鑲$エ|閲戣瀺|鎴垮湴浜鏁欒偛|娓告垙|寰俊/.test(_p)) {
               error = true
             }
 
             Ltext.push(_p)
           }
           mobMap.set(item.mob, true)
+        }
+      })
+
+      if (error) {
+        notification.warning({
+          top: 92,
+          message: '娑堟伅涓惈鏈夐潪娉曞瓧绗�',
+          duration: 5
+        })
+        return
+      }
+
+      if (Ltext.length === 0) return
+
+      Ltext = Ltext.join(';')
+
+      _param.LText = window.btoa(window.encodeURIComponent(Ltext))
+      _param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
+      _param.secretkey = Utils.encrypt(_param.LText, _param.timestamp)
+
+      _param.rduri = 'https://sso.mk9h.cn/webapi/dostars'
+
+      _param.userid = 'bh0bapabtd45epsgra79segbch6c1ibk'
+      _param.LoginUID = 'bh0bapabtd45epsgra79segbch6c1ibk'
+
+      Api.genericInterface(_param).then(result => {
+        if (!result.status) {
+          notification.warning({
+            top: 92,
+            message: result.message,
+            duration: 5
+          })
+        }
+      }, (error) => {
+        if (error && error.ErrCode === 'LoginError') {
+          let param = {
+            func: 's_visitor_login',
+            timestamp: moment().format('YYYY-MM-DD HH:mm:ss'), 
+            SessionUid: 'bh0bapabtd45epsgra79segbch6c1ibk',
+            TypeCharOne: 'pc',
+            appkey: '202004041613277377A6A2456D34A4948AE84'
+          }
+
+          param.LText = md5(window.btoa('bh0bapabtd45epsgra79segbch6c1ibk' + param.timestamp))
+          param.secretkey = md5(param.LText + 'mingke' + param.timestamp)
+
+          let params = {
+            url: 'https://sso.mk9h.cn/webapi/dologon',
+            method: 'post',
+            data: JSON.stringify(param)
+          }
+
+          Api.directRequest(params)
+
+          return
+        }
+      })
+    })
+  }
+
+  sendEmail = (verify, id) => {
+    let param = {
+      func: 's_get_email_local',
+      TypeCharOne: verify.emailTemp || 'Y', // N涓嶅悓鍐呭锛孻鐩稿悓鍐呭
+      TypeCharTwo: verify.emailType || 'N', // N瀹氭椂锛孻瀹炴椂
+      upid: id
+    }
+
+    param.LText = Utils.formatOptions(Utils.getuuid())
+    param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
+    param.secretkey = Utils.encrypt(param.LText, param.timestamp)
+
+    Api.genericInterface(param).then(res => {
+      if (!res.status) {
+        notification.warning({
+          top: 92,
+          message: res.message,
+          duration: 5
+        })
+        return
+      }
+
+      let _param = {
+        msn_email_temp_no: verify.emailCode,   // 妯℃澘缂栫爜
+        TypeCharOne: verify.emailTemp || 'Y',  // N涓嶅悓鍐呭锛孻鐩稿悓鍐呭
+        ID: verify.emailId || ''               // 妯℃澘Id锛屾殏鏃舵湭浣跨敤
+      }
+
+      _param.submitdate = res.submitdate
+
+      let limit = 5 // 瀹炴椂鏈�澶т负5鏉★紝瀹氭椂鏈�澶т负100鏉�
+      let mobMap = new Map()
+
+      if (verify.emailType === 'Y') {
+        _param.func = 's_get_email_sso_realtime'
+      } else {
+        _param.func = 's_get_email_sso_timer'
+        limit = 100
+      }
+
+      let Ltext = []
+      let error = false
+
+      if (verify.emailTemp !== 'N') {
+        _param.p1 = res.p1 || ''
+        _param.p2 = res.p2 || ''
+        _param.p3 = res.p3 || ''
+        _param.p4 = res.p4 || ''
+        _param.p5 = res.p5 || ''
+
+        let _p = _param.p1 + _param.p2 + _param.p3 + _param.p4 + _param.p5
+
+        if (/\/|.*鍏�.*浜.*涔�.*杩憒闈㈣瘯|閭�璇穦涓嬭浇|绾㈠寘|鎷涜仒|濂借瘎|璇勪环|鏀垮姟閫氱煡|缂磋垂|淇濋櫓|鑲$エ|閲戣瀺|鎴垮湴浜鏁欒偛|娓告垙|寰俊/.test(_p)) {
+          error = true
+        }
+      }
+
+      res.send_data && res.send_data.forEach(item => {
+        if (item.email && !mobMap.has(item.email) && Ltext.length < limit) {
+          if (verify.emailTemp !== 'N') {
+            Ltext.push(`'${item.email}'`)
+          } else {
+            let _p = `'${item.p1 || ''}','${item.p2 || ''}','${item.p3 || ''}','${item.p4 || ''}','${item.p5 || ''}','${item.email}'`
+
+            if (/\/|.*鍏�.*浜.*涔�.*杩憒闈㈣瘯|閭�璇穦涓嬭浇|绾㈠寘|鎷涜仒|濂借瘎|璇勪环|鏀垮姟閫氱煡|缂磋垂|淇濋櫓|鑲$エ|閲戣瀺|鎴垮湴浜鏁欒偛|娓告垙|寰俊/.test(_p)) {
+              error = true
+            }
+
+            Ltext.push(_p)
+          }
+          mobMap.set(item.email, true)
         }
       })
 
@@ -2765,6 +2899,13 @@
       })
     } else if (res.ErrCode === 'NM') {
       message.error(res.message || '鎵ц澶辫触锛�')
+    } else if (res.ErrCode === '-2') {
+      this.setState({
+        loadingNumber: '',
+        loadingTotal: '',
+        loading: false
+      })
+      return
     }
 
     this.errorContinue(sign)

--
Gitblit v1.8.0