wuqun 2 years ago
parent
commit
3ec2cf6df5
  1. 11
      api/app/lib/controllers/patrolManage/yujingguanli.js
  2. 2
      api/app/lib/utils/push.js
  3. 3
      web/client/src/sections/patrolManage/components/xiafagaojin.js

11
api/app/lib/controllers/patrolManage/yujingguanli.js

@ -3,7 +3,7 @@ async function varfiyCode(ctx) {
try { try {
const { models } = ctx.fs.dc; const { models } = ctx.fs.dc;
const { pushBySms, pushByEmail } = ctx.app.fs.utils const { pushBySms, pushByEmail } = ctx.app.fs.utils
const { phone, type ,email} = ctx.request.body const { phone, type ,email,struction,point,number} = ctx.request.body
// 伪造的请求可能由相同的sig参数组成 // 伪造的请求可能由相同的sig参数组成
// const checkSigUsed = await models.PhoneValidateCode.findOne({ // const checkSigUsed = await models.PhoneValidateCode.findOne({
@ -29,15 +29,18 @@ async function varfiyCode(ctx) {
phone: phone, phone: phone,
templateCode: 'SMS_273640525', templateCode: 'SMS_273640525',
templateParam: { templateParam: {
code: varifyCode struction,
point,
number
}, },
}) })
} }
if(type.includes(2)){ if(type.includes(2)){
await pushByEmail({ await pushByEmail({
email: email, email: email,
title: '测试', title: '隧道智慧运维助手',
text:'你知道吗' text: `
您好${struction}中${point}点位故障问题已重复累积发生${number}存在一定风险可能原因是设备老化或其他隐患问题导致售后工程师正在排查`
}) })
} }

2
api/app/lib/utils/push.js

@ -16,7 +16,7 @@ module.exports = function (app, opts) {
}); });
const SendSmsRes = await client.request('SendSms', { const SendSmsRes = await client.request('SendSms', {
"PhoneNumbers": phone.join(','),//接收短信的手机号码。 "PhoneNumbers": phone.join(','),//接收短信的手机号码。
"SignName": "飞尚尚视",//短信签名名称。必须是已添加、并通过审核的短信签名。 "SignName": "隧道智慧运维助手",//短信签名名称。必须是已添加、并通过审核的短信签名。
"TemplateCode": templateCode,//短信模板ID。必须是已添加、并通过审核的短信签名;且发送国际/港澳台消息时,请使用国际/港澳台短信模版。 "TemplateCode": templateCode,//短信模板ID。必须是已添加、并通过审核的短信签名;且发送国际/港澳台消息时,请使用国际/港澳台短信模版。
"TemplateParam": JSON.stringify(templateParam)//短信模板变量对应的实际值,JSON格式。 "TemplateParam": JSON.stringify(templateParam)//短信模板变量对应的实际值,JSON格式。
}, { }, {

3
web/client/src/sections/patrolManage/components/xiafagaojin.js

@ -34,7 +34,8 @@ const PlanModal = ({ visible, onCancel, dispatch, type, curRecord, tableRef, che
console.log('user,',userlist) console.log('user,',userlist)
let usedata = userlist.filter(i=>i?.username===values.name) let usedata = userlist.filter(i=>i?.username===values.name)
console.log(usedata,'usedata') console.log(usedata,'usedata')
dispatch(putxinxi({phone:[params.name],email:[usedata[0]?.email],type:params.type})).then(res=>{ dispatch(putxinxi({phone:[params.name],email:[usedata[0]?.email],type:params.type,struction:curRecord?.points?.project?.name
,point:curRecord?.points?.itemData?.name,number:curRecord?.patrolRecordIssueHandles[0]?.yanshoucishu})).then(res=>{
console.log(res,'res') console.log(res,'res')
}).then(()=>{ }).then(()=>{
dispatch(modifyPatrolRecordIssueHandle(curRecord?.patrolRecordIssueHandles[0]?.id,{ dispatch(modifyPatrolRecordIssueHandle(curRecord?.patrolRecordIssueHandles[0]?.id,{

Loading…
Cancel
Save