From d951da2c029f074dc19207d81c2c92a5e3467c88 Mon Sep 17 00:00:00 2001 From: kuaifan Date: Thu, 13 Jan 2022 11:48:33 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=AE=A2=E6=88=B7?= =?UTF-8?q?=E7=AB=AF=E6=97=A7=E7=89=88=E6=9C=AC=E6=9B=B4=E6=96=B0=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E5=87=BA=E7=8E=B0=E5=B7=B2=E5=AE=8C=E6=88=90=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E4=B8=AD=E6=9C=89=E7=8A=B6=E6=80=81=E4=B8=BA=E2=80=9C?= =?UTF-8?q?=E8=BF=9B=E8=A1=8C=E4=B8=AD=E2=80=9D=E7=9A=84=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Models/ProjectTask.php | 4 ++++ app/Module/Base.php | 13 +++++++++++++ resources/views/main.blade.php | 2 +- 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/app/Models/ProjectTask.php b/app/Models/ProjectTask.php index 41bd98d8..b98ca018 100644 --- a/app/Models/ProjectTask.php +++ b/app/Models/ProjectTask.php @@ -490,6 +490,10 @@ class ProjectTask extends AbstractModel public function updateTask($data, &$updateMarking = []) { AbstractModel::transaction(function () use ($data, &$updateMarking) { + // 判断版本 + if (version_compare(Base::getClientVersion(), '0.6.0', '<')) { + throw new ApiException('当前版本过低'); + } // 工作流 if (Arr::exists($data, 'flow_item_id')) { if ($this->flow_item_id == $data['flow_item_id']) { diff --git a/app/Module/Base.php b/app/Module/Base.php index ca4ff82f..d246835c 100755 --- a/app/Module/Base.php +++ b/app/Module/Base.php @@ -74,6 +74,19 @@ class Base }); } + /** + * 获取客户端版本号 + * @return string + */ + public static function getClientVersion() + { + global $_A; + if (!isset($_A["__static_client_version"])) { + $_A["__static_client_version"] = Request::header('version') ?: '0.0.1'; + } + return $_A["__static_client_version"]; + } + /** * 判断是否域名格式 * @param $domain diff --git a/resources/views/main.blade.php b/resources/views/main.blade.php index 7838e5b6..2387982a 100755 --- a/resources/views/main.blade.php +++ b/resources/views/main.blade.php @@ -11,7 +11,7 @@ {{ config('app.name', 'WebPage') }} - +