From 3ccf3d76396d1c7e015de8e8c6bad0a26253437e Mon Sep 17 00:00:00 2001 From: ligang7138 <445123875@qq.com> Date: Sat, 30 Jan 2016 09:32:43 +0800 Subject: [PATCH] Update index.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 使用genSession时的传参数量与声明genSession时的不一致 --- view/index.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/view/index.py b/view/index.py index 4a5f867..d809489 100644 --- a/view/index.py +++ b/view/index.py @@ -138,13 +138,14 @@ def GET(self,*args): else: ShowName = d.nickname if d.loginfo != d.LID: - g2 = db.query('''select L.ip,L.date from users as U left join login_logs as L on U.loginfo=L.id where U.id="%s"''' % uid) + g2 = db.query('''select L.ip,L.date,L.location from users as U left join login_logs as L on U.loginfo=L.id where U.id="%s"''' % uid) d = g2[0] # 这里还可以返回一个异地浏览器登录的提示 Lstat = "other" #上次登录在别的浏览器或者异地、异机 LastIP = d.ip LastDate = d.date - genSession(uid,Username,ShowName,LastIP,LastDate,token,Lstat,kpl='yes') + LastLocation = d.location + genSession(uid,Username,ShowName,LastIP,LastLocation,LastDate,token,Lstat,kpl='yes') if HTTP_REFERER: web.setcookie('HTTP_REFERER', '88888888', -1000) return web.seeother(HTTP_REFERER)