|
|
@@ -21,11 +21,6 @@ class Login extends Controller
|
|
|
*/
|
|
|
public function index()
|
|
|
{
|
|
|
-// $http = array();
|
|
|
-// if(!empty($_SERVER['HTTP_REFERER'])){
|
|
|
- $http = $_SERVER['HTTP_REFERER'];
|
|
|
- //}
|
|
|
-
|
|
|
if (session('user_id')) {
|
|
|
$this->success('已经登录', 'User/Index/index');
|
|
|
}
|
|
|
@@ -34,6 +29,7 @@ class Login extends Controller
|
|
|
$user_email = input('post.user_email');
|
|
|
$user_password = input('post.user_password');
|
|
|
// $captcha = input('post.captcha');
|
|
|
+ $http = input('post.http');
|
|
|
|
|
|
$data = array(
|
|
|
'user_email' => $user_email,
|
|
|
@@ -75,18 +71,19 @@ class Login extends Controller
|
|
|
session('user_id', $user_info['user_id']);
|
|
|
session('user_email', $user_info['user_email']);
|
|
|
|
|
|
-// if(!empty($http)){
|
|
|
-// //return $this->redirect('Home/Product/product');
|
|
|
-// header("location:$http");
|
|
|
-// }else{
|
|
|
-// return $this->redirect('User/Index/index');
|
|
|
-// }
|
|
|
- return $this->redirect('User/Index/index');
|
|
|
+ if(!empty($http)){
|
|
|
+ header("location:$http");
|
|
|
+ }else{
|
|
|
+ return $this->redirect('User/Index/index');
|
|
|
+ }
|
|
|
} else {
|
|
|
$this->success('帐号密码错误');
|
|
|
}
|
|
|
} else {
|
|
|
- //$this->assign('http', $http);
|
|
|
+ if(!empty($_SERVER['HTTP_REFERER'])){
|
|
|
+ $http = $_SERVER['HTTP_REFERER'];
|
|
|
+ $this->assign('http', $http);
|
|
|
+ }
|
|
|
return $this->fetch();
|
|
|
}
|
|
|
}
|