Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
newShopBack
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
newshop
newShopBack
Commits
8d1196f2
Commit
8d1196f2
authored
Dec 19, 2019
by
孙磊
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'development' of
http://gitlab-ebiz.yiyao365.cn/newshop/newshopback
into development
parents
bf6ae17a
2cfbfc33
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
24 deletions
+20
-24
BaseController.php
backend/controllers/v1/BaseController.php
+17
-21
ManageListController.php
backend/controllers/v1/authority/ManageListController.php
+3
-3
No files found.
backend/controllers/v1/BaseController.php
View file @
8d1196f2
<?php
<?php
namespace
backend\controllers\v1
;
namespace
backend\controllers\v1
;
use
Yii
;
use
Yii
;
...
@@ -10,7 +9,6 @@ use yii\filters\auth\HttpBearerAuth;
...
@@ -10,7 +9,6 @@ use yii\filters\auth\HttpBearerAuth;
use
yii\filters\auth\QueryParamAuth
;
use
yii\filters\auth\QueryParamAuth
;
use
yii\filters\Cors
;
use
yii\filters\Cors
;
use
backend\components\v1\authorizationFilter
;
use
backend\components\v1\authorizationFilter
;
/**
/**
* Base controller
* Base controller
* 基类
* 基类
...
@@ -22,7 +20,7 @@ use backend\components\v1\authorizationFilter;
...
@@ -22,7 +20,7 @@ use backend\components\v1\authorizationFilter;
* ),
* ),
* @OA\Server(
* @OA\Server(
* description="Api server",
* description="Api server",
* url="/
guoyongzhi/weiShopNew
",
* url="/
zhangxiaolin/newshopback
",
* ),
* ),
* @OA\SecurityScheme(
* @OA\SecurityScheme(
* securityScheme="Authorization",
* securityScheme="Authorization",
...
@@ -67,10 +65,10 @@ class BaseController extends ActiveController
...
@@ -67,10 +65,10 @@ class BaseController extends ActiveController
// 跨域请求配置
// 跨域请求配置
$behaviors
=
array_merge
(
$behaviors
=
array_merge
(
[
[
'cors'
=>
[
'cors'
=>
[
'class'
=>
Cors
::
className
(),
'class'
=>
Cors
::
className
(),
'cors'
=>
[
'cors'
=>
[
'Origin'
=>
[
'http://localhost:8000'
,
'http://192.168.188.207:8000'
],
'Origin'
=>
[
'http://localhost:8000'
,
'http://192.168.188.207:8000'
],
'Access-Control-Request-Method'
=>
[
'GET'
,
'POST'
,
'PUT'
,
'PATCH'
,
'DELETE'
,
'HEAD'
,
'OPTIONS'
],
'Access-Control-Request-Method'
=>
[
'GET'
,
'POST'
,
'PUT'
,
'PATCH'
,
'DELETE'
,
'HEAD'
,
'OPTIONS'
],
'Access-Control-Request-Headers'
=>
[
'*'
],
'Access-Control-Request-Headers'
=>
[
'*'
],
'Access-Control-Allow-Credentials'
=>
true
,
'Access-Control-Allow-Credentials'
=>
true
,
...
@@ -78,20 +76,18 @@ class BaseController extends ActiveController
...
@@ -78,20 +76,18 @@ class BaseController extends ActiveController
'Access-Control-Expose-Headers'
=>
[
'*'
],
'Access-Control-Expose-Headers'
=>
[
'*'
],
],
],
]
]
],
],
$behaviors
);
$behaviors
);
// 格式化输出请求
// 格式化输出请求
$behaviors
[
'contentNegotiator'
][
'formats'
][
'text/html'
]
=
Response
::
FORMAT_JSON
;
$behaviors
[
'contentNegotiator'
][
'formats'
][
'text/html'
]
=
Response
::
FORMAT_JSON
;
//
认证
//认证
$behaviors
[
'HttpBearerAuth'
]
=
[
$behaviors
[
'HttpBearerAuth'
]
=
[
'class'
=>
HttpBearerAuth
::
className
(),
'class'
=>
HttpBearerAuth
::
className
(),
'optional'
=>
[
'login'
],
'optional'
=>
[
'login'
],
];
];
// 授权
// 授权
$behaviors
[
'authorizationFilter'
]
=
[
$behaviors
[
'authorizationFilter'
]
=
[
'class'
=>
authorizationFilter
::
className
(),
'class'
=>
authorizationFilter
::
className
(),
'optional'
=>
[
'login'
],
//过滤不需要验证的action
'optional'
=>
[
'login'
],
//过滤不需要验证的action
];
];
return
$behaviors
;
return
$behaviors
;
}
}
...
...
backend/controllers/v1/authority/ManageListController.php
View file @
8d1196f2
...
@@ -61,7 +61,7 @@ class ManageListController extends BaseController
...
@@ -61,7 +61,7 @@ class ManageListController extends BaseController
*/
*/
public
function
actionManageGroupList
(){
public
function
actionManageGroupList
(){
$model
=
new
ShopRbacRole
();
$model
=
new
ShopRbacRole
();
$info
=
$model
::
find
()
->
select
([
'
GU
ID'
,
'NAME'
])
->
where
([
'ORG_GUID'
=>
Yii
::
$app
->
user
->
identity
->
ORG_GUID
])
->
all
();
$info
=
$model
::
find
()
->
select
([
'ID'
,
'NAME'
])
->
where
([
'ORG_GUID'
=>
Yii
::
$app
->
user
->
identity
->
ORG_GUID
])
->
all
();
return
[
'code'
=>
200
,
'info'
=>
$info
];
return
[
'code'
=>
200
,
'info'
=>
$info
];
}
}
/**
/**
...
@@ -88,11 +88,11 @@ class ManageListController extends BaseController
...
@@ -88,11 +88,11 @@ class ManageListController extends BaseController
$shopUserModel
=
new
ShopUserList
();
$shopUserModel
=
new
ShopUserList
();
$param
=
Yii
::
$app
->
request
->
get
();
$param
=
Yii
::
$app
->
request
->
get
();
$column
=
array
(
'su.GUID'
,
'su.CODE'
,
'su.NAME
'
,
'su.MOBILE_PHONE'
,
'su.CONTACT_SEX'
,
'su.AGE'
,
'sb.
NAME'
);
$column
=
array
(
'su.GUID'
,
'su.CODE'
,
'su.NAME
as USERNAME'
,
'su.MOBILE_PHONE'
,
'su.CONTACT_SEX'
,
'su.AGE'
,
'sb.NAME as BRANCH
NAME'
);
$userInfo
=
$shopUserModel
::
find
()
->
select
(
$column
)
$userInfo
=
$shopUserModel
::
find
()
->
select
(
$column
)
->
leftJoin
(
'shop_branch as sb'
,
'sb.GUID=su.BRANCH_GUID'
)
->
leftJoin
(
'shop_branch as sb'
,
'sb.GUID=su.BRANCH_GUID'
)
->
where
([
'like'
,
'su.CODE'
,
$param
[
'MOBILE_PHONE'
]])
->
where
([
'like'
,
'su.CODE'
,
$param
[
'MOBILE_PHONE'
]])
->
andFilterWhere
([
'BELONG'
=>
1
])
->
andFilterWhere
([
'
su.
BELONG'
=>
1
])
->
from
(
'shop_user as su'
)
->
from
(
'shop_user as su'
)
->
asArray
()
->
asArray
()
->
one
();
->
one
();
...
...
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