自动推广
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
namespace app\api\controller;
|
||||
use app\api\controller\Base;
|
||||
use think\Db;
|
||||
use think\Validate;
|
||||
class Crossrefdoi extends Base{
|
||||
|
||||
public function __construct(\think\Request $request = null) {
|
||||
@@ -99,6 +100,21 @@ class Crossrefdoi extends Base{
|
||||
return json_encode(['status' => 1,'msg' => 'Update successful']);
|
||||
}
|
||||
|
||||
|
||||
public function getOneDoi(){
|
||||
$data = $this->request->post();
|
||||
$rule = new Validate([
|
||||
"doi"=>"require"
|
||||
]);
|
||||
if(!$rule->check($data)){
|
||||
return jsonError($rule->getError());
|
||||
}
|
||||
$sCheckDoi = $this->fetchSingleDoiWithRetry($this->filterValidDoi($data['doi'])); // 过滤非法DOI
|
||||
return jsonSuccess($sCheckDoi);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 过滤非法DOI(仅保留10.xxxx/xxx格式)
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user