code review by hf: modify call api to release env
Showing
1 changed file
with
8 additions
and
9 deletions
@@ -26,6 +26,9 @@ class LoginController extends AbstractAction | @@ -26,6 +26,9 @@ class LoginController extends AbstractAction | ||
26 | $this->setCookie('refer', $refer); | 26 | $this->setCookie('refer', $refer); |
27 | } | 27 | } |
28 | 28 | ||
29 | + // 设置登录有效时间30分钟, 防机器刷 | ||
30 | + $this->setSession('_LOGIN_EXPIRE', time() + 1800); | ||
31 | + | ||
29 | $this->setTitle('登录'); | 32 | $this->setTitle('登录'); |
30 | 33 | ||
31 | $data = array( | 34 | $data = array( |
@@ -44,9 +47,6 @@ class LoginController extends AbstractAction | @@ -44,9 +47,6 @@ class LoginController extends AbstractAction | ||
44 | 47 | ||
45 | // 渲染模板 | 48 | // 渲染模板 |
46 | $this->_view->display('index', $data); | 49 | $this->_view->display('index', $data); |
47 | - | ||
48 | - // 设置登录有效时间30分钟, 防机器刷 | ||
49 | - $this->setSession('_LOGIN_EXPIRE', time() + 1800); | ||
50 | } | 50 | } |
51 | 51 | ||
52 | /** | 52 | /** |
@@ -59,6 +59,9 @@ class LoginController extends AbstractAction | @@ -59,6 +59,9 @@ class LoginController extends AbstractAction | ||
59 | $this->setCookie('refer', $refer); | 59 | $this->setCookie('refer', $refer); |
60 | } | 60 | } |
61 | 61 | ||
62 | + // 设置登录有效时间30分钟, 防机器刷 | ||
63 | + $this->setSession('_LOGIN_EXPIRE', time() + 1800); | ||
64 | + | ||
62 | $this->setTitle('国际账号登录'); | 65 | $this->setTitle('国际账号登录'); |
63 | 66 | ||
64 | $data = array(); | 67 | $data = array(); |
@@ -70,9 +73,6 @@ class LoginController extends AbstractAction | @@ -70,9 +73,6 @@ class LoginController extends AbstractAction | ||
70 | $data['countrys'] = RegData::getAreasData(); // 地区信息列表 | 73 | $data['countrys'] = RegData::getAreasData(); // 地区信息列表 |
71 | // 渲染模板 | 74 | // 渲染模板 |
72 | $this->_view->display('international', $data); | 75 | $this->_view->display('international', $data); |
73 | - | ||
74 | - // 设置登录有效时间30分钟, 防机器刷 | ||
75 | - $this->setSession('_LOGIN_EXPIRE', time() + 1800); | ||
76 | } | 76 | } |
77 | 77 | ||
78 | /** | 78 | /** |
@@ -129,13 +129,13 @@ class LoginController extends AbstractAction | @@ -129,13 +129,13 @@ class LoginController extends AbstractAction | ||
129 | if (!$verifyEmail && !$verifyMobile) { | 129 | if (!$verifyEmail && !$verifyMobile) { |
130 | break; | 130 | break; |
131 | } | 131 | } |
132 | - | 132 | + |
133 | /* 设置登录有效时间30分钟, 防机器刷 */ | 133 | /* 设置登录有效时间30分钟, 防机器刷 */ |
134 | $expire = $this->getSession('_LOGIN_EXPIRE'); | 134 | $expire = $this->getSession('_LOGIN_EXPIRE'); |
135 | if (empty($expire) || $expire < time()) { | 135 | if (empty($expire) || $expire < time()) { |
136 | break; | 136 | break; |
137 | } | 137 | } |
138 | - | 138 | + |
139 | /* 调用登录接口进行登录 */ | 139 | /* 调用登录接口进行登录 */ |
140 | // 获取未登录时的唯一识别码 | 140 | // 获取未登录时的唯一识别码 |
141 | $shoppingKey = Helpers::getShoppingKeyByCookie(); | 141 | $shoppingKey = Helpers::getShoppingKeyByCookie(); |
@@ -157,7 +157,6 @@ class LoginController extends AbstractAction | @@ -157,7 +157,6 @@ class LoginController extends AbstractAction | ||
157 | $this->setCookie('_TOKEN', $token); | 157 | $this->setCookie('_TOKEN', $token); |
158 | $this->setSession('_TOKEN', $token); | 158 | $this->setSession('_TOKEN', $token); |
159 | $this->setSession('_LOGIN_UID', $data['data']['uid']); | 159 | $this->setSession('_LOGIN_UID', $data['data']['uid']); |
160 | - | ||
161 | } while (false); | 160 | } while (false); |
162 | 161 | ||
163 | $this->echoJson($data); | 162 | $this->echoJson($data); |
-
Please register or login to post a comment