diff --git a/app/wechat/service/WechatService.php b/app/wechat/service/WechatService.php index a801c453d..792f28bd7 100644 --- a/app/wechat/service/WechatService.php +++ b/app/wechat/service/WechatService.php @@ -249,8 +249,9 @@ class WechatService extends Service } if ($redirect && !empty($result['url'])) { throw new HttpResponseException(redirect($result['url'], 301)); + } else { + throw new HttpResponseException(response("window.location.href='{$result['url']}'")); } - exit("window.location.href='{$result['url']}'"); } } diff --git a/composer.lock b/composer.lock index d1dce30f9..040a52c2e 100644 --- a/composer.lock +++ b/composer.lock @@ -909,12 +909,12 @@ "source": { "type": "git", "url": "https://github.com/zoujingli/ThinkLibrary.git", - "reference": "9952e50062d5d8f447680cea4a557155b7353158" + "reference": "d9b6c53ed98ef92d9d9560c38e7d9442350042f5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/9952e50062d5d8f447680cea4a557155b7353158", - "reference": "9952e50062d5d8f447680cea4a557155b7353158", + "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/d9b6c53ed98ef92d9d9560c38e7d9442350042f5", + "reference": "d9b6c53ed98ef92d9d9560c38e7d9442350042f5", "shasum": "", "mirrors": [ { @@ -958,7 +958,7 @@ ], "description": "ThinkPHP v6.0 Development Library", "homepage": "http://framework.thinkadmin.top", - "time": "2019-12-24T02:28:27+00:00" + "time": "2019-12-25T02:08:57+00:00" }, { "name": "zoujingli/wechat-developer", diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 3acdc3f34..4880165ad 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -935,12 +935,12 @@ "source": { "type": "git", "url": "https://github.com/zoujingli/ThinkLibrary.git", - "reference": "9952e50062d5d8f447680cea4a557155b7353158" + "reference": "d9b6c53ed98ef92d9d9560c38e7d9442350042f5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/9952e50062d5d8f447680cea4a557155b7353158", - "reference": "9952e50062d5d8f447680cea4a557155b7353158", + "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/d9b6c53ed98ef92d9d9560c38e7d9442350042f5", + "reference": "d9b6c53ed98ef92d9d9560c38e7d9442350042f5", "shasum": "", "mirrors": [ { @@ -956,7 +956,7 @@ "ext-json": "*", "topthink/framework": "^6.0" }, - "time": "2019-12-24T02:28:27+00:00", + "time": "2019-12-25T02:08:57+00:00", "type": "library", "extra": { "think": { diff --git a/vendor/services.php b/vendor/services.php index a427b9a0e..bad4a39d3 100644 --- a/vendor/services.php +++ b/vendor/services.php @@ -1,5 +1,5 @@ 'think\\app\\Service', diff --git a/vendor/zoujingli/think-library/src/helper/PageHelper.php b/vendor/zoujingli/think-library/src/helper/PageHelper.php index 8bd6acf95..42e38847c 100644 --- a/vendor/zoujingli/think-library/src/helper/PageHelper.php +++ b/vendor/zoujingli/think-library/src/helper/PageHelper.php @@ -62,39 +62,30 @@ class PageHelper extends Helper * @throws \think\db\exception\ModelNotFoundException */ public function init($dbQuery, $page = true, $display = true, $total = false, $limit = 0) - { $this->page = $page; $this->total = $total; $this->limit = $limit; $this->display = $display; $this->query = $this->buildQuery($dbQuery); - // 数据列表排序处理 + // 数据列表排序自动处理 if ($this->app->request->isPost()) { - $post = $this->app->request->post(); - $sort = intval(isset($post['sort']) ? $post['sort'] : 0); - unset($post['action'], $post['sort']); - if ($this->app->db->table($this->query->getTable())->where($post)->update(['sort' => $sort]) !== false) { - return $this->controller->success('列表排序修改成功!', ''); - } else { - return $this->controller->error('列表排序修改失败,请稍候再试!'); - } + $this->sortAction(); } - // 未配置 order 规则时自动按 sort 字段排序 - if (!$this->query->getOptions('order') && method_exists($this->query, 'getTableFields')) { - if (in_array('sort', $this->query->getTableFields())) $this->query->order('sort desc'); + // 列表设置默认排序处理 + if (!$this->query->getOptions('order')) { + $this->orderAction(); } // 列表分页及结果集处理 if ($this->page) { - // 分页每页显示记录数 if ($this->limit > 0) { $limit = intval($this->limit); } else { $limit = $this->app->request->get('limit', $this->app->cookie->get('limit')); $this->app->cookie->set('limit', $limit = intval($limit >= 10 ? $limit : 20)); } - list($select, $query) = ['', $this->app->request->get()]; - $paginate = $this->query->paginate(['list_rows' => $limit, 'query' => $query], $this->total); + list($options, $query) = ['', $this->app->request->get()]; + $pager = $this->query->paginate(['list_rows' => $limit, 'query' => $query], $this->total); foreach ([10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160, 170, 180, 190, 200] as $num) { list($query['limit'], $query['page'], $selected) = [$num, 1, $limit === $num ? 'selected' : '']; if (stripos($this->app->request->get('spm', '-'), 'm-') === 0) { @@ -102,15 +93,15 @@ class PageHelper extends Helper } else { $url = $this->app->request->baseUrl() . '?' . urldecode(http_build_query($query)); } - $select .= ""; + $options .= ""; } - $pagehtml = "