Commit 319bb49e by 庄欣

不能给自己发片

parent f934713d
......@@ -74,7 +74,12 @@ class Photo extends ControllerBase
{
try {
$client = app("client");
$client->post($this->prefix,array_merge($request->all(),['pg_id' => $this->getAuth()]));
$userid = $this->getAuth();
$data = $request->all();
if ($userid == $data['uid']) {
return Response::error("不能给自己发片");
}
$client->post($this->prefix,array_merge($data,['pg_id' => $userid]));
return Response::ok();
} catch (ApiUnauthorized $e) {
return Response::error($e->getMessage(), HttpStatus::HttpUnauthorized);
......
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