【调度系统】广东民航医疗快线调度系统源代码
wlzboy
2025-09-06 2decf5219e3476e30095fd9dbf6e49c55e105563
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
<!--#include file="core.asp"-->
<%
'接口信息
account="966120"
accountpass="new966120"
appkey=""
 
access_token=GetAccess_token()
 
'https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid=wx248505bfbab6d0c1&corpsecret=2MCilqWYC0FWjOQ894sbb-s7Lb5sVH4HHuJgOsd9l1k
'{"access_token":"2qs5HAae2cno2I4_WkFwTyMMbpI0k1q0IP74qNH4f9o52Lpmebnl5aJRkeiruCA5OPfNzA2X-6vpBqPPIoeIKA","expires_in":7200}
'appUrl="http://tvadmin.v.com.cn/ECERP/aa.asp"
 
'Post方法
Function PostBody(appUrl,args1)
Set https = Server.CreateObject("Msxml2.ServerXMLHTTP") 
 
'Set https = Server.CreateObject("MSXML2.XMLHTTP") 
With https 
.Open "Post", appUrl, False
.setRequestHeader "Content-Type","multipart/form-data"
.Send args1
PostBody = .ResponseBody
End With 
PostBody = BytesToBstr(PostBody,"utf-8")
Set https = Nothing 
End Function
 
'Get方法
Function GetBody(appUrl,Origin)
Set https = Server.CreateObject("Msxml2.ServerXMLHTTP") 
 
With https 
.Open "GET", appUrl&"?"&Origin, False
.setRequestHeader "Content-Type","application/x-www-form-urlencoded"
.Send ""
GetBody = .ResponseBody
End With 
GetBody = BytesToBstr(GetBody,"utf-8")
Set https = Nothing 
End Function
 
'获取access_token
Function GetAccess_token()
access_tokenID=4039    '对应数据库ID 
Set rs = Server.CreateObject("ADODB.Recordset")
sql="select vtext,vMono from dictionary where id="&access_tokenID
rs.open sql,objConn,1,1
access_token=rs("vtext")
access_token_time=cdate(rs("vMono"))
rs.close()
If DateDiff("s",access_token_time,now())>0 or access_token="{""ret"":20001,""msg"":""账号或密码错误""}" then
    '获取新的access_token
    url="http://api.gpsoo.net/1/auth/access_token"  '//定义要获取源代码的网址,一般是通过变量传递过来
    time1=ToUnixTime(now(),0)
    signature=access_tokenMd5(accountpass, time1)  
    Origin="account="&account&"&time="&time1&"&signature="&signature
    HTMLCODE= GetBody(url,Origin)
    'Response.Write HTMLCODE
    access_token=replace(replace(HTMLCODE,"{""access_token"":""",""),""",""expires_in"":7200,""ret"":0,""msg"":""""}","")    
    access_token_time=DateAdd("s",7200,now())
    '写入数据库
    sql="update dictionary set vtext='"&access_token&"',vMono='"&access_token_time&"' where id="&access_tokenID
    'Response.Write sql
    objConn.Execute sql
End if 
GetAccess_token = access_token
End Function
 
'返回结果写入数据库
Private Function API_JsonSql(method,HTMLCODE,reserve)
    sql="Insert into API_Json (method,Json,reserve) values ('"&method&"','"&HTMLCODE&"','"&reserve&"')"
    objConn.Execute sql
    Set rs = Server.CreateObject("ADODB.Recordset")
    sql="select id from API_Json where method='"&method&"' and is_Json=0 order by id desc"
    rs.open sql,objConn,1,1
    if not rs.Eof then
    JsonID=rs("id")
    else
    JsonID=""
    end if    
    rs.close()
    API_JsonSql=JsonID
End Function
 
Function BytesToBstr(body,Cset) '飘易:转换GB2312
dim objstream
set objstream = Server.CreateObject("adodb.stream")
objstream.Type = 1
objstream.Mode =3
objstream.Open
objstream.Write body
objstream.Position = 0
objstream.Type = 2
objstream.Charset = Cset
BytesToBstr = objstream.ReadText 
objstream.Close
set objstream = nothing
End Function
 
 
Private Function BuildRequestMysign(sParaSort)
    '获得签名结果
    key               = AppSecret
    sign_type       = "MD5"
    'sParaSort="{""appkey"":"""&appKey&""",""sessionkey"":"""&sessionKey&""","&sParaSort&"}"
    input_charset="utf-8"
    BuildRequestMysign = Md5Sign(sParaSort,key,input_charset)
End Function
 
'UNIX时间戳
Function ToUnixTime(strTime, intTimeZone)        
    If IsEmpty(strTime) or Not IsDate(strTime) Then strTime = Now        
    If IsEmpty(intTimeZone) or Not isNumeric(intTimeZone) Then intTimeZone = 0        
     ToUnixTime = DateAdd("h",-intTimeZone,strTime)        
     ToUnixTime = DateDiff("s","1970-1-1 0:0:0", ToUnixTime)        
End Function
 
'获取access_token_md5
Function access_tokenMd5(pass, time1)        
    input_charset="utf-8"
    prestr = md5(pass,input_charset)&time1
    access_tokenMd5 = md5(prestr,input_charset)
End Function
 
'输入参数
'method="gy.erp.vip.get"
'args1="""method"":"""&method&""",""page_no"":""1"",""page_size"":""10"",""name"":""李欣"""
 
 
'签名
'key               = secret
 
'sign_type       = "MD5"
'sParaSort="{""appkey"":"""&appKey&""",""sessionkey"":"""&sessionKey&""","&args1&"}"
'input_charset="utf-8"
'sign1 = UCase(BuildRequestMysign(sParaSort))
'sign1 = UCase(md5(key&sParaSort&key))    
 
 
'Response.Write "{""access_token"":""sV2v8S3qm9jeEyUUSD166ftctmvzbH9bZANj42bI1mMMnh1JNRpuCxWuKo-KATyhfmOZI181i1U7PH0ZeU1rXVZUoFJRNnUkp0RPYrbLdAw"",""expires_in"":7200}"
%>