cqp 2 months ago
parent
commit
a30352a92a
3 changed files with 98 additions and 3 deletions
  1. 2 1
      app/Http/Middleware/CheckWeinxin.php
  2. 3 2
      app/Http/Middleware/CheckWx.php
  3. 93 0
      routes/wx.php

+ 2 - 1
app/Http/Middleware/CheckWeinxin.php

@@ -24,7 +24,8 @@ class CheckWeinxin
         if (empty($employee_id)) return response()->json(['code'=>401,'msg'=>'缺少人员id','data'=>null]);
 
         //校验openid是否绑定
-        $bool = WxEmployeeOfficial::where('openid',$token)->where('employee_id',$employee_id)->exists();
+        $appid = config("wx_msg.f_appid");
+        $bool = WxEmployeeOfficial::where('openid',$token)->where('appid',$appid)->where('employee_id',$employee_id)->exists();
         if (! $bool) return response()->json(['code'=>401,'msg'=>'用户信息错误!','data'=>null]);
 
         //校验用户

+ 3 - 2
app/Http/Middleware/CheckWx.php

@@ -20,12 +20,13 @@ class CheckWx
     public function handle($request, Closure $next)
     {
         $data = $request->all();
-
         if (!isset($data['openid'])) return response()->json(['code'=> 202,'msg'=>'缺少openid','data'=>null]);
         $openid = $data['openid'];
+
+        $appid = config("wx_msg.appid");
         //校验openid是否绑定
         $employee = new WxEmployee();
-        $employee = $employee->where('openid',$openid)->first();
+        $employee = $employee->where('openid',$openid)->where('appid',$appid)->first();
         if (empty($employee)) return response()->json(['code'=> 202,'msg'=>'用户授权信息不存在!','data'=>null]);
         $employee = $employee->toArray();
         if (empty($employee['mobile'])) return response()->json(['code'=> 202,'msg'=>'用户手机信息不存在!','data'=>null]);

+ 93 - 0
routes/wx.php

@@ -15,5 +15,98 @@ use Illuminate\Http\Request;
 Route::any('wxSetUser', 'Api\WxController@setUser');
 Route::any('wxSetMobile', 'Api\WxController@setMobile');
 Route::group(['middleware'=> ['checkWx']],function ($route){
+    $route->any('menuAdd', 'Api\SysMenuController@add');
+    $route->any('menuEdit', 'Api\SysMenuController@edit');
+    $route->any('menuDel', 'Api\SysMenuController@del');
+    $route->any('menuList', 'Api\SysMenuController@menuList');
+    $route->any('menuMove', 'Api\SysMenuController@menuMove');
 
+    $route->any('employeeAdd', 'Api\EmployeeController@employeeAdd');
+    $route->any('employeeEdit', 'Api\EmployeeController@employeeEdit');
+    $route->any('employeeEditOther', 'Api\EmployeeController@employeeEditOther');
+    $route->any('employeeDel', 'Api\EmployeeController@employeeDel');
+    $route->any('employeeDetail', 'Api\EmployeeController@employeeDetail');
+    $route->any('employeeList', 'Api\EmployeeController@employeeList');
+
+    $route->any('departAdd', 'Api\EmployeeController@departAdd');
+    $route->any('departEdit', 'Api\EmployeeController@departEdit');
+    $route->any('departDel', 'Api\EmployeeController@departDel');
+    $route->any('departList', 'Api\EmployeeController@departList');
+
+    $route->any('roleAdd', 'Api\EmployeeController@roleAdd');
+    $route->any('roleEdit', 'Api\EmployeeController@roleEdit');
+    $route->any('roleDel', 'Api\EmployeeController@roleDel');
+    $route->any('roleList', 'Api\EmployeeController@roleList');
+    $route->any('roleDetail', 'Api\EmployeeController@roleDetail');
+    $route->any('roleMenu', 'Api\EmployeeController@roleMenu');
+
+    $route->any('teamAdd', 'Api\EmployeeController@teamAdd');
+    $route->any('teamEdit', 'Api\EmployeeController@teamEdit');
+    $route->any('teamDel', 'Api\EmployeeController@teamDel');
+    $route->any('teamList', 'Api\EmployeeController@teamList');
+    $route->any('teamDetail', 'Api\EmployeeController@teamDetail');
+
+    $route->any('employeeDepart', 'Api\EmployeeController@employeeDepart');
+    $route->any('employeeTeam', 'Api\EmployeeController@employeeTeam');
+    $route->any('employeeRole', 'Api\EmployeeController@employeeRole');
+    $route->any('getEmployeeImg', 'Api\EmployeeController@getEmployeeImg');
+
+    //组织
+    $route->any('organizationList', 'Api\OrganizationController@organizationList');
+    $route->any('organizationEdit', 'Api\OrganizationController@organizationEdit');
+    $route->any('organizationAdd', 'Api\OrganizationController@organizationAdd');
+    $route->any('organizationDel', 'Api\OrganizationController@organizationDel');
+    $route->any('organizationDetail', 'Api\OrganizationController@organizationDetail');
+
+    //客户供应商
+    $route->any('customerSupplyList', 'Api\CustomerSupplyController@customerSupplyList');
+    $route->any('customerSupplyEdit', 'Api\CustomerSupplyController@customerSupplyEdit');
+    $route->any('customerSupplyAdd', 'Api\CustomerSupplyController@customerSupplyAdd');
+    $route->any('customerSupplyDel', 'Api\CustomerSupplyController@customerSupplyDel');
+    $route->any('customerSupplyDetail', 'Api\CustomerSupplyController@customerSupplyDetail');
+
+    //维度选项
+    $route->any('dimensionList', 'Api\DimensionController@dimensionList');
+    $route->any('dimensionEdit', 'Api\DimensionController@dimensionEdit');
+    $route->any('dimensionAdd', 'Api\DimensionController@dimensionAdd');
+    $route->any('dimensionDel', 'Api\DimensionController@dimensionDel');
+    $route->any('dimensionDetail', 'Api\DimensionController@dimensionDetail');
+
+    //量化
+    $route->any('quantizationList', 'Api\QuantizationController@quantizationList');
+    $route->any('quantizationEdit', 'Api\QuantizationController@quantizationEdit');
+    $route->any('quantizationAdd', 'Api\QuantizationController@quantizationAdd');
+    $route->any('quantizationDel', 'Api\QuantizationController@quantizationDel');
+    $route->any('quantizationDetail', 'Api\QuantizationController@quantizationDetail');
+
+    //订单
+    $route->any('orderList', 'Api\OrderController@orderList');
+    $route->any('orderEdit', 'Api\OrderController@orderEdit');
+    $route->any('orderAdd', 'Api\OrderController@orderAdd');
+    $route->any('orderDel', 'Api\OrderController@orderDel');
+    $route->any('orderDetail', 'Api\OrderController@orderDetail');
+
+    //创建量化
+    $route->any('quantizationCreateCapList', 'Api\QuantizationController@quantizationCreateList');
+    $route->any('quantizationCreateCooList', 'Api\QuantizationController@quantizationCreateList');
+    $route->any('quantizationCreateEdit', 'Api\QuantizationController@quantizationCreateEdit');
+    $route->any('quantizationCreateAdd', 'Api\QuantizationController@quantizationCreateAdd');
+    $route->any('quantizationCreateDel', 'Api\QuantizationController@quantizationCreateDel');
+    $route->any('quantizationCreateDetail', 'Api\QuantizationController@quantizationCreateDetail');
+
+    //催单
+    $route->any('reminderList', 'Api\OrderController@reminderList');
+    $route->any('reminderEdit', 'Api\OrderController@reminderEdit');
+    $route->any('reminderAdd', 'Api\OrderController@reminderAdd');
+    $route->any('reminderDel', 'Api\OrderController@reminderDel');
+    $route->any('reminderDetail', 'Api\OrderController@reminderDetail');
+    $route->any('reminderSendWx', 'Api\OrderController@reminderSendWx');
+
+    //待办
+    $route->any('toDoList', 'Api\OrderController@toDoList');
+    $route->any('toDoEdit', 'Api\OrderController@toDoEdit');
+    $route->any('toDoAdd', 'Api\OrderController@toDoAdd');
+    $route->any('toDoDel', 'Api\OrderController@toDoDel');
+    $route->any('toDoDetail', 'Api\OrderController@toDoDetail');
+    $route->any('toDoFinished', 'Api\OrderController@toDoFinished');
 });