From 92c80e075d597091d7367715bcd1cbe580f5e5a6 Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Tue, 13 Oct 2020 00:16:36 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BD=91=E8=B7=AF=E5=BA=93=E5=8A=A0=E8=BD=BD?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=E4=B8=8D=E4=BC=9A=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zframework/toolfunc.lua | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/Zframework/toolfunc.lua b/Zframework/toolfunc.lua index e39f9b04..3ab25eaf 100644 --- a/Zframework/toolfunc.lua +++ b/Zframework/toolfunc.lua @@ -152,17 +152,23 @@ do--dumpTable end do--httpRequest client=LOADLIB("NETlib") - function httpRequest(tick,url,method) - local task,err=client.httpraw{ - url=url, - method=method or"GET", - -- header={}, - -- body="", - } - if task then - TASK.new(tick,{task=task,time=0}) - else - LOG.print("NETlib error: "..err,"warn") + if client then + function httpRequest(tick,url,method) + local task,err=client.httpraw{ + url=url, + method=method or"GET", + -- header={}, + -- body="", + } + if task then + TASK.new(tick,{task=task,time=0}) + else + LOG.print("NETlib error: "..err,"warn") + end + end + else + function httpRequest(tick,url,method) + LOG.print("[NO NETlib]",5,color.yellow) end end end