From db94cd49ed1211dff7402000e5d0ee66864e013e Mon Sep 17 00:00:00 2001 From: yaooo <272523191@qq.com> Date: Mon, 6 Nov 2023 11:23:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=9D=83=E9=99=90=E5=88=A4?= =?UTF-8?q?=E5=AE=9A=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/ArticleIndex.php | 2 +- app/api/controller/Common.php | 6 +++--- app/api/controller/FinanceExpense.php | 4 ++-- app/api/controller/FinanceIncome.php | 2 +- app/api/controller/FinanceInvoice.php | 8 ++++---- app/api/controller/OaApprove.php | 6 +++--- app/api/controller/ProjectIndex.php | 4 ++-- app/api/controller/ProjectTask.php | 4 ++-- 8 files changed, 18 insertions(+), 18 deletions(-) diff --git a/app/api/controller/ArticleIndex.php b/app/api/controller/ArticleIndex.php index 701036e..c30b706 100644 --- a/app/api/controller/ArticleIndex.php +++ b/app/api/controller/ArticleIndex.php @@ -88,7 +88,7 @@ class ArticleIndex extends ApiController $share_dids = explode(',', $detail['share_dids']); } if($detail['uid'] !=$uid && !in_array($uid,$share_uids) && !in_array($did,$share_dids) && $detail['is_share'] !=1){ - $this->apiError("无权限访问"); + $this->apiError('用户无权限', [], 2); } $detail['cate_title'] = Db::name('ArticleCate')->where(['id' => $detail['cate_id']])->value('title'); if($detail['file_ids'] !=''){ diff --git a/app/api/controller/Common.php b/app/api/controller/Common.php index 81e6b59..f10b339 100644 --- a/app/api/controller/Common.php +++ b/app/api/controller/Common.php @@ -293,7 +293,7 @@ class Common extends ApiController if($param['check'] == 1){ $check_admin_ids = explode(",", strval($detail['check_admin_ids'])); if (!in_array($this->uid, $check_admin_ids)){ - $this->apiError("您没权限审核该审批"); + $this->apiError("您没权限审核该审批", [], 2); } //多人会签审批 @@ -435,7 +435,7 @@ class Common extends ApiController else if($param['check'] == 2){ $check_admin_ids = explode(",", strval($detail['check_admin_ids'])); if (!in_array($this->uid, $check_admin_ids)){ - $this->apiError("您没权限审核该审批"); + $this->apiError("您没权限审核该审批", [], 2); } //拒绝审核,数据操作 $param['check_status'] = 3; @@ -504,7 +504,7 @@ class Common extends ApiController } else if($param['check'] == 3){ if($detail['admin_id'] != $this->uid){ - $this->apiError("你没权限操作"); + $this->apiError("你没权限操作", [], 2); } //撤销审核,数据操作 $param['check_status'] = 4; diff --git a/app/api/controller/FinanceExpense.php b/app/api/controller/FinanceExpense.php index a032db2..afdbe03 100644 --- a/app/api/controller/FinanceExpense.php +++ b/app/api/controller/FinanceExpense.php @@ -506,7 +506,7 @@ class FinanceExpense extends ApiController $this->uid = JWT_UID; $auth = isAuthExpense($this->uid); if($auth == 0){ - $this->apiError('你没有权限,请联系管理员或者HR'); + $this->apiError('你没有权限,请联系管理员或者HR', [], 2); } $param = get_params(); $where = []; @@ -533,7 +533,7 @@ class FinanceExpense extends ApiController $this->uid = JWT_UID; $auth = isAuthExpense($this->uid); if($auth == 0){ - $this->apiError('你没有打款权限,请联系管理员或者HR'); + $this->apiError('你没有打款权限,请联系管理员或者HR', [], 2); } $expense = (new ExpenseList())->detail($param['id'] ?? 0); if (empty($expense)) { diff --git a/app/api/controller/FinanceIncome.php b/app/api/controller/FinanceIncome.php index bc8a094..6b7d349 100644 --- a/app/api/controller/FinanceIncome.php +++ b/app/api/controller/FinanceIncome.php @@ -56,7 +56,7 @@ class FinanceIncome extends ApiController $this->uid = JWT_UID; $auth = isAuthIncome($this->uid); if($auth == 0){ - $this->apiError("你没有到账管理权限,请联系管理员或者HR"); + $this->apiError("你没有到账管理权限,请联系管理员或者HR", [], 2); } if (empty($param['enter_type'])) { $this->apiError("到账类型不能为空"); diff --git a/app/api/controller/FinanceInvoice.php b/app/api/controller/FinanceInvoice.php index b6ae7f8..24e9a3a 100644 --- a/app/api/controller/FinanceInvoice.php +++ b/app/api/controller/FinanceInvoice.php @@ -102,7 +102,7 @@ class FinanceInvoice extends ApiController $this->uid = JWT_UID; $auth = isAuthInvoice($this->uid); if($auth == 0){ - $this->apiError('你没有权限,请联系管理员或者HR'); + $this->apiError('你没有权限,请联系管理员或者HR', [], 2); } $param = get_params(); $where = []; @@ -455,7 +455,7 @@ class FinanceInvoice extends ApiController $this->uid = JWT_UID; $auth = isAuthInvoice($this->uid); if($auth == 0){ - $this->apiError("你没有开票权限,请联系管理员或者HR"); + $this->apiError("你没有开票权限,请联系管理员或者HR", [], 2); } if (empty($param['id'])) { $this->apiError("id不能为空"); @@ -490,7 +490,7 @@ class FinanceInvoice extends ApiController $this->uid = JWT_UID; $auth = isAuthInvoice($this->uid); if($auth == 0){ - $this->apiError("你没有开票权限,请联系管理员或者HR"); + $this->apiError("你没有开票权限,请联系管理员或者HR", [], 2); } if (empty($param['id'])) { $this->apiError("id不能为空"); @@ -521,7 +521,7 @@ class FinanceInvoice extends ApiController $this->uid = JWT_UID; $auth = isAuthInvoice($this->uid); if($auth == 0){ - $this->apiError("你没有开票权限,请联系管理员或者HR"); + $this->apiError("你没有开票权限,请联系管理员或者HR", [], 2); } if (empty($param['id'])) { $this->apiError("id不能为空"); diff --git a/app/api/controller/OaApprove.php b/app/api/controller/OaApprove.php index 49eeff2..01d66c1 100644 --- a/app/api/controller/OaApprove.php +++ b/app/api/controller/OaApprove.php @@ -308,7 +308,7 @@ class OaApprove extends ApiController if($param['check'] == 1){ $check_admin_ids = explode(",", strval($detail['check_admin_ids'])); if (!in_array($this->uid, $check_admin_ids)){ - $this->apiError("您没权限审核该审批"); + $this->apiError("您没权限审核该审批", [], 2); } //多人会签审批 @@ -450,7 +450,7 @@ class OaApprove extends ApiController else if($param['check'] == 2){ $check_admin_ids = explode(",", strval($detail['check_admin_ids'])); if (!in_array($this->uid, $check_admin_ids)){ - $this->apiError("您没权限审核该审批"); + $this->apiError("您没权限审核该审批", [], 2); } //拒绝审核,数据操作 $param['check_status'] = 3; @@ -519,7 +519,7 @@ class OaApprove extends ApiController } else if($param['check'] == 3){ if($detail['admin_id'] != $this->uid){ - $this->apiError("你没权限操作"); + $this->apiError("你没权限操作", [], 2); } //撤销审核,数据操作 $param['check_status'] = 4; diff --git a/app/api/controller/ProjectIndex.php b/app/api/controller/ProjectIndex.php index bed6cae..b27b9bc 100644 --- a/app/api/controller/ProjectIndex.php +++ b/app/api/controller/ProjectIndex.php @@ -246,7 +246,7 @@ class ProjectIndex extends ApiController } $this->apiSuccess('操作成功'); } else { - $this->apiError('只有创建人或者负责人才有权限修改项目'); + $this->apiError('只有创建人或者负责人才有权限修改项目', [], 2); } } @@ -369,7 +369,7 @@ class ProjectIndex extends ApiController } $detail = Db::name('Project')->where('id', $id)->find(); if ($detail['admin_id'] != $this->uid) { - $this->apiError('你不是该项目的创建人,无权限删除'); + $this->apiError('你不是该项目的创建人,无权限删除', [], 2); } if (Db::name('Project')->where('id', $id)->update(['delete_time' => time()]) !== false) { $log_data = array( diff --git a/app/api/controller/ProjectTask.php b/app/api/controller/ProjectTask.php index 2d662c9..dab6bbb 100644 --- a/app/api/controller/ProjectTask.php +++ b/app/api/controller/ProjectTask.php @@ -123,7 +123,7 @@ class ProjectTask extends ApiController $this->apiSuccess('获取成功', compact('detail', 'file_array')); } else{ - $this->apiError('您没权限查看该任务'); + $this->apiError('您没权限查看该任务', [], 2); } } } @@ -139,7 +139,7 @@ class ProjectTask extends ApiController $this->apiError('项目任务不存在'); } if ($detail['admin_id'] != $this->uid) { - $this->apiError('你不是该任务的创建人,无权限删除'); + $this->apiError('你不是该任务的创建人,无权限删除', [], 2); } if (Db::name('ProjectTask')->where('id', $id)->update(['delete_time' => time()]) !== false) { $log_data = array(