ソースを参照

修改http协议

neo 1 年間 前
コミット
80c8648c02
共有1 個のファイルを変更した7 個の追加1 個の削除を含む
  1. 7 1
      nodes/login/lib/webapp.lua

+ 7 - 1
nodes/login/lib/webapp.lua

@@ -66,6 +66,12 @@ local function l_get_math_controller_and_func(path)
66
 	return string.format("%s", controller), func
66
 	return string.format("%s", controller), func
67
 end
67
 end
68
 
68
 
69
+-- 根据协议获取模块
70
+local function _get_cotroller(proto)
71
+	local data = string.split(proto, "_")
72
+	return data[1]
73
+end
74
+
69
 -- 匹配静态资源
75
 -- 匹配静态资源
70
 local function l_is_match_static(path)
76
 local function l_is_match_static(path)
71
 	if not IS_TEST then
77
 	if not IS_TEST then
@@ -229,7 +235,7 @@ end
229
 local function SPROTO(name, args, response)
235
 local function SPROTO(name, args, response)
230
 	local res = {code = 200, body = nil, headers = l_get_req_headers()}
236
 	local res = {code = 200, body = nil, headers = l_get_req_headers()}
231
 
237
 
232
-	local controllerName, method = l_get_math_controller_and_func(name)
238
+	local controllerName = _get_cotroller(name)
233
 	local controller = controllerList[controllerName]
239
 	local controller = controllerList[controllerName]
234
 	if not controller then
240
 	if not controller then
235
 		log.error("SPROTO controller[%s] not exist", controllerName)
241
 		log.error("SPROTO controller[%s] not exist", controllerName)