From bcb48fcfedc9721538e4d39f83b14b56eb32b853 Mon Sep 17 00:00:00 2001 From: Karson Date: Wed, 31 May 2017 16:13:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=9C=A8=E5=88=86=E5=B1=82?= =?UTF-8?q?=E6=8E=A7=E5=88=B6=E5=99=A8=E4=B8=8B=E7=9A=84=E6=9D=83=E9=99=90?= =?UTF-8?q?=E9=AA=8C=E8=AF=81=E9=94=99=E8=AF=AF=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E8=A1=A8=E5=8D=95=E5=9C=A8=E6=8F=90=E4=BA=A4=E5=90=8E=E6=9C=AA?= =?UTF-8?q?=E8=BF=94=E5=9B=9Etoken=E6=97=B6=E5=AF=BC=E8=87=B4=E7=9A=84?= =?UTF-8?q?=E5=AE=A2=E6=88=B7=E7=AB=AF=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/common/controller/Backend.php | 2 +- public/assets/js/require-form.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/application/common/controller/Backend.php b/application/common/controller/Backend.php index 91f658a2..6dff0b62 100644 --- a/application/common/controller/Backend.php +++ b/application/common/controller/Backend.php @@ -117,7 +117,7 @@ class Backend extends Controller if (!$this->auth->match($this->noNeedRight)) { // 判断控制器和方法判断是否有对应权限 - $path = $this->request->path(); + $path = str_replace('.', '/', $this->request->path()); $path = substr($path, 0, 1) == '/' ? $path : '/' . $path; if (!$this->auth->check($path)) { diff --git a/public/assets/js/require-form.js b/public/assets/js/require-form.js index 3209ae2c..807ecba1 100755 --- a/public/assets/js/require-form.js +++ b/public/assets/js/require-form.js @@ -51,7 +51,7 @@ define(['jquery', 'bootstrap', 'backend', 'toastr', 'upload', 'validator'], func } Toastr.success(msg ? msg : __('Operation completed')); } else { - if (typeof data.token !== 'undefined') { + if (data && typeof data === 'object' && typeof data.token !== 'undefined') { $("input[name='__token__']").val(data.token); } Toastr.error(msg ? msg : __('Operation failed'));