Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
semour
/
semour_web
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
507711ea
authored
Nov 23, 2022
by
SUDPTDUBLXEROFX\Administrator
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
no message
parent
73d8ff25
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
app/Http/Middleware/CheckApiLogin.php
app/Http/Services/CartService.php
app/Http/Middleware/CheckApiLogin.php
View file @
507711ea
...
@@ -7,7 +7,7 @@ use Closure;
...
@@ -7,7 +7,7 @@ use Closure;
class
CheckApiLogin
class
CheckApiLogin
{
{
public
$no_login_url
=
[
"api/cart/cartLists"
,
"api/cart/cartMyCount"
];
public
$no_login_url
=
[
"api/cart/
saveCart"
,
"api/cart/
cartLists"
,
"api/cart/cartMyCount"
];
/**
/**
* Handle an incoming request.
* Handle an incoming request.
...
@@ -20,7 +20,7 @@ class CheckApiLogin
...
@@ -20,7 +20,7 @@ class CheckApiLogin
{
{
if
(
!
\Auth
::
check
()
)
{
if
(
!
\Auth
::
check
()
)
{
if
(
in_array
(
$request
->
path
(),
$this
->
no_login_url
)){
//一些接口可以登录或者不登录都可以通行
if
(
in_array
(
$request
->
path
(),
$this
->
no_login_url
)){
//一些接口可以登录或者不登录都可以通行
request
()
->
offsetSet
(
"user"
,(
object
)[
"id"
=>
0
,
"gid"
=>
$request
->
cookie
(
'sem_gid'
)]);
request
()
->
offsetSet
(
"user"
,(
object
)[
"id"
=>
0
,
"gid"
=>
\Arr
::
get
(
$_COOKIE
,
"sem_gid"
)]);
return
$next
(
$request
);
return
$next
(
$request
);
}
else
{
}
else
{
$response
=
[
$response
=
[
...
...
app/Http/Services/CartService.php
View file @
507711ea
...
@@ -93,6 +93,11 @@ class CartService
...
@@ -93,6 +93,11 @@ class CartService
$te
=
[
$te
=
[
"cart_id"
=>
$cart_id
,
"cart_id"
=>
$cart_id
,
"goods_id"
=>
$goods_id
,
"goods_id"
=>
$goods_id
,
"goods_name"
=>
$skuInfo
[
"goods_name"
],
"brand_id"
=>
$skuInfo
[
"brand_id"
],
"brand_name"
=>
$skuInfo
[
"brand_name"
],
"supplier_id"
=>
$skuInfo
[
"supplier_id"
],
"supplier_name"
=>
$skuInfo
[
"supplier_name"
],
"buy_price"
=>
$buy_price
,
"buy_price"
=>
$buy_price
,
"buy_number"
=>
$buy_number
,
"buy_number"
=>
$buy_number
,
"ext_price"
=>
round
(
$buy_price
*
$buy_number
,
2
),
"ext_price"
=>
round
(
$buy_price
*
$buy_number
,
2
),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment