diff --git a/codes/games/server/youle/server_agent/rpc.js b/codes/games/server/youle/server_agent/rpc.js index 5136d4e..4e0a31c 100644 --- a/codes/games/server/youle/server_agent/rpc.js +++ b/codes/games/server/youle/server_agent/rpc.js @@ -3,6 +3,21 @@ ////////////////////////////////////////////////////////////////// youle_agent.debug = true; +//更新手机验证码 +youle_agent.update_phone_code = function(phonenum, smmcode) { + var idx = min_ary_indexof(youle_agent.phonecodes, phonenum, "phonenum"); + if (idx == -1){ + var info = {}; + info.phonenum = phonenum; + info.smmcode = smmcode; + info.sendtime = min_now(); + youle_agent.phonecodes.push(info); + } else { + youle_agent.phonecodes[idx].smmcode = smmcode; + youle_agent.phonecodes[idx].sendtime = min_now(); + } +} + //发送手机验证码 youle_agent.send_phone_checkcode = function(pack){ var agentid = pack.data.agentid; @@ -23,40 +38,17 @@ youle_agent.send_phone_checkcode = function(pack){ config.data = md5Geturl3(13619576943, "xieyu2018", phonenum, md5memo); min_http(config); - var idx = min_ary_indexof(youle_agent.phonecodes, phonenum, "phonenum"); - if (idx == -1){ - var info = {}; - info.phonenum = phonenum; - info.smmcode = smmcode; - info.sendtime = min_now(); - youle_agent.phonecodes.push(info); - } else { - youle_agent.phonecodes[idx].smmcode = smmcode; - youle_agent.phonecodes[idx].sendtime = min_now(); - } + youle_agent.update_phone_code(phonenum, smmcode); return pack; } //发送手机验证码-微信小程序版本 youle_agent.send_phone_code_wechat = function(pack){ - var agentid = pack.data.agentid; + var phonenum = pack.data.phonenum; - - - var smmcode = min_random(1000, 9999); - - var idx = min_ary_indexof(youle_agent.phonecodes, phonenum, "phonenum"); - if (idx == -1){ - var info = {}; - info.phonenum = phonenum; - info.smmcode = smmcode; - info.sendtime = min_now(); - youle_agent.phonecodes.push(info); - } else { - youle_agent.phonecodes[idx].smmcode = smmcode; - youle_agent.phonecodes[idx].sendtime = min_now(); - } + youle_agent.update_phone_code(phonenum, smmcode); + pack.data.smmcode = smmcode; return pack; } @@ -83,16 +75,7 @@ youle_agent.get_phone_code_wechat = function(pack){ if (smmcode == 0){ smmcode = min_random(1000, 9999); - if (idx == -1){ - var info = {}; - info.phonenum = phonenum; - info.smmcode = smmcode; - info.sendtime = min_now(); - youle_agent.phonecodes.push(info); - } else { - youle_agent.phonecodes[idx].smmcode = smmcode; - youle_agent.phonecodes[idx].sendtime = min_now(); - } + youle_agent.update_phone_code(phonenum, smmcode); } pack.data.smmcode = smmcode; diff --git a/codes/minipro/calculation/project.config.json b/codes/minipro/calculation/project.config.json index 5a9a94e..8920192 100644 --- a/codes/minipro/calculation/project.config.json +++ b/codes/minipro/calculation/project.config.json @@ -42,7 +42,7 @@ "tabIndent": "insertSpaces", "tabSize": 2 }, - "libVersion": "3.12.1", + "libVersion": "3.14.1", "packOptions": { "ignore": [], "include": [] diff --git a/codes/minipro/wxserver/index.js b/codes/minipro/wxserver/index.js index 1785aef..64c6f15 100644 --- a/codes/minipro/wxserver/index.js +++ b/codes/minipro/wxserver/index.js @@ -464,7 +464,7 @@ app.post('/api/getPhoneCode', async (req, res) => { const payload = { "app": "youle", "route": "agent", - "rpc": "get_phone_code_wechat", + "rpc": "send_phone_code_wechat", "data": { "agentid": agentid, "phonenum": phonenum