|
@@ -36,8 +36,8 @@ class Cart extends Controller
|
|
|
{
|
|
|
$userId = Session::get('user_id');
|
|
|
if (empty($userId)) {
|
|
|
- Cache::set('returnuri','/index/cart/shoppingCart.html');
|
|
|
- return redirect('/index/passport/login');
|
|
|
+ Cache::set('returnuri', '/index/cart/shoppingCart.html', 300);
|
|
|
+ return redirect('/index/passport/login.html');
|
|
|
//return view('passport/logIn');
|
|
|
}
|
|
|
|
|
@@ -140,12 +140,12 @@ class Cart extends Controller
|
|
|
*/
|
|
|
public function add(int $goodsId, string $goodsSkuId, int $goodsNum): Json
|
|
|
{
|
|
|
+ $key = $this->request->param('key', '');
|
|
|
$userId = Session::get('user_id');
|
|
|
if (empty($userId)) {
|
|
|
+ Cache::set('returnuri', '/index/index/productDetails.html?goodsId=' . $goodsId . '&key=' . $key, 300);
|
|
|
return $this->renderJson(config('status.not_logged'), 'Log in please!');
|
|
|
}
|
|
|
-
|
|
|
- $key = $this->request->param('key', null);
|
|
|
if (!empty($key)) {
|
|
|
Cache::set(\app\index\model\User::SHARE_PREFIX . $userId, $key, 3600 * 24 * 30);
|
|
|
}
|