pull/1/head
wanghousheng 10 months ago
parent ca7678cea6
commit 84ffb847d5
  1. 14
      app/api/controller/Article.php

@ -61,7 +61,7 @@ class Article extends Controller
*/
public function add(): Json
{
if (UserService::isStore()) {
if (!UserService::isStore()) {
throwError("无权限", 403);
}
$title = $this->request->post('title');
@ -97,7 +97,7 @@ class Article extends Controller
*/
public function edit(): Json
{
if (UserService::isStore()) {
if (!UserService::isStore()) {
throwError("无权限", 403);
}
$articleId = intval($this->request->post('article_id'));
@ -140,7 +140,7 @@ class Article extends Controller
*/
public function delete(): Json
{
if (UserService::isStore()) {
if (!UserService::isStore()) {
throwError("无权限", 403);
}
$articleId = intval($this->request->post('article_id'));
@ -163,7 +163,7 @@ class Article extends Controller
*/
public function addCategory(): Json
{
if (UserService::isStore()) {
if (!UserService::isStore()) {
throwError("无权限", 403);
}
$name = $this->request->post('name');
@ -191,7 +191,7 @@ class Article extends Controller
*/
public function editCategory(): Json
{
if (UserService::isStore()) {
if (!UserService::isStore()) {
throwError("无权限", 403);
}
$categoryId = intval($this->request->post('category_id'));
@ -226,7 +226,7 @@ class Article extends Controller
*/
public function delCategory(): Json
{
if (UserService::isStore()) {
if (!UserService::isStore()) {
throwError("无权限", 403);
}
$categoryId = intval($this->request->post('category_id'));
@ -250,7 +250,7 @@ class Article extends Controller
*/
public function categoryList(): Json
{
if (UserService::isStore()) {
if (!UserService::isStore()) {
throwError("无权限", 403);
}
$model = new \app\api\model\article\Category;

Loading…
Cancel
Save