diff --git a/app/appfront/modules/Catalog/block/favoriteproduct/Add.php b/app/appfront/modules/Catalog/block/favoriteproduct/Add.php index 9f48e4d06346ecd931051f7a15420e987658ebb9..b6e9d23d338de51ce9cbb0d890ef9ee0f6f8c691 100644 --- a/app/appfront/modules/Catalog/block/favoriteproduct/Add.php +++ b/app/appfront/modules/Catalog/block/favoriteproduct/Add.php @@ -25,8 +25,8 @@ class Add { if(Yii::$app->user->isGuest){ $url = Yii::$service->url->getCurrentUrl(); Yii::$service->customer->setLoginSuccessRedirectUrl($url); - Yii::$service->url->redirectByUrlKey('customer/account/login'); - exit; + return Yii::$service->url->redirectByUrlKey('customer/account/login'); + } $identity = Yii::$app->user->identity; @@ -39,11 +39,11 @@ class Add { $favoriteParam = Yii::$app->getModule('catalog')->params['favorite']; # 跳转。 if(isset($favoriteParam['addSuccessRedirectFavoriteList']) && $favoriteParam['addSuccessRedirectFavoriteList']){ - Yii::$service->url->redirectByUrlKey('customer/productfavorite'); + return Yii::$service->url->redirectByUrlKey('customer/productfavorite'); }else{ $product = Yii::$service->product->getByPrimaryKey($product_id); $urlKey = $product['url_key']; - Yii::$service->url->redirectByUrlKey($urlKey); + return Yii::$service->url->redirectByUrlKey($urlKey); } } diff --git a/app/appfront/modules/Catalog/controllers/FavoriteproductController.php b/app/appfront/modules/Catalog/controllers/FavoriteproductController.php index dd2d863bf12e6be32c79f6d49b3d173d8e3ff39c..a0798bcfb44ec341f543622067ed2b46ca3322ff 100644 --- a/app/appfront/modules/Catalog/controllers/FavoriteproductController.php +++ b/app/appfront/modules/Catalog/controllers/FavoriteproductController.php @@ -21,7 +21,7 @@ class FavoriteproductController extends AppfrontController # 增加收藏 public function actionAdd() { - $data = $this->getBlock()->getLastData(); + return $this->getBlock()->getLastData(); //return $this->render($this->action->id,$data); } diff --git a/app/appfront/modules/Catalog/controllers/ReviewproductController.php b/app/appfront/modules/Catalog/controllers/ReviewproductController.php index 1b700b98338ac8ed0151fc62d2861720b6c05c34..2a91b9ae98bb6e426cbfa892bd52344110f7d6a1 100644 --- a/app/appfront/modules/Catalog/controllers/ReviewproductController.php +++ b/app/appfront/modules/Catalog/controllers/ReviewproductController.php @@ -31,7 +31,7 @@ class ReviewproductController extends AppfrontController Yii::$service->customer->setLoginSuccessRedirectUrl($currentUrl); # 如果评论产品必须登录用户,则跳转到用户登录页面 - Yii::$service->url->redirectByUrlKey('customer/account/login'); + return Yii::$service->url->redirectByUrlKey('customer/account/login'); } $editForm = Yii::$app->request->post('editForm'); diff --git a/app/appfront/modules/Checkout/block/onepage/Index.php b/app/appfront/modules/Checkout/block/onepage/Index.php index 14876fff356202d17c732d9d8da00b9206fcef52..cea670cf84eb45d6dad128e8fb98d0f6e4b1aacd 100644 --- a/app/appfront/modules/Checkout/block/onepage/Index.php +++ b/app/appfront/modules/Checkout/block/onepage/Index.php @@ -31,7 +31,7 @@ class Index { $cartInfo = Yii::$service->cart->getCartInfo(); if(!isset($cartInfo['products']) || !is_array($cartInfo['products']) || empty($cartInfo['products'])){ - Yii::$service->url->redirectByUrlKey('checkout/cart'); + return Yii::$service->url->redirectByUrlKey('checkout/cart'); } $currency_info = Yii::$service->page->currency->getCurrencyInfo(); $this->initAddress(); @@ -549,4 +549,4 @@ class Index { -} \ No newline at end of file +} diff --git a/app/appfront/modules/Checkout/controllers/OnepageController.php b/app/appfront/modules/Checkout/controllers/OnepageController.php index 82df61dcd9e3feda7466cb28735c8f3b610172be..4ce94275aef7de30a034e1499d856a60cb266b49 100644 --- a/app/appfront/modules/Checkout/controllers/OnepageController.php +++ b/app/appfront/modules/Checkout/controllers/OnepageController.php @@ -38,8 +38,11 @@ class OnepageController extends AppfrontController $data = $this->getBlock()->getLastData(); - return $this->render($this->action->id,$data); - + if(is_array($data) && !empty($data) ){ + return $this->render($this->action->id,$data); + }else{ + return $data; + } } diff --git a/app/appfront/modules/Customer/block/account/Login.php b/app/appfront/modules/Customer/block/account/Login.php index 07ea3e8a9ca0aa50f9b70ef05b46025ae66544ba..cc234979052ab5d3d0ca21ec37f9772d2e3316f9 100644 --- a/app/appfront/modules/Customer/block/account/Login.php +++ b/app/appfront/modules/Customer/block/account/Login.php @@ -53,11 +53,7 @@ class Login { } } Yii::$service->page->message->addByHelperErrors(); - if(!Yii::$app->user->isGuest){ - //Yii::$service->url->redirectByUrlKey('customer/account'); - Yii::$service->customer->loginSuccessRedirect('customer/account'); - } - + return; } /** * 发送登录邮件 @@ -70,4 +66,4 @@ class Login { -} \ No newline at end of file +} diff --git a/app/appfront/modules/Customer/block/address/Edit.php b/app/appfront/modules/Customer/block/address/Edit.php index 11dad7859429f845cbbe8f778dfef39a6f579565..f796e0d80a7c9c4c09b8dbd7c25710c3edc466c7 100644 --- a/app/appfront/modules/Customer/block/address/Edit.php +++ b/app/appfront/modules/Customer/block/address/Edit.php @@ -221,7 +221,7 @@ class Edit { $identity = Yii::$app->user->identity; $arr['customer_id'] = $identity['id']; Yii::$service->customer->address->save($arr); - Yii::$service->url->redirectByUrlKey('customer/address'); + return Yii::$service->url->redirectByUrlKey('customer/address'); } @@ -230,4 +230,4 @@ class Edit { -} \ No newline at end of file +} diff --git a/app/appfront/modules/Customer/block/order/Reorder.php b/app/appfront/modules/Customer/block/order/Reorder.php index e6aff17a4fd409e226431c57c2e417c79476d78d..a4f2f39944b0a058de5d531a5b9f701b3390d93a 100644 --- a/app/appfront/modules/Customer/block/order/Reorder.php +++ b/app/appfront/modules/Customer/block/order/Reorder.php @@ -20,18 +20,18 @@ class Reorder { public function getLastData(){ $order_id = Yii::$app->request->get('order_id'); if(!$order_id){ - $this->errorMessage('The order id is empty'); + return $this->errorMessage('The order id is empty'); } $order = Yii::$service->order->getByPrimaryKey($order_id); if(!$order['increment_id']){ - $this->errorMessage('The order is not exist'); + return $this->errorMessage('The order is not exist'); } $customer_id = Yii::$app->user->identity->id; if(!$order['customer_id'] || ($order['customer_id'] != $customer_id)){ - $this->errorMessage('The order does not belong to you'); + return $this->errorMessage('The order does not belong to you'); } $this->addOrderProductToCart($order_id); - Yii::$service->url->redirectByUrlKey('checkout/cart'); + return Yii::$service->url->redirectByUrlKey('checkout/cart'); } public function addOrderProductToCart($order_id){ $items = Yii::$service->order->item->getByOrderId($order_id); @@ -55,10 +55,9 @@ class Reorder { */ public function errorMessage($message){ Yii::$service->page->message->addError($message); - Yii::$service->url->redirectByUrlKey('customer/order'); - exit; + return Yii::$service->url->redirectByUrlKey('customer/order'); } -} \ No newline at end of file +} diff --git a/app/appfront/modules/Customer/controllers/AccountController.php b/app/appfront/modules/Customer/controllers/AccountController.php index 6fd5812eb80d65402c76caaaedba5b06e2897133..23036a89004bad725e58f3204a1f87d5e77c8eab 100644 --- a/app/appfront/modules/Customer/controllers/AccountController.php +++ b/app/appfront/modules/Customer/controllers/AccountController.php @@ -51,6 +51,9 @@ class AccountController extends AppfrontController $param = Yii::$app->request->post('editForm'); if(!empty($param) && is_array($param)){ $this->getBlock()->login($param); + if(!Yii::$app->user->isGuest){ + return Yii::$service->customer->loginSuccessRedirect('customer/account'); + } } $data = $this->getBlock()->getLastData($param); return $this->render($this->action->id,$data); @@ -82,7 +85,7 @@ class AccountController extends AppfrontController if(isset($params_register['loginSuccessRedirectUrlKey']) && $params_register['loginSuccessRedirectUrlKey'] ){ $urlKey = $params_register['loginSuccessRedirectUrlKey']; } - Yii::$service->customer->loginSuccessRedirect($urlKey); + return Yii::$service->customer->loginSuccessRedirect($urlKey); } } } diff --git a/app/appfront/modules/Customer/controllers/AddressController.php b/app/appfront/modules/Customer/controllers/AddressController.php index df7cd0a614fa3c5c60f317b5140a2639b8fd54c9..4ca96f1bcf75459fed69531fe1ea96ff73417891 100644 --- a/app/appfront/modules/Customer/controllers/AddressController.php +++ b/app/appfront/modules/Customer/controllers/AddressController.php @@ -22,7 +22,7 @@ class AddressController extends AppfrontController public function init(){ if(Yii::$app->user->isGuest){ - Yii::$service->url->redirectByUrlKey('customer/account/login'); + return Yii::$service->url->redirectByUrlKey('customer/account/login'); } parent::init(); } diff --git a/app/appfront/modules/Customer/controllers/EditaccountController.php b/app/appfront/modules/Customer/controllers/EditaccountController.php index fbcbdf740478663cc046ff674b1ae2391b3ab606..1a3ed26414323ae439f334192de3da5cf8389f2f 100644 --- a/app/appfront/modules/Customer/controllers/EditaccountController.php +++ b/app/appfront/modules/Customer/controllers/EditaccountController.php @@ -21,7 +21,7 @@ class EditaccountController extends AppfrontController public function init(){ if(Yii::$app->user->isGuest){ - Yii::$service->url->redirectByUrlKey('customer/account/login'); + return Yii::$service->url->redirectByUrlKey('customer/account/login'); } parent::init(); } diff --git a/app/appfront/modules/Customer/controllers/OrderController.php b/app/appfront/modules/Customer/controllers/OrderController.php index 02e3c8a2347284c241c2b8f5b74124f7348d0fc4..8c4d2ed5448394c634b7c15c8ca3427b00d3f39c 100644 --- a/app/appfront/modules/Customer/controllers/OrderController.php +++ b/app/appfront/modules/Customer/controllers/OrderController.php @@ -21,7 +21,7 @@ class OrderController extends AppfrontController public function init(){ if(Yii::$app->user->isGuest){ - Yii::$service->url->redirectByUrlKey('customer/account/login'); + return Yii::$service->url->redirectByUrlKey('customer/account/login'); } parent::init(); } @@ -39,7 +39,7 @@ class OrderController extends AppfrontController } public function actionReorder(){ - $this->getBlock()->getLastData(); + return $this->getBlock()->getLastData(); //return $this->render($this->action->id,$data); } diff --git a/app/appfront/modules/Customer/controllers/PointController.php b/app/appfront/modules/Customer/controllers/PointController.php index c02b408650d4ff1d1b21bae61f64e4e0e20ce17b..854d84179113dc8ae922f15256b4c926e9b33cb7 100644 --- a/app/appfront/modules/Customer/controllers/PointController.php +++ b/app/appfront/modules/Customer/controllers/PointController.php @@ -21,7 +21,7 @@ class PointController extends AppfrontController public function init(){ if(Yii::$app->user->isGuest){ - Yii::$service->url->redirectByUrlKey('customer/account/login'); + return Yii::$service->url->redirectByUrlKey('customer/account/login'); } parent::init(); } diff --git a/app/appfront/modules/Customer/controllers/ProductfavoriteController.php b/app/appfront/modules/Customer/controllers/ProductfavoriteController.php index 9e456989eacb3fbc5eab5fbcfba6282ae72e43cb..b7b80cf2cd8682c5f4f86de5f52c6b7ce6066f7b 100644 --- a/app/appfront/modules/Customer/controllers/ProductfavoriteController.php +++ b/app/appfront/modules/Customer/controllers/ProductfavoriteController.php @@ -21,7 +21,7 @@ class ProductfavoriteController extends AppfrontController public function init(){ if(Yii::$app->user->isGuest){ - Yii::$service->url->redirectByUrlKey('customer/account/login'); + return Yii::$service->url->redirectByUrlKey('customer/account/login'); } parent::init(); } diff --git a/app/appfront/modules/Customer/controllers/ProductreviewController.php b/app/appfront/modules/Customer/controllers/ProductreviewController.php index 979b5b86748d5f06ced7e7d4d8accf22d2e71df3..7eb74b933ba65eda7048272af7f0858b6558e53f 100644 --- a/app/appfront/modules/Customer/controllers/ProductreviewController.php +++ b/app/appfront/modules/Customer/controllers/ProductreviewController.php @@ -21,7 +21,7 @@ class ProductreviewController extends AppfrontController public function init(){ if(Yii::$app->user->isGuest){ - Yii::$service->url->redirectByUrlKey('customer/account/login'); + return Yii::$service->url->redirectByUrlKey('customer/account/login'); } parent::init(); } diff --git a/app/appfront/modules/Payment/block/paypal/express/Review.php b/app/appfront/modules/Payment/block/paypal/express/Review.php index e049a17a5f0f66658605b3ab5bb31a5f73279c69..63a724deeb72fedc454c7aaa52d9dbbd7967784f 100644 --- a/app/appfront/modules/Payment/block/paypal/express/Review.php +++ b/app/appfront/modules/Payment/block/paypal/express/Review.php @@ -56,7 +56,7 @@ class Review { $cartInfo = Yii::$service->cart->getCartInfo(); if(!isset($cartInfo['products']) || !is_array($cartInfo['products']) || empty($cartInfo['products'])){ - Yii::$service->url->redirectByUrlKey('checkout/cart'); + return Yii::$service->url->redirectByUrlKey('checkout/cart'); } $currency_info = Yii::$service->page->currency->getCurrencyInfo(); $this->initAddress(); diff --git a/app/appfront/modules/Payment/controllers/paypal/ExpressController.php b/app/appfront/modules/Payment/controllers/paypal/ExpressController.php index 8007c02164eff82bbf4bfb89ce5270ceb06f7ce0..b12261a2cda9462ba0b049045df0600f53db43a9 100644 --- a/app/appfront/modules/Payment/controllers/paypal/ExpressController.php +++ b/app/appfront/modules/Payment/controllers/paypal/ExpressController.php @@ -34,7 +34,12 @@ class ExpressController extends AppfrontController } } $data = $this->getBlock()->getLastData(); - return $this->render($this->action->id,$data); + if(is_array($data) && !empty($data) ){ + return $this->render($this->action->id,$data); + }else{ + return $data; + } + } diff --git a/app/appfront/modules/Payment/controllers/paypal/StandardController.php b/app/appfront/modules/Payment/controllers/paypal/StandardController.php index af16954d78718c6bd2f07295e43cf368e50c899b..f8744e7e88922d11ffb9d2d0f9362d663a9b9a50 100644 --- a/app/appfront/modules/Payment/controllers/paypal/StandardController.php +++ b/app/appfront/modules/Payment/controllers/paypal/StandardController.php @@ -26,7 +26,7 @@ class StandardController extends AppfrontController if(is_array($data) && !empty($data)){ return $this->render($this->action->id,$data); }else{ - Yii::$service->url->redirectByUrlKey('checkout/onepage'); + return Yii::$service->url->redirectByUrlKey('checkout/onepage'); } } @@ -45,8 +45,7 @@ class StandardController extends AppfrontController public function actionCancel(){ Yii::$service->order->cancel(); - Yii::$service->url->redirectByUrlKey('checkout/onepage'); - exit; + return Yii::$service->url->redirectByUrlKey('checkout/onepage'); } public function actionTest(){ diff --git a/app/apphtml5/modules/Catalog/block/favoriteproduct/Add.php b/app/apphtml5/modules/Catalog/block/favoriteproduct/Add.php index aca0102be0fb9620ded63289c42e439dfece7e63..4963de80f68aa07280554ec1e1ede09809c16748 100644 --- a/app/apphtml5/modules/Catalog/block/favoriteproduct/Add.php +++ b/app/apphtml5/modules/Catalog/block/favoriteproduct/Add.php @@ -25,8 +25,7 @@ class Add { if(Yii::$app->user->isGuest){ $url = Yii::$service->url->getCurrentUrl(); Yii::$service->customer->setLoginSuccessRedirectUrl($url); - Yii::$service->url->redirectByUrlKey('customer/account/login'); - exit; + return Yii::$service->url->redirectByUrlKey('customer/account/login'); } $identity = Yii::$app->user->identity; @@ -39,11 +38,11 @@ class Add { $favoriteParam = Yii::$app->getModule('catalog')->params['favorite']; # 跳转。 if(isset($favoriteParam['addSuccessRedirectFavoriteList']) && $favoriteParam['addSuccessRedirectFavoriteList']){ - Yii::$service->url->redirectByUrlKey('customer/productfavorite'); + return Yii::$service->url->redirectByUrlKey('customer/productfavorite'); }else{ $product = Yii::$service->product->getByPrimaryKey($product_id); $urlKey = $product['url_key']; - Yii::$service->url->redirectByUrlKey($urlKey); + return Yii::$service->url->redirectByUrlKey($urlKey); } } diff --git a/app/apphtml5/modules/Catalog/controllers/FavoriteproductController.php b/app/apphtml5/modules/Catalog/controllers/FavoriteproductController.php index ad941cf9ad188aa3502dda825bc972d5406e5e2b..57c990461d4d62cac646968b476f071ca6c060b4 100644 --- a/app/apphtml5/modules/Catalog/controllers/FavoriteproductController.php +++ b/app/apphtml5/modules/Catalog/controllers/FavoriteproductController.php @@ -22,6 +22,7 @@ class FavoriteproductController extends AppfrontController public function actionAdd() { $data = $this->getBlock()->getLastData(); + return $data; //return $this->render($this->action->id,$data); } diff --git a/app/apphtml5/modules/Catalog/controllers/ReviewproductController.php b/app/apphtml5/modules/Catalog/controllers/ReviewproductController.php index 088d24ca32a7db0246a897d746b9c1b9875afd0f..cd1034d88de21c4475b4fe493fd52f4914bc9329 100644 --- a/app/apphtml5/modules/Catalog/controllers/ReviewproductController.php +++ b/app/apphtml5/modules/Catalog/controllers/ReviewproductController.php @@ -31,7 +31,7 @@ class ReviewproductController extends AppfrontController Yii::$service->customer->setLoginSuccessRedirectUrl($currentUrl); # 如果评论产品必须登录用户,则跳转到用户登录页面 - Yii::$service->url->redirectByUrlKey('customer/account/login'); + return Yii::$service->url->redirectByUrlKey('customer/account/login'); } $editForm = Yii::$app->request->post('editForm'); diff --git a/app/apphtml5/modules/Checkout/block/onepage/Index.php b/app/apphtml5/modules/Checkout/block/onepage/Index.php index 9e22483cbdbf1eb87b68135aa747c8211a7bd23e..a99373fc82044da767ef9f20d0440014c9d66e05 100644 --- a/app/apphtml5/modules/Checkout/block/onepage/Index.php +++ b/app/apphtml5/modules/Checkout/block/onepage/Index.php @@ -31,7 +31,7 @@ class Index { $cartInfo = Yii::$service->cart->getCartInfo(); if(!isset($cartInfo['products']) || !is_array($cartInfo['products']) || empty($cartInfo['products'])){ - Yii::$service->url->redirectByUrlKey('checkout/cart'); + return Yii::$service->url->redirectByUrlKey('checkout/cart'); } $currency_info = Yii::$service->page->currency->getCurrencyInfo(); $this->initAddress(); @@ -549,4 +549,4 @@ class Index { -} \ No newline at end of file +} diff --git a/app/apphtml5/modules/Checkout/controllers/OnepageController.php b/app/apphtml5/modules/Checkout/controllers/OnepageController.php index a9f404daf0956789ec6b0ed86e49647e53d34a7b..97088d641d416da523968a666c7ff7d5e0c90ed1 100644 --- a/app/apphtml5/modules/Checkout/controllers/OnepageController.php +++ b/app/apphtml5/modules/Checkout/controllers/OnepageController.php @@ -38,8 +38,11 @@ class OnepageController extends AppfrontController $data = $this->getBlock()->getLastData(); - return $this->render($this->action->id,$data); - + if(is_array($data) && !empty($data) ){ + return $this->render($this->action->id,$data); + }else{ + return $data; + } } diff --git a/app/apphtml5/modules/Customer/block/account/Login.php b/app/apphtml5/modules/Customer/block/account/Login.php index 531a788520f5989bbaa2802c73d8b883940c9dff..5267de802c1318dc7fc30155ebb4197c79323956 100644 --- a/app/apphtml5/modules/Customer/block/account/Login.php +++ b/app/apphtml5/modules/Customer/block/account/Login.php @@ -53,11 +53,7 @@ class Login { } } Yii::$service->page->message->addByHelperErrors(); - if(!Yii::$app->user->isGuest){ - //Yii::$service->url->redirectByUrlKey('customer/account'); - Yii::$service->customer->loginSuccessRedirect('customer/account'); - } - + return; } /** * 发送登录邮件 @@ -70,4 +66,4 @@ class Login { -} \ No newline at end of file +} diff --git a/app/apphtml5/modules/Customer/block/address/Edit.php b/app/apphtml5/modules/Customer/block/address/Edit.php index b68ad08e32395c6772d9fc62e3c2dbc560de74d5..c1977bf7a51822bd03f09e12088c79d464ff167d 100644 --- a/app/apphtml5/modules/Customer/block/address/Edit.php +++ b/app/apphtml5/modules/Customer/block/address/Edit.php @@ -221,7 +221,7 @@ class Edit { $identity = Yii::$app->user->identity; $arr['customer_id'] = $identity['id']; Yii::$service->customer->address->save($arr); - Yii::$service->url->redirectByUrlKey('customer/address'); + return Yii::$service->url->redirectByUrlKey('customer/address'); } @@ -230,4 +230,4 @@ class Edit { -} \ No newline at end of file +} diff --git a/app/apphtml5/modules/Customer/block/order/Reorder.php b/app/apphtml5/modules/Customer/block/order/Reorder.php index d8cdcb99a691e514f53255560a48b1d7e63aca0c..e1df3328211c30a27992a74bd9460536068a5126 100644 --- a/app/apphtml5/modules/Customer/block/order/Reorder.php +++ b/app/apphtml5/modules/Customer/block/order/Reorder.php @@ -20,18 +20,18 @@ class Reorder { public function getLastData(){ $order_id = Yii::$app->request->get('order_id'); if(!$order_id){ - $this->errorMessage('The order id is empty'); + return $this->errorMessage('The order id is empty'); } $order = Yii::$service->order->getByPrimaryKey($order_id); if(!$order['increment_id']){ - $this->errorMessage('The order is not exist'); + return $this->errorMessage('The order is not exist'); } $customer_id = Yii::$app->user->identity->id; if(!$order['customer_id'] || ($order['customer_id'] != $customer_id)){ - $this->errorMessage('The order does not belong to you'); + return $this->errorMessage('The order does not belong to you'); } $this->addOrderProductToCart($order_id); - Yii::$service->url->redirectByUrlKey('checkout/cart'); + return Yii::$service->url->redirectByUrlKey('checkout/cart'); } public function addOrderProductToCart($order_id){ $items = Yii::$service->order->item->getByOrderId($order_id); @@ -55,10 +55,9 @@ class Reorder { */ public function errorMessage($message){ Yii::$service->page->message->addError($message); - Yii::$service->url->redirectByUrlKey('customer/order'); - exit; + return Yii::$service->url->redirectByUrlKey('customer/order'); } -} \ No newline at end of file +} diff --git a/app/apphtml5/modules/Customer/controllers/AccountController.php b/app/apphtml5/modules/Customer/controllers/AccountController.php index ad9a8ff0093a2618b502a78f1bc3833a5d7fe531..cfabda6093ed68de375243d3c22b1acf6266d3b6 100644 --- a/app/apphtml5/modules/Customer/controllers/AccountController.php +++ b/app/apphtml5/modules/Customer/controllers/AccountController.php @@ -37,7 +37,7 @@ class AccountController extends AppfrontController /** * 登录 */ - public function actionLogin() + public function actionLogin() { /** $toEmail = 'zqy234@126.com'; @@ -51,6 +51,9 @@ class AccountController extends AppfrontController $param = Yii::$app->request->post('editForm'); if(!empty($param) && is_array($param)){ $this->getBlock()->login($param); + if(!Yii::$app->user->isGuest){ + return Yii::$service->customer->loginSuccessRedirect('customer/account'); + } } $data = $this->getBlock()->getLastData($param); return $this->render($this->action->id,$data); @@ -82,7 +85,7 @@ class AccountController extends AppfrontController if(isset($params_register['loginSuccessRedirectUrlKey']) && $params_register['loginSuccessRedirectUrlKey'] ){ $urlKey = $params_register['loginSuccessRedirectUrlKey']; } - Yii::$service->customer->loginSuccessRedirect($urlKey); + return Yii::$service->customer->loginSuccessRedirect($urlKey); } } } diff --git a/app/apphtml5/modules/Customer/controllers/AddressController.php b/app/apphtml5/modules/Customer/controllers/AddressController.php index d365086e8be848b3b7d121187e99aa021f56a471..f3d95a57c79188269af088f76dda3669a01b9be1 100644 --- a/app/apphtml5/modules/Customer/controllers/AddressController.php +++ b/app/apphtml5/modules/Customer/controllers/AddressController.php @@ -22,7 +22,7 @@ class AddressController extends AppfrontController public function init(){ if(Yii::$app->user->isGuest){ - Yii::$service->url->redirectByUrlKey('customer/account/login'); + return Yii::$service->url->redirectByUrlKey('customer/account/login'); } parent::init(); } diff --git a/app/apphtml5/modules/Customer/controllers/EditaccountController.php b/app/apphtml5/modules/Customer/controllers/EditaccountController.php index 76c1a753873c0d9e89cc17decdad322471de0113..b497b2ecbbd3863f4a2730e9e4fa4a63582ea02b 100644 --- a/app/apphtml5/modules/Customer/controllers/EditaccountController.php +++ b/app/apphtml5/modules/Customer/controllers/EditaccountController.php @@ -21,7 +21,7 @@ class EditaccountController extends AppfrontController public function init(){ if(Yii::$app->user->isGuest){ - Yii::$service->url->redirectByUrlKey('customer/account/login'); + return Yii::$service->url->redirectByUrlKey('customer/account/login'); } parent::init(); } diff --git a/app/apphtml5/modules/Customer/controllers/OrderController.php b/app/apphtml5/modules/Customer/controllers/OrderController.php index 9e9a724e2a4f8ca7b7cf0613142c2fe283f0b3a0..9c6768aa52bb6f5374373b604e3346f2edaa30fe 100644 --- a/app/apphtml5/modules/Customer/controllers/OrderController.php +++ b/app/apphtml5/modules/Customer/controllers/OrderController.php @@ -21,7 +21,7 @@ class OrderController extends AppfrontController public function init(){ if(Yii::$app->user->isGuest){ - Yii::$service->url->redirectByUrlKey('customer/account/login'); + return Yii::$service->url->redirectByUrlKey('customer/account/login'); } parent::init(); } @@ -39,7 +39,7 @@ class OrderController extends AppfrontController } public function actionReorder(){ - $this->getBlock()->getLastData(); + return $this->getBlock()->getLastData(); //return $this->render($this->action->id,$data); } diff --git a/app/apphtml5/modules/Customer/controllers/PointController.php b/app/apphtml5/modules/Customer/controllers/PointController.php index ea89aabb38db1689f3694bc8cf9a061f78a714ad..05171d4a283ada16c9f4e7463eefe4dc972d1dac 100644 --- a/app/apphtml5/modules/Customer/controllers/PointController.php +++ b/app/apphtml5/modules/Customer/controllers/PointController.php @@ -21,7 +21,7 @@ class PointController extends AppfrontController public function init(){ if(Yii::$app->user->isGuest){ - Yii::$service->url->redirectByUrlKey('customer/account/login'); + return Yii::$service->url->redirectByUrlKey('customer/account/login'); } parent::init(); } diff --git a/app/apphtml5/modules/Customer/controllers/ProductfavoriteController.php b/app/apphtml5/modules/Customer/controllers/ProductfavoriteController.php index ef3c2188a227f9d6f97469505638b058091f326c..bb4887aa0ba1fb1e2441b8ae34ceacaf976e11b1 100644 --- a/app/apphtml5/modules/Customer/controllers/ProductfavoriteController.php +++ b/app/apphtml5/modules/Customer/controllers/ProductfavoriteController.php @@ -21,7 +21,7 @@ class ProductfavoriteController extends AppfrontController public function init(){ if(Yii::$app->user->isGuest){ - Yii::$service->url->redirectByUrlKey('customer/account/login'); + return Yii::$service->url->redirectByUrlKey('customer/account/login'); } parent::init(); } diff --git a/app/apphtml5/modules/Customer/controllers/ProductreviewController.php b/app/apphtml5/modules/Customer/controllers/ProductreviewController.php index 2cf147cf93ee35253468d5e8c5785409bd72ce1d..9ba92db5ccec9a2a91e0b38bac9c9e997cd31de8 100644 --- a/app/apphtml5/modules/Customer/controllers/ProductreviewController.php +++ b/app/apphtml5/modules/Customer/controllers/ProductreviewController.php @@ -21,7 +21,7 @@ class ProductreviewController extends AppfrontController public function init(){ if(Yii::$app->user->isGuest){ - Yii::$service->url->redirectByUrlKey('customer/account/login'); + return Yii::$service->url->redirectByUrlKey('customer/account/login'); } parent::init(); } diff --git a/app/apphtml5/modules/Payment/block/paypal/express/Review.php b/app/apphtml5/modules/Payment/block/paypal/express/Review.php index 6f3ba2e1e8e3ca2a05f5cfc7dd757f7bb74fcc8a..54c9875373803ddabc8dff20d2cf3cd901d47a63 100644 --- a/app/apphtml5/modules/Payment/block/paypal/express/Review.php +++ b/app/apphtml5/modules/Payment/block/paypal/express/Review.php @@ -56,7 +56,7 @@ class Review { $cartInfo = Yii::$service->cart->getCartInfo(); if(!isset($cartInfo['products']) || !is_array($cartInfo['products']) || empty($cartInfo['products'])){ - Yii::$service->url->redirectByUrlKey('checkout/cart'); + return Yii::$service->url->redirectByUrlKey('checkout/cart'); } $currency_info = Yii::$service->page->currency->getCurrencyInfo(); $this->initAddress(); diff --git a/app/apphtml5/modules/Payment/controllers/paypal/ExpressController.php b/app/apphtml5/modules/Payment/controllers/paypal/ExpressController.php index 13eddb7606739ff42a1fae075b121f120992a9df..1c659a99c9d41ca7f18a843ac2539d1aae85101c 100644 --- a/app/apphtml5/modules/Payment/controllers/paypal/ExpressController.php +++ b/app/apphtml5/modules/Payment/controllers/paypal/ExpressController.php @@ -34,7 +34,11 @@ class ExpressController extends AppfrontController } } $data = $this->getBlock()->getLastData(); - return $this->render($this->action->id,$data); + if(is_array($data) && !empty($data)){ + return $this->render($this->action->id,$data); + }else{ + return $data; + } } diff --git a/app/apphtml5/modules/Payment/controllers/paypal/StandardController.php b/app/apphtml5/modules/Payment/controllers/paypal/StandardController.php index ee16fdcf85b9aa153e49da79f91036b0357778db..089011551569274c6ef7425a369dea7e7b52c92e 100644 --- a/app/apphtml5/modules/Payment/controllers/paypal/StandardController.php +++ b/app/apphtml5/modules/Payment/controllers/paypal/StandardController.php @@ -26,7 +26,7 @@ class StandardController extends AppfrontController if(is_array($data) && !empty($data)){ return $this->render($this->action->id,$data); }else{ - Yii::$service->url->redirectByUrlKey('checkout/onepage'); + return Yii::$service->url->redirectByUrlKey('checkout/onepage'); } } @@ -45,8 +45,7 @@ class StandardController extends AppfrontController public function actionCancel(){ Yii::$service->order->cancel(); - Yii::$service->url->redirectByUrlKey('checkout/onepage'); - exit; + return Yii::$service->url->redirectByUrlKey('checkout/onepage'); } public function actionTest(){ diff --git a/services/Customer.php b/services/Customer.php index 6e993e81283a45cdb22ea050f437172338797cff..d7536ae609780807e431d66e3726fb8e104664bd 100644 --- a/services/Customer.php +++ b/services/Customer.php @@ -288,10 +288,10 @@ class Customer extends Service Yii::$app->session->remove($this::USER_LOGIN_SUCCESS_REDIRECT_URL_KEY); //echo Yii::$app->session->get($this::USER_LOGIN_SUCCESS_REDIRECT_URL_KEY); //exit; - Yii::$service->url->redirect($url); + return Yii::$service->url->redirect($url); }else{ - Yii::$service->url->redirectByUrlKey($urlKey); + return Yii::$service->url->redirectByUrlKey($urlKey); } } /** @@ -394,4 +394,4 @@ class Customer extends Service return $authnum; } -} \ No newline at end of file +}