Commit 2cfbfc33 authored by 张晓林's avatar 张晓林

解决冲突

parent 26c1e461
<?php
namespace backend\controllers\v1;
use Yii;
......@@ -10,7 +9,6 @@ use yii\filters\auth\HttpBearerAuth;
use yii\filters\auth\QueryParamAuth;
use yii\filters\Cors;
use backend\components\v1\authorizationFilter;
/**
* Base controller
* 基类
......@@ -22,7 +20,7 @@ use backend\components\v1\authorizationFilter;
* ),
* @OA\Server(
* description="Api server",
* url="/guoyongzhi/weiShopNew",
* url="/zhangxiaolin/newshopback",
* ),
* @OA\SecurityScheme(
* securityScheme="Authorization",
......@@ -67,10 +65,10 @@ class BaseController extends ActiveController
// 跨域请求配置
$behaviors = array_merge(
[
'cors' => [
'cors'=>[
'class' => Cors::className(),
'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-Headers' => ['*'],
'Access-Control-Allow-Credentials' => true,
......@@ -78,20 +76,18 @@ class BaseController extends ActiveController
'Access-Control-Expose-Headers' => ['*'],
],
]
],
$behaviors
);
],$behaviors);
// 格式化输出请求
$behaviors['contentNegotiator']['formats']['text/html'] = Response::FORMAT_JSON;
// 认证
$behaviors['HttpBearerAuth'] = [
//认证
$behaviors['HttpBearerAuth']=[
'class' => HttpBearerAuth::className(),
'optional' => ['login'],
];
// 授权
$behaviors['authorizationFilter'] = [
$behaviors['authorizationFilter']=[
'class' => authorizationFilter::className(),
'optional' => ['login'], //过滤不需要验证的action
'optional' => ['login'],//过滤不需要验证的action
];
return $behaviors;
}
......
......@@ -61,7 +61,7 @@ class ManageListController extends BaseController
*/
public function actionManageGroupList(){
$model = new ShopRbacRole();
$info = $model::find()->select(['GUID','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];
}
/**
......@@ -88,11 +88,11 @@ class ManageListController extends BaseController
$shopUserModel = new ShopUserList();
$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 BRANCHNAME');
$userInfo = $shopUserModel::find()->select($column)
->leftJoin('shop_branch as sb','sb.GUID=su.BRANCH_GUID')
->where(['like', 'su.CODE', $param['MOBILE_PHONE']])
->andFilterWhere(['BELONG'=>1])
->andFilterWhere(['su.BELONG'=>1])
->from('shop_user as su')
->asArray()
->one();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment