wzq 5 anni fa
parent
commit
94761499df

+ 1 - 1
app/Http/Controllers/Post/PostController.php

@@ -166,7 +166,7 @@ class PostController extends Controller
             'video' => 'required_if:type,video|string|url',
             'topic_ids' => 'required|string|max:64',
             'title' => 'nullable|string|max:20',
-            'content' => 'required|string|max:1000',
+            'content' => 'required|string',
             'location' => 'nullable|string|max:20',
             'imgs' => 'required_if:type,image|array|max:9',
             'imgs.*' => 'required|url',

+ 11 - 10
app/Repositories/Post/PostRepository.php

@@ -59,13 +59,14 @@ class PostRepository
     public function create($request)
     {
         //验证小号
-        $userInfo = $this->getUserInfo($request['uid']);
-        if(!$userInfo || $userInfo['type'] != 1){
-            return Response::create([
-                'message'  => '所选小号信息有误',
-                'status_code'   => 500
-            ]);
-        }
+        //todo 小号   内容过滤html标签
+//        $userInfo = $this->getUserInfo($request['uid']);
+//        if(!$userInfo || $userInfo['type'] != 1){
+//            return Response::create([
+//                'message'  => '所选小号信息有误',
+//                'status_code'   => 500
+//            ]);
+//        }
         //验证话题
         $topicIds = $this->topic->whereIn('id', explode(',', $request['topic_ids']))->pluck('id')->toArray();
         $topicCount = count($topicIds);
@@ -79,9 +80,9 @@ class PostRepository
 
         $data = [
             'uid' => $request['uid'],
-            'username' => $userInfo['username'],
-            'mobile' => $userInfo['mobile'],
-            'avatar' => $userInfo['avatar'],
+            'username' => '暂无',
+            'mobile' => '13720758488',
+            'avatar' => 'https://wx.qlogo.cn/mmopen/vi_32/DYAIOgq83ep3asJn8emiat1MnPdviaPNroWY3f65y5ezkTAk2qtibv7ea9Ht9R2ahxr9bicY1DIj5vN5FibpDOwXegg/132',
             'type' => $request['type'],
             'img' => $request['img'],
             'video' => $request['video']??'',