| | |
| | | method: btn.method || 'post' |
| | | } |
| | | |
| | | if (btn.cross === 'true') { |
| | | if (btn.ContentType) { |
| | | _params.headers = { |
| | | 'Content-Type': btn.ContentType |
| | | } |
| | | } |
| | | |
| | | if (btn.$outerScript) { |
| | | if (JSON.stringify(param) !== '{}') { |
| | | if (btn.stringify === 'qs') { |
| | | _params.data = qs.stringify(param) |
| | | } else { |
| | | _params.data = param |
| | | } |
| | | } |
| | | } else if (btn.cross === 'true') { |
| | | if (JSON.stringify(param) !== '{}') { |
| | | if (btn.stringify === 'qs') { |
| | | _params.data = qs.stringify(param) |
| | |
| | | _params.method = 'post' |
| | | } |
| | | |
| | | if (btn.ContentType) { |
| | | _params.headers = { |
| | | 'Content-Type': btn.ContentType |
| | | } |
| | | } |
| | | |
| | | Api.directRequest(_params).then(res => { |
| | | Api.directRequest(_params, btn.$outerScript, 'outer').then(res => { |
| | | if (typeof(res) !== 'object') { |
| | | let error = '未知的返回结果!' |
| | | |
| | |
| | | tabId = btn.refreshTab[btn.refreshTab.length - 1] |
| | | } |
| | | |
| | | // if (btn.formCache === 'clear') { // 清除表单缓存 |
| | | // window.GLOB.CacheMap = new Map() |
| | | // } |
| | | |
| | | if (tabId && btn.$MenuID === tabId) { // 刷新当前菜单时,停止其他操作 |
| | | MKEmitter.emit('reloadMenuView', tabId, 'table') |
| | | MKEmitter.emit('reloadMenuView', tabId) |
| | | return |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | if (tabId) { |
| | | MKEmitter.emit('reloadMenuView', tabId, 'table') |
| | | MKEmitter.emit('reloadMenuView', tabId) |
| | | } |
| | | |
| | | if (btn.switchTab && btn.switchTab.length > 0) { |
| | |
| | | |
| | | sendWxMessage = (verify, id) => { |
| | | let domain = '' |
| | | let appId = window.GLOB.WXAppID || '' |
| | | |
| | | if (verify.wxAppId && verify.wxAppId !== appId) { |
| | | appId = verify.wxAppId |
| | | if (!window.GLOB.WXApps || window.GLOB.WXApps.findIndex(item => item.appId === verify.wxAppId) === -1) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '按钮关联公众号不在可用列表中,请重新保存按钮配置!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | } |
| | | |
| | | if (['8IFltwzyKcu15iA8fqSyb6m-pMa88a3ZTu0No3vDHgo', 'LOB-bbt9jVncGh7IOAUdESh1Sgzcbt62UwOqSqcK9ok'].includes(verify.wxTemplateId) && window.GLOB.sysType !== 'cloud') { |
| | | domain = 'https://cloud.mk9h.cn/' |
| | | appId = 'wx4d8a34c8d4494872' |
| | | } |
| | | |
| | | if (!window.GLOB.nginx && !domain) { |
| | |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } else if (!window.GLOB.WXAppID && !domain) { |
| | | } else if (!appId) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '尚未添加公众号ID,不可发送模板消息。', |
| | |
| | | return m |
| | | }) |
| | | |
| | | Api.wxAccessToken(domain).then(res => { |
| | | if (!res.oa_access_token) return |
| | | Api.wxAccessToken(appId, domain).then(res => { |
| | | if (!res.access_token) return |
| | | |
| | | params.forEach(n => { |
| | | Api.wxNginxRequest(`${domain}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.access_token}`, 'post', JSON.stringify(n)).then(re => { |
| | | if (verify.wxNoteCallback === 'true') { |
| | | let msg = re.errmsg || '' |
| | | |
| | |
| | | tabId = btn.refreshTab[btn.refreshTab.length - 1] |
| | | } |
| | | if (tabId && btn.$MenuID === tabId) { // 刷新当前菜单时,停止其他操作 |
| | | MKEmitter.emit('reloadMenuView', tabId, 'table') |
| | | MKEmitter.emit('reloadMenuView', tabId) |
| | | return |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | if (tabId) { |
| | | MKEmitter.emit('reloadMenuView', tabId, 'table') |
| | | MKEmitter.emit('reloadMenuView', tabId) |
| | | } |
| | | } |
| | | |