From 752494dbdbc1005d5351abe56cb418bc6155ee4b Mon Sep 17 00:00:00 2001 From: wyn <1074145239@qq.com> Date: Fri, 5 Jun 2026 11:27:11 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E8=83=8C=E8=B0=83=E5=A4=9A?= =?UTF-8?q?=E4=BD=99=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/controller/Author.php | 98 +-------------------------- application/route.php | 27 +++----- 2 files changed, 12 insertions(+), 113 deletions(-) diff --git a/application/api/controller/Author.php b/application/api/controller/Author.php index 5809357e..99b22daa 100644 --- a/application/api/controller/Author.php +++ b/application/api/controller/Author.php @@ -6,24 +6,19 @@ use app\common\service\AuthorBackgroundService; use think\Controller; /** - * 作者背调 API(前后端分离,返回 JSON) + * 作者背调:HTML 报告页 + JSON API * - * 主接口:background_report / due_diligence(ORCID 必填) - * Scopus 相关接口委托 AuthorInfo 实现 + * 主接口:index / background_report / due_diligence */ class Author extends Controller { /** @var AuthorBackgroundService */ private $bgService; - /** @var AuthorInfo */ - private $authorInfo; - public function __construct(\think\Request $request = null) { parent::__construct($request); - $this->bgService = new AuthorBackgroundService(); - $this->authorInfo = new AuthorInfo(); + $this->bgService = new AuthorBackgroundService(); } /** @@ -123,99 +118,12 @@ class Author extends Controller ]); } - /** camelCase 别名 */ - public function backgroundReport() - { - return $this->background_report(); - } - /** 与 background_report 相同(路由兼容) */ public function due_diligence() { return $this->background_report(); } - public function dueDiligence() - { - return $this->due_diligence(); - } - - /** - * OpenAlex + Crossref 诚信扫描(不依赖 ORCID 必填) - */ - public function background_check() - { - return $this->authorInfo->background_check(); - } - - public function backgroundCheck() - { - return $this->background_check(); - } - - public function get_hindex() - { - return $this->authorInfo->get_hindex(); - } - - public function getHindex() - { - return $this->get_hindex(); - } - - public function get_scopus_id() - { - return $this->authorInfo->get_scopus_id(); - } - - public function getScopusId() - { - return $this->get_scopus_id(); - } - - public function check_scopus_cookie() - { - return $this->authorInfo->check_scopus_cookie(); - } - - public function checkScopusCookie() - { - return $this->check_scopus_cookie(); - } - - public function save_scopus_cookie() - { - return $this->authorInfo->save_scopus_cookie(); - } - - public function saveScopusCookie() - { - return $this->save_scopus_cookie(); - } - - public function login_scopus() - { - return $this->authorInfo->login_scopus(); - } - - public function loginScopus() - { - return $this->login_scopus(); - } - - public function check_elsevier_api() - { - if (method_exists($this->authorInfo, 'check_elsevier_api')) { - return $this->authorInfo->check_elsevier_api(); - } - return json(['code' => 0, 'msg' => 'check_elsevier_api not implemented']); - } - - public function checkElsevierApi() - { - return $this->check_elsevier_api(); - } - /** * 解析背调查询参数(兼容多种命名) */ diff --git a/application/route.php b/application/route.php index 8718f344..ded0d189 100644 --- a/application/route.php +++ b/application/route.php @@ -18,23 +18,14 @@ return [ ':name' => ['index/hello', ['method' => 'post']], ], - // Author 背调 / Scopus(兼容 /api/author/ 与 /api/Author/) - 'api/author/index' => 'api/Author/index', - 'api/author/background_report' => 'api/Author/background_report', - 'api/author/due_diligence' => 'api/Author/due_diligence', - 'api/author/background_check' => 'api/Author/background_check', - 'api/author/get_hindex' => 'api/Author/get_hindex', - 'api/author/get_scopus_id' => 'api/Author/get_scopus_id', - 'api/author/check_scopus_cookie' => 'api/Author/check_scopus_cookie', - 'api/author/check_elsevier_api' => 'api/Author/check_elsevier_api', - 'api/Author/index' => 'api/Author/index', - 'api/Author/background_report' => 'api/Author/background_report', - 'api/Author/backgroundReport' => 'api/Author/background_report', - 'api/Author/due_diligence' => 'api/Author/due_diligence', - 'api/Author/dueDiligence' => 'api/Author/due_diligence', - 'api/Author/background_check' => 'api/Author/background_check', - 'api/Author/get_hindex' => 'api/Author/get_hindex', - 'api/Author/get_scopus_id' => 'api/Author/get_scopus_id', - 'api/Author/check_elsevier_api' => 'api/Author/check_elsevier_api', + // Author 背调(兼容 /api/author/ 与 /api/Author/) + 'api/author/index' => 'api/Author/index', + 'api/author/background_report' => 'api/Author/background_report', + 'api/author/due_diligence' => 'api/Author/due_diligence', + 'api/Author/index' => 'api/Author/index', + 'api/Author/background_report' => 'api/Author/background_report', + 'api/Author/backgroundReport' => 'api/Author/background_report', + 'api/Author/due_diligence' => 'api/Author/due_diligence', + 'api/Author/dueDiligence' => 'api/Author/due_diligence', ];