zhangchangchun 6 年之前
父节点
当前提交
417c124264
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      app/Http/Controllers/V1/ShopController.php

+ 5 - 1
app/Http/Controllers/V1/ShopController.php

@@ -111,7 +111,11 @@ class ShopController extends Controller {
     public function getTokenShop(Request $request){
         $data =  JWTAuth::decode(JWTAuth::getToken())['shop'];
         if($data->shop_id){
-            return $this->jsonSuccess(Shop::where(['shop_id'=>$data->shop_id])->first());
+            $shop = Shop::where(['shop_id'=>$data->shop_id])->first();
+            $fractal = new Manager();
+            $res = new Item($shop,new ShopsTransformer());
+            $data = $fractal->createData($res)->toArray();
+            return $this->jsonSuccess($data);
         }else{
             return $this->jsonError('操作失败');
         }