king
2024-06-24 3b121f2c78b187fd2e58fcad44d604798fa1eaad
src/tabviews/zshare/actionList/normalbutton/index.jsx
@@ -2552,10 +2552,22 @@
  }
  sendWxMessage = (verify, id) => {
    if (!window.GLOB.nginx) {
    let domain = ''
    if (['8IFltwzyKcu15iA8fqSyb6m-pMa88a3ZTu0No3vDHgo', 'LOB-bbt9jVncGh7IOAUdESh1Sgzcbt62UwOqSqcK9ok'].includes(verify.wxTemplateId) && window.GLOB.sysType !== 'cloud') {
      domain = 'https://cloud.mk9h.cn/'
    }
    if (!window.GLOB.nginx && !domain) {
      notification.warning({
        top: 92,
        message: 'nginx服务尚未开启,不可发送模板消息。',
        duration: 5
      })
      return
    } else if (!window.GLOB.WXAppID && !domain) {
      notification.warning({
        top: 92,
        message: '尚未添加公众号ID,不可发送模板消息。',
        duration: 5
      })
      return
@@ -2569,13 +2581,6 @@
    param.LText = Utils.getuuid()
    param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
    param.secretkey = Utils.encrypt(param.LText, param.timestamp)
    let domain1 = ''
    let domain2 = ''
    if (['8IFltwzyKcu15iA8fqSyb6m-pMa88a3ZTu0No3vDHgo', 'LOB-bbt9jVncGh7IOAUdESh1Sgzcbt62UwOqSqcK9ok'].includes(verify.wxTemplateId) && window.GLOB.sysType !== 'cloud') {
      domain1 = 'https://cloud.mk9h.cn/'
      domain2 = 'https://cloud.mk9h.cn:8443/'
    }
    Api.genericInterface(param).then(res => {
      // res.send_data = [{openid: 'o2E7gvoSFvQRG7I8_gZxf4y3ONkQ', send_id: Utils.getuuid(), p1: '010000000001', p2: '明科', p3: 'dddd', p4: '顺风', p5: '成功'}]
@@ -2639,11 +2644,11 @@
        return m
      })
      Api.wxAccessToken(domain1).then(res => {
      Api.wxAccessToken(domain).then(res => {
        if (!res.oa_access_token) return
  
        params.forEach(n => {
          Api.wxNginxRequest(`${domain2}cgi-bin/message/template/send?access_token=${res.oa_access_token}`, 'post', JSON.stringify(n)).then(re => {
          Api.wxNginxRequest(`${domain}cgi-bin/message/template/send?access_token=${res.oa_access_token}`, 'post', JSON.stringify(n)).then(re => {
            if (verify.wxNoteCallback === 'true') {
              let msg = re.errmsg || ''