<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
|
<%Session.CodePage=65001%>
|
<!--#include file="JsonPost_1000006.gds"-->
|
<!--#include virtual="/inc/function.gds"-->
|
<%
|
OA_User = trim(request("OA_User"))
|
SendType = trim(request("SendType"))
|
|
If OA_User="" Then
|
Response.Write "0"
|
Response.End
|
End If
|
If SendType<>"2" Then SendType="1"
|
Set rs = Server.CreateObject("ADODB.Recordset")
|
isOA=""
|
If Len(OA_User)=11 And IsNumeric(OA_User) Then SqlPhone=" or OA_mobile='"&OA_User&"'"
|
If SendType="2" Then
|
sql="select OA_User_ID,OA_weixinUserID,OA_mobile from OA_User where OA_execLevel>-1 and OA_mobile<>'' and len(OA_mobile)=11 and (OA_User='"&OA_User&"'"&SqlPhone&")"
|
Else
|
sql="select OA_User_ID,OA_weixinUserID,OA_mobile from OA_User where OA_execLevel>-1 and OA_weixinStatus=1 and (OA_User='"&OA_User&"'"&SqlPhone&")"
|
End If
|
rs.open sql,objConn,1,1
|
do while not rs.Eof
|
OAid = rs("OA_User_ID")
|
OA_weixinUserID = rs("OA_weixinUserID")
|
OA_mobile = rs("OA_mobile")
|
If CInt(OAid)=CInt(rs("OA_User_ID")) Then isOA=OA_weixinUserID
|
touser=touser&OA_weixinUserID&"|"
|
rs.movenext
|
loop
|
rs.close()
|
If isOA<>"" Then touser=isOA&"|"
|
If SendType="1" And touser="" Then
|
Response.Write "-1"
|
Response.End
|
ElseIf SendType="2" And OA_mobile="" Then
|
Response.Write "-1"
|
Response.End
|
End If
|
touser=Mid(touser,1,Len(touser)-1)
|
'touser="ylkx_vicgame"
|
Randomize Timer
|
OrdAuthorize = Int(899999 * Rnd + 100000)
|
sql="update OA_User set loginAuthorize='"&OrdAuthorize&"',loginAuthorize_Time=getdate() where OA_User_ID="&OAid
|
objConn.Execute sql
|
|
If SendType="1" Then
|
'微信OA信息下发接口
|
appUrl="https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token="&access_token
|
|
'微信验证码下发
|
args1="{"
|
args1=args1&"""touser"":"""&touser&"""," '成员ID列表(消息接收者,多个接收者用‘|’分隔,最多支持1000个)。特殊情况:指定为@all,则向关注该企业应用的全部成员发送 |liaojunliang
|
args1=args1&"""toparty"":""""," '部门ID列表,多个接收者用‘|’分隔,最多支持100个。当touser为@all时忽略本参数
|
args1=args1&"""totag"":""""," '标签ID列表,多个接收者用‘|’分隔。当touser为@all时忽略本参数
|
args1=args1&"""agentid"":1000006," '企业应用的id,整型。可在应用的设置页面查看
|
|
'args1=args1&"""msgtype"":""text"","
|
'args1=args1&"""text"":{"
|
' args1=args1&"""content"":"""&OrdAuthorize&""""
|
'args1=args1&"}"
|
|
args1=args1&"""msgtype"": ""news"","
|
args1=args1&"""news"": {"
|
args1=args1&"""articles"":[{""title"": ""点击自动登录电脑端后台"",""description"": ""验证码:"&OrdAuthorize&"\n发送时间:"&Now()&""",""url"": ""https://sys.966120.com.cn/login_weixin.gds?OA_User="&OA_User&"&Authorize="&OrdAuthorize&""",""btntxt"":""确认登陆""}]"
|
args1=args1&"}"
|
|
'args1=args1&"""msgtype"" : ""template_card"","
|
'args1=args1&"""template_card"" : {"
|
' args1=args1&"""card_type"" : ""button_interaction"","
|
' args1=args1&"""main_title"" : {"
|
' args1=args1&"""title"" : ""登录电脑端后台""
|
' args1=args1&"},"
|
'"sub_title_text" : "下载企业微信还能抢红包!",
|
' args1=args1&"""horizontal_content_list"" : ["
|
' args1=args1&"{""keyname"": ""验证码"",""value"": """&OrdAuthorize&"""},"
|
' args1=args1&"{""keyname"": ""发送时间"",""value"": """&Now()&"""},"
|
' args1=args1&"],"
|
' args1=args1&"""task_id"": ""task_id"","
|
' args1=args1&"""button_list"": ["
|
' args1=args1&"{""text"": ""登陆"",""style"": 1,""key"": ""button_key_1""},"
|
' args1=args1&"{""text"": ""取消"",""style"": 2,""key"": ""button_key_2""},"
|
' args1=args1&"]"
|
'args1=args1&"}"
|
|
'Response.Write args1&"<br>"
|
HTMLCODE= PostBody(appUrl,args1)
|
'Response.Write HTMLCODE
|
'Response.Write HTMLCODE &"<br>"
|
''''''''''''临时通过966120登陆'''''''''''''''''''
|
'sql="update OA_User set loginAuthorize='966120',loginAuthorize_Time=getdate() where OA_User_ID="&OAid
|
'Response.write sql
|
'objConn.Execute sql
|
'Response.Write "1"
|
'Response.end
|
''''''''''''临时通过966120登陆'''''''''''''''''''
|
'If 1=2 then
|
If Mid(HTMLCODE,12,1)<>"0" Then
|
Call OA_Running("weixin_message_send|1000006|"&touser&"|"&HTMLCODE)
|
'Response.Write HTMLCODE
|
session("GetAccess_token")="1"
|
Response.Write "-2"
|
Else
|
Response.Write "1"
|
End If
|
'End if
|
|
ElseIf SendType="2" Then
|
'手机短信下发接口
|
appUrl="https://api.966120.com.cn/v1/SendSms.php?Phone="&OA_mobile&"&code="&OrdAuthorize&"&lateCode=SMS_174745063"
|
|
'短信验证码下发
|
args1=""
|
|
'Response.Write args1&"<br>"
|
HTMLCODE= PostBody(appUrl,args1)
|
'Response.Write HTMLCODE
|
If InStr(HTMLCODE,"OK")<=0 Then
|
Call OA_Running("weixin_message_send|SendSms|"&OA_mobile&"|"&HTMLCODE)
|
'Response.Write HTMLCODE
|
Response.Write "-2"
|
Else
|
Response.Write "1"
|
End If
|
End If
|
|
|
%>
|