|
@@ -222,6 +222,13 @@ class PostRepository
|
|
|
public function comment($request)
|
|
|
{
|
|
|
//验证小号
|
|
|
+ $userInfo = $this->getUserInfo($request['uid']);
|
|
|
+ if(!$userInfo || $userInfo['type'] != 1){
|
|
|
+ return Response::create([
|
|
|
+ 'message' => '所选小号信息有误',
|
|
|
+ 'status_code' => 500
|
|
|
+ ]);
|
|
|
+ }
|
|
|
|
|
|
$post = $this->post->find($request['post_id']);
|
|
|
if(!$post){
|
|
@@ -234,8 +241,8 @@ class PostRepository
|
|
|
'uid' => $request['uid'],
|
|
|
'post_id' => $request['post_id'],
|
|
|
'parent_id' => 0,
|
|
|
- 'username' => '暂无',
|
|
|
- 'avatar' => '暂无',
|
|
|
+ 'username' => $userInfo['username'],
|
|
|
+ 'avatar' => $userInfo['avatar'],
|
|
|
'content' => $request['content'],
|
|
|
'is_delete' => 0,
|
|
|
];
|