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:
li
2026-03-30 20:16:32 +08:00
commit 1b24994e74
6721 changed files with 1308571 additions and 0 deletions
+116
View File
@@ -0,0 +1,116 @@
<?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 yzOfficePlugin extends PluginBase{
function __construct(){
parent::__construct();
//IE8自动切换为普通模式
if( strpos($_SERVER["HTTP_USER_AGENT"],"MSIE 8.0") ){
$this->getConfig();
$this->pluginConfig['preview'] = '0';
}
}
public function regiest(){
$this->hookRegiest(array(
'user.commonJs.insert' => 'yzOfficePlugin.echoJs'
));
}
public function echoJs($st,$act){
if($this->isFileExtence($st,$act)){
$this->echoFile('static/main.js');
}
}
public function index(){
$app = $this->getObj();
$fileName = get_path_this(rawurldecode($this->in['path']));
$fileName.= ' - '.LNG('kod_name').LNG('kod_power_by');
if(!$app->task['success'] ){
include($this->pluginPath.'php/template.php');
return;
}
//获取页面
$step = count($app->task['steps']) - 1;
$infoData = $app->task['steps'][$step]['result'];
if( !is_array($infoData['data']) ){
$app->clearChche();
show_tips($infoData['message']);
}
$link = $infoData['data'][0];
$pageFile = $app->cachePath.md5($link).'.html.temp';
if(!file_exists($pageFile)){
$result = url_request($link,'GET');
if($result['code'] == 200){
$title = '<title>永中文档转换服务</title>';
$content = str_replace($title,'<title>'.$fileName.'</title>',$result['data']);
file_put_contents($pageFile,$content);
}else{
$app->clearChche();
show_tips($result);
}
}else{
$content = file_get_contents($pageFile);
}
if(strstr($content,'location.href = ')){
$app->clearChche();
show_tips("请求转换异常,请重试!");
}
//替换内容
$config = $this->getConfig();
if(!$config['cacheFile']){
header("Location: ".$html);
exit;
}
$name = str_replace(".html",'',get_path_this($link));
$urlReplaceFrom = './'.$name.".files";
$urlReplaceTo = $this->pluginApi.'getFile&path='.rawurlencode($this->in['path']).
$urlReplaceTo .= '&file='.rawurlencode($urlReplaceFrom);
// show_json(array($result,$urlReplaceFrom,$urlReplaceTo),false);
$content = str_replace($urlReplaceFrom,$urlReplaceTo,$content);
$content = str_replace('"'.$name.'.files','"'.$urlReplaceTo,$content);
$content = str_replace(array('<!DOCTYPE html>','<html>','<head>','</html>'),'',$content);
include('php/assign/header.php');
echo $content;
include('php/assign/footer.php');
}
private function str_rtrim($str,$remove){
if(!$str || !$remove) return false;
while(substr($str,-strlen($remove)) == $remove){
$str = substr($str,0,-strlen($remove));
}
return $str;
}
public function task(){
$app = $this->getObj();
$app->runTask();
}
public function getFile(){
$app = $this->getObj();
$app->getFile($this->in['file']);
}
private function getObj(){
$path = $this->filePath($this->in['path']);
if(filesize($path) > 1024*1024*2){
//show_tips("由于永中官方接口限制,<br/>暂不支持大于2M的文件在线预览!");
}
//文档分享预览; http://yozodoc.com/
// require_once($this->pluginPath.'php/yzOffice.class.php');
// return new yzOffice($this,$path);
//官网用户demo;
//http://www.yozodcs.com/examples.html 2M上传限制;
//http://dcs.yozosoft.com/examples.html
require_once($this->pluginPath.'php/yzOffice.class.php');
return new yzOffice2($this,$path);
}
}
+19
View File
@@ -0,0 +1,19 @@
<?php
return array(
"yzOffice.meta.name" => "Yozo Office View",
"yzOffice.meta.title" => "Yozo Office",
"yzOffice.meta.desc" => "Yozo Office View;",
'yzOffice.config.cacheFile' => "Open the cache",
'yzOffice.config.cacheFileDesc' => "After Opened,Office parsing generated images and other files stored in the server;",
'yzOffice.config.preview' => "Preview mode",
'yzOffice.config.previewDesc' => "Normal mode, the contents of complex layout will be converted to pictures;",
'yzOffice.config.previewNormal' => "Normal mode",
'yzOffice.config.previewHight' => "HD mode",
'yzOffice.Main.transfer' => "1.In data transmission......",
'yzOffice.Main.converting' => '2.File conversion, please wait a moment...',
'yzOffice.Main.uploadError' => "Upload failed. Please check PHP execution timeout!",
'yzOffice.Main.convert' => "Start convert...",
'yzOffice.Main.transferAgain' => "Retry"
);
@@ -0,0 +1,20 @@
<?php
return array(
"yzOffice.meta.name" => "永中office预览",
"yzOffice.meta.title" => "永中office",
"yzOffice.meta.desc" => "office系列文件在线预览",
'yzOffice.config.cacheFile' => "开启缓存",
'yzOffice.config.cacheFileDesc' => "开启后,office解析生成的图片等文件存储于本服务器;",
'yzOffice.config.preview' => "预览模式",
'yzOffice.config.previewDesc' => "普通模式,复杂排版的内容会转为图片;",
'yzOffice.config.previewNormal' => "普通模式",
'yzOffice.config.previewHight' => "高清模式",
'yzOffice.Main.transfer' => "1.数据传输中,请稍后...",
'yzOffice.Main.converting' => '2.文件转换中,请稍后...',
'yzOffice.Main.uploadError' => "上传失败,请检查php执行超时时间!",
'yzOffice.Main.convert' => "正在转换,请稍后...",
'yzOffice.Main.transferAgain' => "重新转换"
);
+71
View File
@@ -0,0 +1,71 @@
{
"id":"yzOffice",
"name":"{{LNG.yzOffice.meta.name}}",
"title":"{{LNG.yzOffice.meta.title}}",
"version":"1.37",
"category":"file",
"source":{
"icon":"{{pluginHost}}static/images/icon.png"
},
"description":"{{LNG.yzOffice.meta.desc}}",
"auther":{
"copyright":"kodcloud",
"homePage":"http://kodcloud.com"
},
"configItem":{
"formStyle":{
"className":"form-box-title-left",
"tabs":[
{
"name":"{{LNG.Plugin.tab.basic}}",
"field":["sep001","pluginAuth","openWith","cacheFile","preview"]
}
]
},
"pluginAuth":{
"type":"userSelect",
"value":"all:1",
"display":"{{LNG.Plugin.config.auth}}",
"desc":"{{LNG.Plugin.config.authDesc}}",
"require":1
},
"openWith":{
"type":"radio",
"value":"dialog",
"display":"{{LNG.Plugin.Config.openWith}}",
"info":[
["dialog","{{LNG.Plugin.Config.openWithDilog}}"],
["window","{{LNG.Plugin.Config.openWithWindow}}"]
]
},
"fileExt":{
"type":"tags",
"display":"{{LNG.Plugin.Config.fileExt}}",
"desc":"{{LNG.Plugin.Config.fileExtDesc}}",
"value":"doc,docx,docm,dot,dotx,dotm,rtf,wps,wpt,xls,xlsx,xlt,xlsm,csv,ppt,pptx,pps,ppsx",
},
"fileSort":{
"type":"number",
"display":"{{LNG.Plugin.Config.fileSort}}",
"desc":"{{LNG.Plugin.Config.fileSortDesc}}",
"value":50,
},
"cacheFile":{
"type":"switch",
"value":"1",
"display":"{{LNG.yzOffice.config.cacheFile}}",
"desc":"{{LNG.yzOffice.config.cacheFileDesc}}"
},
"preview":{
"type":"radio",
"value":"0",
"display":"{{LNG.yzOffice.config.preview}}",
"info":[
["1","{{LNG.yzOffice.config.previewNormal}}"],
["0","{{LNG.yzOffice.config.previewHight}}"]
],
"desc":"<br/>{{LNG.yzOffice.config.previewDesc}}"
}
}
}
@@ -0,0 +1,17 @@
<script type="text/javascript">
var funcNull = function(){return false;}
// document.oncopy = funcNull;
// document.oncontextmenu = funcNull;
// document.ondragstart = funcNull;
if( !window.datas &&
$('.excel-tab-title').length == 0){//没有目录
//$('.navbar-inverse').css('opacity',0);
}
$(document).ready(function(){
if($(".nav-collapse").length == 1){
$('body').addClass("body-excle");
}
})
</script>
<div class='powerby'>yozo DCS</div>
</html>
@@ -0,0 +1,132 @@
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
html body{
font-family:-apple-system,BlinkMacSystemFont,PingFang SC,
Helvetica,Tahoma,Arial,Hiragino Sans GB,Microsoft YaHei,Heiti,sans-serif;
background-image:none !important;
/*background-color:#f0f0f0;*/
}
.powerby{text-align: center;font-size:12px;color:#ccc;}
div.word-body, .ppt-body{background:#f9f9f9;}
div.word-page{border-bottom:1px solid #d9d9d9;box-shadow:0 1px 6px #ccc; max-width: 845px;}
div.word-page .word-content{max-width: 85%;}}
div.navbar{display:none;}
body.fullScreen div.word-page{max-width: 100%;border: none;}
body > div,body > hr{display:none;}
body div.container-fluid,
body div.navbar-inverse,
body #header,
div.openSide #loading,
div.openSide #header
{display:block;}
div.navbar-inverse{opacity:1;}
div.openSide .side-pager {
cursor: pointer;display: inline-block;font-size: 12px;color: #666;font-weight: 100;
background: #eee;padding: 0px 1em;margin-top: 4px;border-radius: 18px;
}
div#next, div#prev{
border-radius:4px;text-decoration: inherit;
font-family: FontAwesome;
font-weight: normal;font-style: normal;
-webkit-font-smoothing: antialiased;
color: rgba(0,0,0,0.001);
}
div.navbar-inverse .navbar-inner {
background:#eee;filter:none;
background-image: linear-gradient(to bottom,#fff,#eee);
border-bottom: 1px solid #ddd;
background-repeat: repeat-x;
}
div.navbar-inverse .nav>li>a {color: #666;text-shadow: none;}
div.navbar-inverse .brand{color: #666;text-shadow: none;width:40%;margin-left:0px;}
div.changePage{color:#888;}
div.navbar .nav{position: static;}
.nav.word-tab-title .dropdown.word-tab-title-li{position:absolute;left:0px;}
div.navbar-inverse .nav>li>a.dropdown-toggle{}
ul.dropdown-menu{margin-top:0;border-radius:2px;border: 1px solid rgba(0,0,0,0.1);}
ul.dropdown-menu>li>a:hover,
ul.dropdown-menu>li>a:focus,
ul.dropdown-submenu:hover>a,
ul.dropdown-submenu:focus>a{background:#2196F3 !important}
div.navbar-inverse .nav>li>a:focus,
div.navbar-inverse .nav>li>a:hover,
div.left a:hover,div.right a:hover{
color: #2196F3;background-color:rgba(0,0,0,0.05);
}
div.left,div.right{margin-right:5px;}
div.left a,div.right a{width:40px;text-align: center;display: block;}
div.navbar-inverse .brand:hover,
div.navbar-inverse .nav>li>a:hover,
div.navbar-inverse .brand:focus,
div.navbar-inverse .nav>li>a:focus{
color: #2196F3;
}
div.navbar-inverse .nav .active>a,
div.navbar-inverse .nav .active>a:hover,
div.navbar-inverse .nav .active>a:focus {
color: #fff !important;background: #2196F3 !important;
}
#next:after, #prev:after{color:#222;margin-left:-25px;}
#prev:after{content: "\f104";}
#next:after{content: "\f105";}
/*excle*/
@media (max-width: 979px) {
div.navbar-inverse .nav-collapse .nav>li>a:hover,
div.navbar-inverse .nav-collapse .nav>li>a:focus,
div.navbar-inverse .nav-collapse .dropdown-menu a:hover,
div.navbar-inverse .nav-collapse .dropdown-menu a:focus{
background-color: #d4ecff;
}
}
#btnPrint{filter: invert(60%);}
#zoom{display:none !important;}
.changePage .pageUp:after{content: "";font-family: FontAwesome;}
.changePage .pageDown:after {content: "";font-family: FontAwesome;}
.changePage .pageUp,.changePage .pageDown{font-size:16px;background:transparent !important;color:#888;text-decoration: none;}
.changePage .pageUp:hover,.changePage .pageDown:hover{background:#444;}
@media print {
body .powerby{display:none !important;}
body #zoom{display:none !important;}
body #btnPrint{filter: invert(60%);}
}
/*word*/
@media (max-width: 743px) {
div.word-page,div.word-page .word-content{border-bottom:none;box-shadow:none;}
/*.container-fluid{padding:20px 10px;}*/
}
<?php
$doc = array('doc','docx','docm','dot','dotx','dotm','rtf', 'wps','wpt');
if(in_array(get_path_ext($app->filePath),$doc)){
echo '
html body{background-color:#f0f0f0;}
div.powerby{display:block;}
';
}
?>
</style>
<script type="text/javascript">
if(!window.addEventListener){
window.addEventListener = window.attachEvent;
}
</script>
<link href="./static/style/font-awesome/css/font-awesome.css?ver=<?php echo KOD_VERSION;?>" rel="stylesheet">
<!--[if IE 7]>
<link rel="stylesheet" href="./static/style/font-awesome/css/font-awesome-ie7.css">
<![endif]-->
@@ -0,0 +1,165 @@
<!doctype html>
<head>
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=no" />
<meta charset="utf-8">
<link rel="stylesheet" href="<?php echo STATIC_PATH;?>style/common.css" type="text/css">
<link rel="stylesheet" href="./static/style/font-awesome/css/font-awesome.css">
<title><?php echo clear_html($fileName);?></title>
<style>
body {margin: 0;font-family: "Helvetica Neue Light", "Segoe UI Semilight", sans-serif;}
.infoButtonPrint{
cursor: pointer;font-size:20px;right:60px;text-align:center;
background:none;color: #666;line-height:27px;
}
.load-content{
position: fixed;
overflow: hidden;z-index: 100;top:0;left:0;right:0;bottom:0;
font-size:13px;color:#666;
}
.app-icon{text-align: center;position: absolute;width: 100%;top:40%;margin-top: -150px;}
.app-icon img{max-height: 150px;}
.app-icon .app-name{font-size:16px;color:#222;}
.load-status{margin: 20px auto;}
.load-status .progress{
width:300px;height:30px;margin: 10px auto;position: relative;
background-image: linear-gradient(to right,#ddd, #f6f6f6, #ddd);
}
.progress-loading{font-size:30px;margin-top: 20px;}
.progress-slider .content{position: absolute;width: 100%;color:#29792c;font-size:12px;line-height:30px;}
.progress-slider .left{float:left;padding-left: 10px;}
.progress-slider .right{float:right;padding-right: 10px;}
.progress-bar{opacity: 0.7;}
.clear{clear:both;}
.progress-text{text-align: center;display: block;width:300px;margin: 0 auto;padding: 10px;word-wrap: break-word;}
@page {
margin-left: 0px;
margin-right: 0px;
margin-top: 0px;
margin-bottom: 0px;
margin: 0;
-webkit-print-color-adjust: exact;
}
body{background:#f0f0f0 !important;}
div.word-body, div.ppt-body{background:#ff0;}
div.word-page{box-shadow: 0 1px 6px #ccc;}
</style>
</head>
<body>
<div class="load-content display">
<div class="app-icon">
<img src="<?php echo "{$this->pluginHost}/static/images/icon.png";?>" />
<div class="app-name"><?php echo LNG('yzOffice.meta.name');?></div>
<div class="load-status">
<div class="progress-text alert"><?php echo LNG('yzOffice.Main.transfer');?></div>
<div class="progress-slider progress progress-striped active hidden">
<div class="progress-bar progress-bar-success" role="progressbar" style="width:0%;"></div>
<div class="content">
<span class="left"></span>
<span class="right"></span>
<div class="clear"></div>
</div>
</div>
<div class="progress-loading hidden">
<div class="moveCircleRight"><i class="icon-spinner"></i></div>
</div>
</div>
</div>
</div>
<div id="MyViewerDiv"></div>
</body>
<script src="<?php echo STATIC_PATH;?>js/lib/jquery-1.8.0.min.js"></script>
<script src="<?php echo STATIC_PATH;?>js/lib/jquery-lib.js"></script>
<script src="<?php echo STATIC_PATH;?>js/lib/util.js"></script>
<script type="text/javascript">
var LNG = {
"error":"<?php echo LNG('error');?>",
"success":"<?php echo LNG('success');?>",
"yzOffice.Main.transfer":"<?php echo LNG('yzOffice.Main.transfer');?>",
"yzOffice.Main.converting":"<?php echo LNG('yzOffice.Main.converting');?>",
"yzOffice.Main.uploadError":"<?php echo LNG('yzOffice.Main.uploadError');?>",
"yzOffice.Main.convert":"<?php echo LNG('yzOffice.Main.convert');?>",
"yzOffice.Main.transferAgain":"<?php echo LNG('yzOffice.Main.transferAgain');?>"
};
var path = '<?php echo clear_quote($this->in["path"]);?>';
var apiBase = "<?php echo $this->pluginApi;?>";//不能含有index.php
var selfHost = '<?php echo $this->pluginHost;?>';
var cacheFile= '<?php echo $config["cacheFile"];?>';
var apiUrl = {
task:apiBase+'task&path='+urlEncode(path),
getFile:apiBase+'getFile&path='+urlEncode(path)+'&file='
}
var request = function(){
$('.load-content').fadeIn(100);
$('.progress-text').removeClass('alert-danger').html(LNG['gstarCAD.Main.transfer']);
$('.progress-bar').css('width',"0%");
var repeatTimer;
var taskStatus = function(){
$.ajax({
url:apiUrl.task+"&time"+UUID(),
dataType:'json',
success:function(data){
statusUpdate(data);
}
});
}
var statusUpdate = function(data){
if(!data) return;
if(!data.code){
var error = data.data;
if(!_.isString(error)){
error = LNG.error;
}
clearInterval(repeatTimer);
$('.progress-text').addClass('alert-danger').html(error);
$('.progress-slider,.progress-loading').hide();
return;
}
if(!data.data) return;
if(data.data.success == 1){
clearInterval(repeatTimer);
var item = data.data.steps[data.data.steps.length-1];
$('.progress-text').html(LNG.success+LNG['yzOffice.Main.convert']);
loadSuccess(data);
}else{
var step = data.data.steps[data.data.currentStep];
var stepInfo = step.result;
if(!_.isObject(stepInfo)){
return;
}
$('.progress-text').removeClass('alert-danger');
$('.progress-slider,.progress-loading').removeClass('hidden');
if(step.name == 'upload'){
$('.progress-text').html(LNG['yzOffice.Main.transfer']);
if(stepInfo === false){
clearInterval(repeatTimer);
loadError(LNG['yzOffice.Main.uploadError']);
}
var sizeTotal = pathTools.fileSize(stepInfo.sizeTotal);
var sizeSuccess = pathTools.fileSize(stepInfo.sizeSuccess);
var speed = pathTools.fileSize(stepInfo.speed)+'/s';
$('.progress-slider .left').html(sizeSuccess+'/'+sizeTotal+' ('+speed+')');//12.6M/25.3M (1.2M/s)
$('.progress-slider .right').html(_.floor((stepInfo.progress*100),1)+"%");
$('.progress-bar').css('width',(stepInfo.progress*100)+"%");
}else if(step.name == 'convertProcess'){
$('.progress-slider').addClass('hidden');
$('.progress-text').html(LNG['gstarCAD.Main.conver']);
}
}
}
clearInterval(repeatTimer);
taskStatus();
repeatTimer = setInterval(taskStatus,1000);
};
var loadSuccess = function(data){
window.location.reload();
}
$(window).ready(function(){
request();
});
</script>
</head>
@@ -0,0 +1,181 @@
<?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
*/
//官网用户demo
//http://www.yozodcs.com/examples.html
class yzOffice2{
public $cachePath = 'yzOffice/';
public $plugin;
public $filePath;
public $task;
public $taskFile;
public $api;
public function __construct($plugin,$filePath){
$this->plugin = $plugin;
$this->filePath = $filePath;
//新版本,加入了文件上传2M的限制; http://dcs.yozosoft.com/examples.html
$this->api = array(
'upload' => "http://dcs.yozosoft.com/testUpload",
'convert' => "http://dcs.yozosoft.com/convert",
);
if($filePath === -1) return;
if(!$filePath || !file_exists($filePath)){
show_json('path '.LNG('not_exist'),false);
}
$config = $plugin->getConfig();
$mode = $config['preview'];
$this->cachePath = TEMP_PATH.$this->cachePath.hash_path($this->filePath).$mode.'/';
$this->taskFile = $this->cachePath.'info.json';
mk_dir($this->cachePath);
if(file_exists($this->taskFile)){
$task_has = json_decode(file_get_contents($this->taskFile),true);
$this->task = is_array($task_has)?$task_has:false;
}
// show_json($this->upload(),false);
}
public function runTask(){
$task = array(
'currentStep' => 0,
'success' => 0,
'taskUuid' => md5($this->filePath.rand_string(20)),
'hideData' => array(),
'steps' => array(
array('name'=>'upload','process'=>'uploadProcess','status'=>0,'result'=>''),
array('name'=>'convert','process'=>'convert','status'=>0,'result'=>''),
)
);
if(is_array($this->task)){
$task = &$this->task;
}else{
$this->task = &$task;
}
$item = &$task['steps'][$task['currentStep']];
if($item['status'] == 0){
$item['status'] = 1;
if(!$item['process'] ||
$item['name'] == $item['process']){ //单步没有定时检测;相等则自我查询进度;0=>2之间跳转
$item['status'] = 0;
}
$this->saveData();
$function = $item['name'];
$result = $this->$function();
if(isset($result['data'])){
$item['result'] = $result['data'];
$item['status'] = 2;
$task['currentStep'] += 1;
//最后一步完成
if( $item['status'] == 2 && $task['currentStep'] > count($task['steps'])-1 ){
$task['success'] = 1;
}
if($task['currentStep'] >= count($task['steps'])-1 ){
$task['currentStep'] = count($task['steps'])-1;
}
$this->saveData();
}else{
$error = LNG('error');
if(is_array($result) && $result['code'] == 100){
$error = LNG('uploadError');
}else if(is_array($result) && is_string($result['data']) ){
$error = $result['data'];
}
show_json($error,false,array($function,$result));
}
}else if($item['status'] == 1){
$function = $item['process'];
if($function){
$item['result'] = $this->$function();
if($item['name'] == 'upload' && !$item['result']){
show_json($item['result'],false);
}
$this->saveData();
}
}
unset($task['hideData']);
show_json($task);
}
public function saveData(){
$data = json_encode_force($this->task);
file_put_contents($this->taskFile,$data);
}
private function convertMode(){
$config = $this->plugin->getConfig();
$ext = get_path_ext($this->filePath);
$mode = $config['preview'];
if(in_array($ext,array("xls","xlsb","xlsx","xlt","xlsm","csv",'ppt','pptx'))){
$mode = '1';//excle不支持高清模式,自动切换
}
return $mode;
}
//非高清预览【返回上传后直接转换过的文件】
public function upload(){
$post = array(
"file" => "@".$this->filePath,
"convertType" => $this->convertMode()
);
curl_progress_bind($this->filePath,$this->task['taskUuid']);//上传进度监听id
$result = url_request($this->api['upload'],'POST',$post,false,false,true,3600);
if(is_array($result) && $result['data']){
return $result;
}
return false;
}
public function convert($tempFile=false){
$headers = array("Content-Type: application/x-www-form-urlencoded; charset=UTF-8");
$stepInfo = $this->task['steps'][0]['result'];
$tempFile = $tempFile?$tempFile:$stepInfo['data'];
if(!$tempFile){
show_json("操作失败: ".$stepInfo['message'],false,$this->task);
}
$postArr = array(
"inputDir" => $tempFile,
"sourceFolder" => rtrim(get_path_father($tempFile),'/'),
"convertType" => $this->convertMode(),
"isAsync" => 1,
"isDownload" => 0,
"isSignature" => 0,
);
$post = http_build_query($postArr);//post默认用array发送;content-type为x-www-form-urlencoded时用key=1&key=2的形式
// show_json([$stepInfo,$postArr,$post],false);
$result = url_request($this->api['convert'],'POST',$post,$headers,false,true,5);
if(is_array($result) && is_array($result['data'])){
return $result;
}
return false;
}
public function clearChche(){
del_dir($this->cachePath);
}
public function uploadProcess(){
return curl_progress_get($this->filePath,$this->task['taskUuid']);
}
public function getFile($file){
ignore_timeout();
$ext = unzip_filter_ext(get_path_ext($file));
$cacheFile = $this->cachePath.md5($file.'file').'.'.$ext;
if(file_exists($cacheFile)){
file_put_out($cacheFile,false);
return;
}
$step = count($this->task['steps']) - 1;
$infoData = $this->task['steps'][$step]['result'];
$link = $infoData['data'][0];
$linkFile = get_path_father($link) . str_replace('./','',$file);
$result = url_request($linkFile,'GET',false);
if($result['code'] == 200){
file_put_contents($cacheFile, $result['data']);
file_put_out($cacheFile,false);
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

@@ -0,0 +1,18 @@
kodReady.push(function(){
kodApp.add({
name:"yzOffice",
title:"{{LNG.yzOffice.meta.name}}",
ext:"{{config.fileExt}}",
sort:"{{config.fileSort}}",
icon:'{{pluginHost}}static/images/icon.png',
callback:function(path,ext){
var url = '{{pluginApi}}&path='+core.pathCommon(path);
if('window' == "{{config.openWith}}" && !core.isFileView() ){
window.open(url);
}else{
core.openDialog(url,core.icon(ext),htmlEncode(core.pathThis(path)));
}
}
});
});