1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?xml version="1.0" encoding="UTF-8"?>
<a:service xmlns:ns1="leaf.application.action" xmlns:p="uncertain.proc" xmlns:a="http://www.leaf-framework.org/application" xmlns:s="leaf.plugin.script" trace="true">
<a:init-procedure>
<s:server-script import="app/app_login_check.js"><![CDATA[
importPackage(Packages.com.hand.hls.hlcm.emay);
function send_sms() {
try {
if($ctx.parameter.mobile) {
// step2 生成短信
var verify_code_sms_bm = $bm('wx.WX100.wx_verify_code_sms');
verify_code_sms_bm.insert({
phone_number: $ctx.parameter.mobile
});
var sms_list_bm = $bm('sys.SYS401.sys_sms_list');
var md5_check_id = $ctx.parameter.md5_check_id;
if ($ctx.parameter.sms_id) {
var sms_list_result = sms_list_bm.queryAsMap({
sms_id: $ctx.parameter.sms_id
});
var sms_list_records = sms_list_result.getChildren();
for (var i = 0; i < sms_list_records.length; i++) {
var Phones = sms_list_records[i].phone_number;
var content = sms_list_records[i].text;
var sms_id = sms_list_records[i].sms_id;
try {
var example = new Example();
var result = example.setSingleSms(content, Phones);
var req_response = result.toString();
} catch (e) {
println("抛出异常:" + e);
}
// 发送短信后,逻辑处理
$bm('nt.sys_sms_list').update({
sms_id: sms_id,
req_response: req_response
});
}
}
$ctx.parameter.return_status = '0';
$ctx.parameter.return_message = '执行成功';
}
} catch (e) {
$ctx.success = "true";
$ctx.parameter.return_status = '1';
$ctx.parameter.return_message = String(e);
}
var result = {
code: $ctx.parameter.return_status,
message: $ctx.parameter.return_message,
checkId:md5_check_id
};
$ctx.parameter.json = JSON.stringify(result);
}
send_sms();
]]></s:server-script>
</a:init-procedure>
<a:service-output output="/parameter/@json"/>
</a:service>