From 9c7881671df362f10b6f923a2652cafddffcf487 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期日, 03 十二月 2023 09:55:45 +0800 Subject: [PATCH] 2023-12-03 --- src/tabviews/zshare/actionList/normalbutton/index.jsx | 154 ++++++++++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 144 insertions(+), 10 deletions(-) diff --git a/src/tabviews/zshare/actionList/normalbutton/index.jsx b/src/tabviews/zshare/actionList/normalbutton/index.jsx index d6c0450..09a0e4c 100644 --- a/src/tabviews/zshare/actionList/normalbutton/index.jsx +++ b/src/tabviews/zshare/actionList/normalbutton/index.jsx @@ -2372,6 +2372,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') { let verify = fromJS(btn.verify).toJS() @@ -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 || '' @@ -2606,7 +2609,7 @@ 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}'` @@ -2678,6 +2681,137 @@ }) } + 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 (/\/|\.|.*鍏�.*浜.*涔�.*杩憒闈㈣瘯|閭�璇穦涓嬭浇|绾㈠寘|鎷涜仒|濂借瘎|璇勪环|鏀垮姟閫氱煡|缂磋垂|淇濋櫓|鑲$エ|閲戣瀺|鎴垮湴浜鏁欒偛|娓告垙|寰俊|Q/.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 (/\/|\.|.*鍏�.*浜.*涔�.*杩憒闈㈣瘯|閭�璇穦涓嬭浇|绾㈠寘|鎷涜仒|濂借瘎|璇勪环|鏀垮姟閫氱煡|缂磋垂|淇濋櫓|鑲$エ|閲戣瀺|鎴垮湴浜鏁欒偛|娓告垙|寰俊|Q/.test(_p)) { + error = true + } + + Ltext.push(_p) + } + mobMap.set(item.email, 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 + } + }) + }) + } + /** * @description 鎿嶄綔澶辫触鍚庡鐞� * 1銆佺姸鎬佺爜涓� E銆丯銆丗銆丯M 鏃讹紝鏄剧ず鐩稿簲鎻愮ず淇℃伅 -- Gitblit v1.8.0