Browse Source

修改http协议

neo 1 year ago
parent
commit
e15c8f05ab
2 changed files with 8 additions and 8 deletions
  1. 4 4
      nodes/login/controllers/usr.lua
  2. 4 4
      nodes/login/lib/webapp.lua

+ 4 - 4
nodes/login/controllers/usr.lua

@@ -52,7 +52,7 @@ local function l_uuid_register(msg)
52
 end
52
 end
53
 
53
 
54
 -- 快速注册
54
 -- 快速注册
55
-function root.register(msg)
55
+function root.usr_register(msg)
56
     local errCode, ret = l_uuid_register(msg)
56
     local errCode, ret = l_uuid_register(msg)
57
     if errCode then
57
     if errCode then
58
         return errCode, ret
58
         return errCode, ret
@@ -80,7 +80,7 @@ function root.register(msg)
80
 end
80
 end
81
 
81
 
82
 -- 快速登陆
82
 -- 快速登陆
83
-function root.login(msg)
83
+function root.usr_login(msg)
84
     log.info("login msg[%s]", tostring(msg))
84
     log.info("login msg[%s]", tostring(msg))
85
     local uid = msg.uid
85
     local uid = msg.uid
86
     if is_empty(uid) or is_empty(msg.password) then
86
     if is_empty(uid) or is_empty(msg.password) then
@@ -138,7 +138,7 @@ function root.login(msg)
138
 end
138
 end
139
 
139
 
140
 -- 注册 - 手机号
140
 -- 注册 - 手机号
141
-function root.registerByPhone(msg)
141
+function root.usr_register_by_phone(msg)
142
     local errCode, ret = l_uuid_register(msg)
142
     local errCode, ret = l_uuid_register(msg)
143
     if errCode then
143
     if errCode then
144
         return errCode, ret
144
         return errCode, ret
@@ -167,7 +167,7 @@ function root.registerByPhone(msg)
167
     return root.loginByPhone(msg)
167
     return root.loginByPhone(msg)
168
 end
168
 end
169
 -- 登录 - 手机号
169
 -- 登录 - 手机号
170
-function root.loginByPhone(msg)
170
+function root.usr_login_by_phone(msg)
171
     log.info("loginByPhone msg[%s]", tostring(msg))
171
     log.info("loginByPhone msg[%s]", tostring(msg))
172
     local account, password = msg.account, msg.accountPassword
172
     local account, password = msg.account, msg.accountPassword
173
     if not account or not password then
173
     if not account or not password then

+ 4 - 4
nodes/login/lib/webapp.lua

@@ -237,9 +237,9 @@ local function SPROTO(name, args, response)
237
 		return res.code, res.body, res.headers
237
 		return res.code, res.body, res.headers
238
 	end
238
 	end
239
 
239
 
240
-	local func = controller[method]
240
+	local func = controller[name]
241
 	if not func then
241
 	if not func then
242
-		log.error("SPROTO controller[%s] has no method[%s] ", controllerName, method)
242
+		log.error("SPROTO controller[%s] has no name[%s] ", controllerName, name)
243
 		res.body = response({code = code.REQUEST_NOT_FOUND})
243
 		res.body = response({code = code.REQUEST_NOT_FOUND})
244
 		return res.code, res.body, res.headers
244
 		return res.code, res.body, res.headers
245
 	end
245
 	end
@@ -263,8 +263,8 @@ local function l_decode_sproto(ip, headers, path, body)
263
 		return
263
 		return
264
 	end
264
 	end
265
 
265
 
266
-	pName = pName:gsub("_", "/")
267
-	pName = string.format("/%s", pName)
266
+	-- pName = pName:gsub("_", "/")
267
+	-- pName = string.format("/%s", pName)
268
 	if headers and headers["proxy-client-ip"] then
268
 	if headers and headers["proxy-client-ip"] then
269
 		ip = headers["proxy-client-ip"]
269
 		ip = headers["proxy-client-ip"]
270
 	end
270
 	end