|
|
@ -16,39 +16,39 @@ |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- <el-form-item v-if="captcha.captcha_image" style="height: 40px" >--> |
|
|
|
<el-form-item v-if="captcha.captcha_image" style="height: 40px"> |
|
|
|
<!-- <el-row style="height: 40px">--> |
|
|
|
<el-row style="height: 40px"> |
|
|
|
<!-- <el-col :span="16">--> |
|
|
|
<el-col :span="16"> |
|
|
|
<!-- <el-input v-model="addreceiverinfo.verify_code" clearable maxlength="6"--> |
|
|
|
<el-input v-model="addreceiverinfo.verify_code" clearable maxlength="6" |
|
|
|
<!-- placeholder="请输入验证码" @keyup.enter.native="onSubmit"/>--> |
|
|
|
placeholder="请输入验证码" @keyup.enter.native="onSubmit"/> |
|
|
|
<!-- </el-col>--> |
|
|
|
</el-col> |
|
|
|
<!-- <el-col :span="8">--> |
|
|
|
<el-col :span="8"> |
|
|
|
<!-- <el-image--> |
|
|
|
<el-image |
|
|
|
<!-- :src="captcha.captcha_image"--> |
|
|
|
:src="captcha.captcha_image" |
|
|
|
<!-- fit="contain"--> |
|
|
|
fit="contain" |
|
|
|
<!-- style="margin:0 4px;border-radius:4px;cursor:pointer;height: 40px" @click="get_auth_code">--> |
|
|
|
style="margin:0 4px;border-radius:4px;cursor:pointer;height: 40px" @click="get_auth_code"> |
|
|
|
<!-- </el-image>--> |
|
|
|
</el-image> |
|
|
|
<!-- </el-col>--> |
|
|
|
</el-col> |
|
|
|
<!-- </el-row>--> |
|
|
|
</el-row> |
|
|
|
<!-- </el-form-item>--> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
|
|
|
|
<!-- <el-form-item>--> |
|
|
|
<el-form-item> |
|
|
|
<!-- <el-row>--> |
|
|
|
<el-row> |
|
|
|
<!-- <el-col :span="16">--> |
|
|
|
<el-col :span="16"> |
|
|
|
<!-- <el-input v-model="addreceiverinfo.seicode" clearable--> |
|
|
|
<el-input v-model="addreceiverinfo.seicode" clearable |
|
|
|
<!-- placeholder="邮箱验证码" prefix-icon="el-icon-mobile"/>--> |
|
|
|
placeholder="邮箱验证码" prefix-icon="el-icon-mobile"/> |
|
|
|
<!-- </el-col>--> |
|
|
|
</el-col> |
|
|
|
<!-- <el-col :span="8">--> |
|
|
|
<el-col :span="8"> |
|
|
|
<!-- <el-button plain style="margin:0 4px;border-radius:4px;cursor:pointer;height: 40px" type="info"--> |
|
|
|
<el-button plain style="margin:0 4px;border-radius:4px;cursor:pointer;height: 40px" type="info" |
|
|
|
<!-- @click="onGetCode">获取验证码--> |
|
|
|
@click="onGetCode">获取验证码 |
|
|
|
<!-- </el-button>--> |
|
|
|
</el-button> |
|
|
|
<!-- </el-col>--> |
|
|
|
</el-col> |
|
|
|
<!-- </el-row>--> |
|
|
|
</el-row> |
|
|
|
<!-- </el-form-item>--> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
|
|
|
|
<!-- <el-form-item>--> |
|
|
|
<el-form-item> |
|
|
|
<!-- <div id="captcha" ref="captcha"></div>--> |
|
|
|
<div id="captcha" ref="captcha"></div> |
|
|
|
<!-- </el-form-item>--> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-form-item label="微信"> |
|
|
|
<el-form-item label="微信"> |
|
|
@ -341,9 +341,9 @@ |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
<script> |
|
|
|
import {notifyConfigInfo, notifyReceiverInfo, wxBindFun, wxLoginFun} from "@/restful"; |
|
|
|
import {notifyConfigInfo, NotifyInfoFun, notifyReceiverInfo, wxBindFun, wxLoginFun} from "@/restful"; |
|
|
|
import {getUserInfoFun} from "@/utils"; |
|
|
|
import {geetest, getUserInfoFun} from "@/utils"; |
|
|
|
import {getRandomStr} from "@/utils/base/utils"; |
|
|
|
import {checkEmail, checkphone, getRandomStr} from "@/utils/base/utils"; |
|
|
|
|
|
|
|
|
|
|
|
export default { |
|
|
|
export default { |
|
|
|
name: "FirUserNotify", |
|
|
|
name: "FirUserNotify", |
|
|
@ -351,11 +351,12 @@ export default { |
|
|
|
return { |
|
|
|
return { |
|
|
|
dialogReceiverVisible: false, |
|
|
|
dialogReceiverVisible: false, |
|
|
|
captcha: {"captcha_image": '', "captcha_key": '', "length": 8}, |
|
|
|
captcha: {"captcha_image": '', "captcha_key": '', "length": 8}, |
|
|
|
|
|
|
|
change_type: {email: false, sms: false}, |
|
|
|
wx_visible: false, |
|
|
|
wx_visible: false, |
|
|
|
wx_login_qr_url: '', |
|
|
|
wx_login_qr_url: '', |
|
|
|
unique_key: '', |
|
|
|
unique_key: '', |
|
|
|
userinfo: {}, |
|
|
|
userinfo: {}, |
|
|
|
addreceiverinfo: {description: '', wxopenid: '', email: '', receiver_name: ''}, |
|
|
|
addreceiverinfo: {description: '', wxopenid: '', email: '', receiver_name: '', verify_code: '', seicode: ''}, |
|
|
|
message_type_choices: [], |
|
|
|
message_type_choices: [], |
|
|
|
activeConfig: [], |
|
|
|
activeConfig: [], |
|
|
|
dialogChangeReceiverVisible: false, |
|
|
|
dialogChangeReceiverVisible: false, |
|
|
@ -369,10 +370,98 @@ export default { |
|
|
|
threshold: {} |
|
|
|
threshold: {} |
|
|
|
} |
|
|
|
} |
|
|
|
}, methods: { |
|
|
|
}, methods: { |
|
|
|
|
|
|
|
onGetCode() { |
|
|
|
|
|
|
|
this.addreceiverinfo.auth_token = ''; |
|
|
|
|
|
|
|
this.addreceiverinfo.seicode = ''; |
|
|
|
|
|
|
|
this.onSubmit(); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
onSubmit() { |
|
|
|
|
|
|
|
let email = this.addreceiverinfo.email; |
|
|
|
|
|
|
|
let verify_code = this.addreceiverinfo.verify_code; |
|
|
|
|
|
|
|
let captcha_flag = this.addreceiverinfo.verify_code.length === this.captcha.length; |
|
|
|
|
|
|
|
if (this.captcha.captcha_key === '' || !this.captcha.captcha_key) { |
|
|
|
|
|
|
|
captcha_flag = true |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (captcha_flag) { |
|
|
|
|
|
|
|
let checke = checkEmail(this.addreceiverinfo.email); |
|
|
|
|
|
|
|
let checkp = checkphone(this.addreceiverinfo.email); |
|
|
|
|
|
|
|
if (checke || checkp) { |
|
|
|
|
|
|
|
let params = { |
|
|
|
|
|
|
|
"target": email, |
|
|
|
|
|
|
|
"verify_code": verify_code, |
|
|
|
|
|
|
|
"captcha_key": this.captcha.captcha_key, |
|
|
|
|
|
|
|
"n_type": 'notify', |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
let seicode = this.addreceiverinfo.seicode; |
|
|
|
|
|
|
|
let auth_token = this.addreceiverinfo.auth_token; |
|
|
|
|
|
|
|
if (seicode && seicode.length > 3) { |
|
|
|
|
|
|
|
params['seicode'] = seicode |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (auth_token && auth_token.length > 3) { |
|
|
|
|
|
|
|
params['auth_token'] = auth_token |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (this.auth_rules.geetest) { |
|
|
|
|
|
|
|
geetest(this, this.addreceiverinfo.email, params, (n_params) => { |
|
|
|
|
|
|
|
this.do_notify_sender(n_params) |
|
|
|
|
|
|
|
}, NotifyInfoFun) |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.do_notify_sender(params) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.$message({ |
|
|
|
|
|
|
|
message: '邮箱或手机号输入有误', |
|
|
|
|
|
|
|
type: 'error' |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.$message({ |
|
|
|
|
|
|
|
message: '验证码有误', |
|
|
|
|
|
|
|
type: 'warning' |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
do_notify_sender(params) { |
|
|
|
|
|
|
|
NotifyInfoFun(data => { |
|
|
|
|
|
|
|
if (data.code === 1000) { |
|
|
|
|
|
|
|
this.$message.success("验证码发送成功") |
|
|
|
|
|
|
|
this.addreceiverinfo.auth_token = data.data.auth_token; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.$message.error(data.msg) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, { |
|
|
|
|
|
|
|
'methods': 'POST', |
|
|
|
|
|
|
|
'data': params |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
get_auth_code() { |
|
|
|
|
|
|
|
NotifyInfoFun(data => { |
|
|
|
|
|
|
|
if (data.code === 1000) { |
|
|
|
|
|
|
|
this.auth_rules = data.data.auth_rules; |
|
|
|
|
|
|
|
this.captcha = this.auth_rules.captcha; |
|
|
|
|
|
|
|
this.change_type = data.data.change_type; |
|
|
|
|
|
|
|
this.addreceiverinfo.captcha_key = this.captcha.captcha_key; |
|
|
|
|
|
|
|
if (this.addreceiverinfo.verify_code) { |
|
|
|
|
|
|
|
this.addreceiverinfo.verify_code = ''; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.$message({ |
|
|
|
|
|
|
|
message: data.msg, |
|
|
|
|
|
|
|
type: 'error' |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, { |
|
|
|
|
|
|
|
"methods": "GET", |
|
|
|
|
|
|
|
"data": {} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
addRecevier() { |
|
|
|
addRecevier() { |
|
|
|
this.addreceiverinfo = {description: '', wxopenid: '', email: '', receiver_name: ''} |
|
|
|
this.addreceiverinfo = {description: '', wxopenid: '', email: '', receiver_name: '', verify_code: '', seicode: ''} |
|
|
|
this.dialogReceiverVisible = true |
|
|
|
this.dialogReceiverVisible = true |
|
|
|
this.title = '新增消息接收人' |
|
|
|
this.title = '新增消息接收人' |
|
|
|
|
|
|
|
this.get_auth_code() |
|
|
|
}, |
|
|
|
}, |
|
|
|
editReceiver(receiver) { |
|
|
|
editReceiver(receiver) { |
|
|
|
this.title = '编辑 ' + receiver.receiver_name + ' 消息接收人' |
|
|
|
this.title = '编辑 ' + receiver.receiver_name + ' 消息接收人' |
|
|
@ -442,7 +531,7 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
cancelReceiver() { |
|
|
|
cancelReceiver() { |
|
|
|
this.dialogReceiverVisible = false; |
|
|
|
this.dialogReceiverVisible = false; |
|
|
|
this.addreceiverinfo = {description: '', wxopenid: '', email: '', receiver_name: ''} |
|
|
|
this.addreceiverinfo = {description: '', wxopenid: '', email: '', receiver_name: '', verify_code: '', seicode: ''} |
|
|
|
}, |
|
|
|
}, |
|
|
|
saveReceiver() { |
|
|
|
saveReceiver() { |
|
|
|
notifyReceiverInfo(data => { |
|
|
|
notifyReceiverInfo(data => { |
|
|
|