feat: 后端全量更新 - 含所有本次需求
- Contract.php: 返回合约账户余额(balance_contract) - My.php: 地址管理增加BTC/ETH - AppContract.php: 一键平仓(closeall) - AppProxy.php: 代理专属注册链接 + 分级权限(L1/L2) - site.php: 手续费减半(0.018→0.009) - agent_permission_setup.sql: 代理权限SQL - crypto_news_crawler.py: 新闻自动采集脚本
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
/*
|
||||
* @link http://kodcloud.com/
|
||||
* @author warlee | e-mail:kodcloud@qq.com
|
||||
* @copyright warlee 2014.(Shanghai)Co.,Ltd
|
||||
* @license http://kodcloud.com/tools/license/license.txt
|
||||
*/
|
||||
|
||||
class api extends Controller{
|
||||
function __construct(){
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* 通用文件预览方案
|
||||
* image,media,cad,office,webodf,pdf,epub,swf,text
|
||||
* 跨域:epub,pdf,odf,[text];
|
||||
* @return [type] [description]
|
||||
*/
|
||||
public function view(){
|
||||
if(!isset($this->in['path'])){
|
||||
show_tips('参数错误!');
|
||||
}
|
||||
$this->checkAccessToken();
|
||||
$this->setIdentify();
|
||||
$this->display('view.html');
|
||||
}
|
||||
private function setIdentify(){
|
||||
if(! $_SESSION['accessPlugin'] ){
|
||||
session_start();
|
||||
$_SESSION['accessPlugin'] = 'ok';
|
||||
session_write_close();
|
||||
}
|
||||
}
|
||||
public function checkAccessToken(){
|
||||
$model = $this->loadModel('Plugin');
|
||||
$config = $model->getConfig('fileView');
|
||||
if(!$config['apiKey']){
|
||||
return;
|
||||
}
|
||||
$timeTo = isset($this->in['timeTo'])?intval($this->in['timeTo']):'';
|
||||
$token = md5($config['apiKey'].$this->in['path'].$timeTo);
|
||||
|
||||
//show_tips(array($config['apiKey'],$token,$this->in));
|
||||
if($token != $this->in['token']){
|
||||
show_tips('token 错误!');
|
||||
}
|
||||
if($timeTo != '' && $timeTo <= time()){
|
||||
show_tips('token已失效!');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user