mirror of https://gitee.com/zorlan/skycaiji
2.2
parent
8388999a1b
commit
6ae73277dc
12
.htaccess
12
.htaccess
|
@ -1,8 +1,12 @@
|
|||
<IfModule mod_rewrite.c>
|
||||
Options +FollowSymlinks -Multiviews
|
||||
RewriteEngine On
|
||||
|
||||
RewriteEngine on
|
||||
|
||||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
|
||||
</IfModule>
|
||||
RewriteRule ^app/(\w+)/(.*)$ app/$1/index.php [QSA,PT,L,E=PATH_INFO:$2]
|
||||
|
||||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteRule ^(.*)$ index.php [QSA,PT,L,E=PATH_INFO:$1]
|
||||
</IfModule>
|
|
@ -3,9 +3,9 @@
|
|||
|--------------------------------------------------------------------------
|
||||
| SkyCaiji (蓝天采集器)
|
||||
|--------------------------------------------------------------------------
|
||||
| Copyright (c) 2018 http://www.skycaiji.com All rights reserved.
|
||||
| Copyright (c) 2018 https://www.skycaiji.com All rights reserved.
|
||||
|--------------------------------------------------------------------------
|
||||
| 使用协议 http://www.skycaiji.com/licenses
|
||||
| 使用协议 https://www.skycaiji.com/licenses
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
@ -19,7 +19,25 @@ class Init{
|
|||
$curController=strtolower(request()->controller());
|
||||
if('store'==$curController){
|
||||
|
||||
header('Access-Control-Allow-Origin:http://www.skycaiji.com');
|
||||
$httpOrigin=strtolower($_SERVER['HTTP_ORIGIN']);
|
||||
$httpOrigin=rtrim($httpOrigin,'/');
|
||||
|
||||
$allowOrigins=array('http://www.skycaiji.com','https://www.skycaiji.com');
|
||||
|
||||
$allowOrigin='';
|
||||
if(in_array($httpOrigin,$allowOrigins)){
|
||||
|
||||
$allowOrigin=$httpOrigin;
|
||||
}else{
|
||||
|
||||
if(model('Provider')->where(array('domain'=>$httpOrigin,'enable'=>1))->count()>0){
|
||||
|
||||
$allowOrigin=$httpOrigin;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
header('Access-Control-Allow-Origin:'.$allowOrigin);
|
||||
|
||||
header('Access-Control-Allow-Credentials:true');
|
||||
|
||||
|
@ -54,27 +72,39 @@ class Init{
|
|||
$GLOBALS['user']['group']=model('Usergroup')->getById($GLOBALS['user']['groupid']);
|
||||
if(!empty($GLOBALS['user']['group'])){
|
||||
$GLOBALS['user']['group']=$GLOBALS['user']['group']->toArray();
|
||||
if(model('Usergroup')->is_admin($GLOBALS['user']['group'])){
|
||||
session('is_admin',true);
|
||||
}else{
|
||||
session('is_admin',null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*用户未登录或者不是管理员用户*/
|
||||
if(empty($GLOBALS['user'])||(empty($GLOBALS['user']['group']['founder'])&&empty($GLOBALS['user']['group']['admin']))){
|
||||
if(!empty($GLOBALS['user'])&&session('is_admin')){
|
||||
/*是管理员,进行下列操作*/
|
||||
if('index'==$curController&&'index'==strtolower(request()->action())){
|
||||
|
||||
$url=null;
|
||||
if(input('?_referer')){
|
||||
|
||||
$url=input('_referer','','trim');
|
||||
}
|
||||
$url=empty($url)?url('Admin/Backstage/index',null,null,true):$url;
|
||||
|
||||
$baseContr=new BaseController();
|
||||
$baseContr->success(lang('user_auto_login'),$url);
|
||||
}
|
||||
config('dispatch_error_tmpl','common:error_admin');
|
||||
config('dispatch_success_tmpl','common:success_admin');
|
||||
}else{
|
||||
|
||||
if(!in_array($curController, array('index','api'))){
|
||||
|
||||
$baseContr=new BaseController();
|
||||
$baseContr->dispatchJump(false,lang('user_error_is_not_admin'),url('Admin/Index/index',null,null,true));
|
||||
exit();
|
||||
}
|
||||
}else{
|
||||
/*是管理员,进行下列操作*/
|
||||
if('index'==$curController&&'index'==strtolower(request()->action())){
|
||||
|
||||
$baseContr=new BaseController();
|
||||
$baseContr->success(lang('user_auto_login'),url('Admin/Backstage/index',null,null,true));
|
||||
}
|
||||
config('dispatch_error_tmpl','common:error_admin');
|
||||
config('dispatch_success_tmpl','common:success_admin');
|
||||
}
|
||||
/*通用操作,全局变量*/
|
||||
$mconfig=model('Config');
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
|--------------------------------------------------------------------------
|
||||
| SkyCaiji (蓝天采集器)
|
||||
|--------------------------------------------------------------------------
|
||||
| Copyright (c) 2018 http://www.skycaiji.com All rights reserved.
|
||||
| Copyright (c) 2018 https://www.skycaiji.com All rights reserved.
|
||||
|--------------------------------------------------------------------------
|
||||
| 使用协议 http://www.skycaiji.com/licenses
|
||||
| 使用协议 https://www.skycaiji.com/licenses
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
|--------------------------------------------------------------------------
|
||||
| SkyCaiji (蓝天采集器)
|
||||
|--------------------------------------------------------------------------
|
||||
| Copyright (c) 2018 http://www.skycaiji.com All rights reserved.
|
||||
| Copyright (c) 2018 https://www.skycaiji.com All rights reserved.
|
||||
|--------------------------------------------------------------------------
|
||||
| 使用协议 http://www.skycaiji.com/licenses
|
||||
| 使用协议 https://www.skycaiji.com/licenses
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
@ -149,4 +149,11 @@ function cli_command_exec($paramStr){
|
|||
|
||||
|
||||
exit();
|
||||
}
|
||||
function is_official_url($url){
|
||||
if(preg_match('/skycaiji\.com/i', $url)){
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -3,9 +3,9 @@
|
|||
|--------------------------------------------------------------------------
|
||||
| SkyCaiji (蓝天采集器)
|
||||
|--------------------------------------------------------------------------
|
||||
| Copyright (c) 2018 http://www.skycaiji.com All rights reserved.
|
||||
| Copyright (c) 2018 https://www.skycaiji.com All rights reserved.
|
||||
|--------------------------------------------------------------------------
|
||||
| 使用协议 http://www.skycaiji.com/licenses
|
||||
| 使用协议 https://www.skycaiji.com/licenses
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
|--------------------------------------------------------------------------
|
||||
| SkyCaiji (蓝天采集器)
|
||||
|--------------------------------------------------------------------------
|
||||
| Copyright (c) 2018 http://www.skycaiji.com All rights reserved.
|
||||
| Copyright (c) 2018 https://www.skycaiji.com All rights reserved.
|
||||
|--------------------------------------------------------------------------
|
||||
| 使用协议 http://www.skycaiji.com/licenses
|
||||
| 使用协议 https://www.skycaiji.com/licenses
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
|
|
@ -0,0 +1,233 @@
|
|||
<?php
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| SkyCaiji (蓝天采集器)
|
||||
|--------------------------------------------------------------------------
|
||||
| Copyright (c) 2018 https://www.skycaiji.com All rights reserved.
|
||||
|--------------------------------------------------------------------------
|
||||
| 使用协议 https://www.skycaiji.com/licenses
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
namespace skycaiji\admin\controller;
|
||||
|
||||
class App extends BaseController {
|
||||
public function manageAction(){
|
||||
$app=input('app');
|
||||
$navid=input('navid',null);
|
||||
if(empty($app)){
|
||||
$this->error('app标识错误');
|
||||
}
|
||||
$mapp=model('App');
|
||||
$appData=$mapp->getByApp($app);
|
||||
if(empty($appData)){
|
||||
$this->error('应用未安装');
|
||||
}
|
||||
$appUrl=config('root_website').'/app/'.$app.'/';
|
||||
|
||||
$navPacks=array();
|
||||
if(is_array($appData['config']['packs'])){
|
||||
$manageUrl=url('App/manage?app='.$app);
|
||||
$manageUrl.=strpos($manageUrl,'?')===false?'?':'&';
|
||||
foreach ($appData['config']['packs'] as $k=>$v){
|
||||
if($v['type']=='nav'){
|
||||
$v['nav_link']=str_replace(array('{app}','{apps}'), array(config('root_website').'/app/'.$app.'/',config('root_website').'/app/'),$v['nav_link']);
|
||||
if(!preg_match('/^\w+\:\/\//', $v['nav_link'])){
|
||||
|
||||
$v['nav_link']=$appUrl.$v['nav_link'];
|
||||
}
|
||||
|
||||
if(isset($navid)&&$navid==$k){
|
||||
|
||||
$v['is_current']=true;
|
||||
}
|
||||
$navPacks[$k]=$v;
|
||||
}
|
||||
}
|
||||
}
|
||||
$provData=null;
|
||||
$mprov=model('Provider');
|
||||
if($appData['provider_id']>0){
|
||||
$provData=$mprov->where('id',$appData['provider_id'])->find();
|
||||
}
|
||||
|
||||
$appClass=$mapp->app_class($app);
|
||||
if(is_object($appClass)){
|
||||
if(version_compare($appClass->config['version'], $appData['config']['version'],'>')===true){
|
||||
|
||||
$this->assign('newest_version',$appClass->config['version']);
|
||||
}
|
||||
|
||||
$appData['app_class']=$mapp->get_class_vars($appClass);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
$this->assign('app',$app);
|
||||
$this->assign('appUrl',$appUrl);
|
||||
$this->assign('navid',$navid);
|
||||
$this->assign('navPacks',$navPacks);
|
||||
$this->assign('appData',$appData);
|
||||
$this->assign('provData',$provData);
|
||||
return $this->fetch();
|
||||
}
|
||||
/*协议*/
|
||||
public function agreementAction(){
|
||||
$app=input('app');
|
||||
$appClass=model('App')->app_class($app);
|
||||
$this->assign('app',$app);
|
||||
$this->assign('name',$appClass->config['name']);
|
||||
$this->assign('agreement',$appClass->config['agreement']);
|
||||
|
||||
return $this->fetch('agreement');
|
||||
}
|
||||
/*安装*/
|
||||
public function installAction(){
|
||||
$app=input('app');
|
||||
$success=input('success');
|
||||
if(empty($app)){
|
||||
$this->error('app标识错误');
|
||||
}
|
||||
$mapp=model('App');
|
||||
|
||||
if(!$mapp->right_app($app)){
|
||||
$this->error('抱歉,app标识不规范!');
|
||||
}
|
||||
if($mapp->where('app',$app)->count()>0){
|
||||
$this->success('该应用已安装!','Mystore/app');
|
||||
}
|
||||
$appClass=$mapp->app_class($app);
|
||||
if(!is_object($appClass)||empty($appClass->install)){
|
||||
$this->error('不存在安装接口!');
|
||||
}
|
||||
if(!empty($appClass->config['phpv'])){
|
||||
|
||||
if(version_compare(PHP_VERSION, $appClass->config['phpv'],'<')){
|
||||
$this->error('抱歉,该应用要求PHP版本最低'.$appClass->config['phpv']);
|
||||
}
|
||||
}
|
||||
|
||||
if($appClass->install!='1'){
|
||||
|
||||
if(!$success){
|
||||
|
||||
$apiUrl=config('root_url').'/app/'.$app.'/'.$appClass->install;
|
||||
$this->assign('app',$app);
|
||||
$this->assign('op','install');
|
||||
$this->assign('apiUrl',$apiUrl);
|
||||
return $this->fetch('apiop');
|
||||
}
|
||||
}
|
||||
$newData=array(
|
||||
'app'=>$app,
|
||||
'addtime'=>time(),
|
||||
'uptime'=>time(),
|
||||
'provider_id'=>model('Provider')->getIdByUrl($appClass->config['website'])
|
||||
);
|
||||
$mapp->isUpdate(false)->allowField(true)->save($newData);
|
||||
if($mapp->id>0){
|
||||
$mapp->set_config($app,$appClass->config);
|
||||
$this->success('恭喜!安装成功','Mystore/app');
|
||||
}else{
|
||||
$this->error('安装失败!');
|
||||
}
|
||||
}
|
||||
/*卸载应用*/
|
||||
public function uninstallAction(){
|
||||
$app=input('app');
|
||||
$success=input('success');
|
||||
if(empty($app)){
|
||||
$this->error('app标识错误');
|
||||
}
|
||||
$mapp=model('App');
|
||||
|
||||
if($mapp->where('app',$app)->count()<=0){
|
||||
$this->success('该应用已卸载!','Mystore/app');
|
||||
}
|
||||
$appClass=$mapp->app_class($app);
|
||||
if(!is_object($appClass)){
|
||||
|
||||
$mapp->deleteByApp($app);
|
||||
$this->success('卸载成功');
|
||||
}
|
||||
if(empty($appClass->uninstall)){
|
||||
$this->error('不存在卸载接口!');
|
||||
}
|
||||
|
||||
if($appClass->uninstall!='1'){
|
||||
|
||||
if(!$success){
|
||||
|
||||
$apiUrl=config('root_url').'/app/'.$app.'/'.$appClass->uninstall;
|
||||
$this->assign('app',$app);
|
||||
$this->assign('op','uninstall');
|
||||
$this->assign('apiUrl',$apiUrl);
|
||||
return $this->fetch('apiop');
|
||||
}
|
||||
}
|
||||
|
||||
$mapp->deleteByApp($app);
|
||||
|
||||
$this->success('卸载成功,您可以手动删除app/'.$app.'目录彻底清除应用');
|
||||
}
|
||||
/*升级应用*/
|
||||
public function upgradeAction(){
|
||||
$app=input('app');
|
||||
$success=input('success');
|
||||
if(empty($app)){
|
||||
$this->error('app标识错误');
|
||||
}
|
||||
$mapp=model('App');
|
||||
|
||||
$appData=$mapp->getByApp($app);
|
||||
if(empty($appData)){
|
||||
$this->success('请先安装应用!','Mystore/app');
|
||||
}
|
||||
$appClass=$mapp->app_class($app);
|
||||
if(!is_object($appClass)||empty($appClass->upgrade)){
|
||||
$this->error('不存在升级接口!');
|
||||
}
|
||||
$referer=\think\Request::instance()->server('HTTP_REFERER',null,null);
|
||||
if(version_compare($appClass->config['version'], $appData['config']['version'],'=')===true){
|
||||
|
||||
$this->success('已升级!',$referer);
|
||||
}
|
||||
|
||||
if($appClass->upgrade!='1'){
|
||||
|
||||
if(!$success){
|
||||
|
||||
$apiUrl=config('root_url').'/app/'.$app.'/'.$appClass->upgrade;
|
||||
$this->assign('app',$app);
|
||||
$this->assign('op','upgrade');
|
||||
$this->assign('apiUrl',$apiUrl);
|
||||
return $this->fetch('apiop');
|
||||
}
|
||||
}
|
||||
|
||||
$mapp->strict(false)->where('app',$app)->update(array(
|
||||
'uptime'=>time(),
|
||||
'provider_id'=>model('Provider')->getIdByUrl($appClass->config['website'])
|
||||
));
|
||||
$mapp->set_config($app,$appClass->config);
|
||||
|
||||
$this->success('恭喜!升级成功',$referer);
|
||||
}
|
||||
/*开启、关闭应用*/
|
||||
public function enableAction(){
|
||||
$app=input('app');
|
||||
$enable=input('enable/d',0);
|
||||
if(empty($app)){
|
||||
$this->error('app标识错误');
|
||||
}
|
||||
$mapp=model('App');
|
||||
|
||||
$enable=$enable?1:0;
|
||||
|
||||
$mapp->set_config($app,array('enable'=>$enable));
|
||||
|
||||
$referer=\think\Request::instance()->server('HTTP_REFERER',null,null);
|
||||
$this->success('应用已'.($enable?'开启':'关闭'),$referer);
|
||||
}
|
||||
}
|
|
@ -3,9 +3,9 @@
|
|||
|--------------------------------------------------------------------------
|
||||
| SkyCaiji (蓝天采集器)
|
||||
|--------------------------------------------------------------------------
|
||||
| Copyright (c) 2018 http://www.skycaiji.com All rights reserved.
|
||||
| Copyright (c) 2018 https://www.skycaiji.com All rights reserved.
|
||||
|--------------------------------------------------------------------------
|
||||
| 使用协议 http://www.skycaiji.com/licenses
|
||||
| 使用协议 https://www.skycaiji.com/licenses
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
@ -26,7 +26,7 @@ class Backstage extends BaseController{
|
|||
$runInfo['task_other']=model('Task')->where('`auto`=0')->count();
|
||||
|
||||
/*服务器信息*/
|
||||
$serverInfo=array(
|
||||
$serverData=array(
|
||||
'os'=>php_uname('s').' '.php_uname('r'),
|
||||
'php'=>PHP_VERSION,
|
||||
'db'=>config('database.type'),
|
||||
|
@ -35,9 +35,9 @@ class Backstage extends BaseController{
|
|||
'upload_max'=>ini_get('upload_max_filesize')
|
||||
);
|
||||
|
||||
if(stripos($serverInfo['db'],'mysql')!==false){
|
||||
if(stripos($serverData['db'],'mysql')!==false){
|
||||
$dbVersion=db()->query('SELECT VERSION() as v;');
|
||||
$serverInfo['db'].=' '.($dbVersion[0]?$dbVersion[0]['v']:'');
|
||||
$serverData['db'].=' '.($dbVersion[0]?$dbVersion[0]['v']:'');
|
||||
}
|
||||
|
||||
$runInfo['auto_status']='良好';
|
||||
|
@ -48,28 +48,28 @@ class Backstage extends BaseController{
|
|||
$taskAutoCount=model('Task')->where('auto',1)->count();
|
||||
if($taskAutoCount<=0){
|
||||
|
||||
$serverInfo['caiji']='<a href="'.url('Admin/Task/list').'">未设置自动采集任务</a>';
|
||||
$serverData['caiji']='<a href="'.url('Admin/Task/list').'">未设置自动采集任务</a>';
|
||||
$runInfo['auto_status']='无任务';
|
||||
}else{
|
||||
|
||||
if($lastTime>0){
|
||||
$runInfo['auto_status']='运行良好';
|
||||
$serverInfo['caiji']='最近采集:'.date('Y-m-d H:i:s',$lastTime).' ';
|
||||
$serverData['caiji']='最近采集:'.date('Y-m-d H:i:s',$lastTime).' ';
|
||||
if($GLOBALS['config']['caiji']['run']=='backstage'){
|
||||
|
||||
if(NOW_TIME-$lastTime>60*($GLOBALS['config']['caiji']['interval']+15)){
|
||||
|
||||
$serverInfo['caiji'].='<p class="help-block">自动采集似乎停止了,请<a href="'.
|
||||
$serverData['caiji'].='<p class="help-block">自动采集似乎停止了,请<a href="'.
|
||||
url('Admin/Setting/caiji').'">重新保存设置</a>以便激活采集</p>';
|
||||
$runInfo['auto_status']='停止运行';
|
||||
}
|
||||
}
|
||||
}
|
||||
$serverInfo['caiji'].='<a href="javascript:;" id="a_collect_now">实时采集</a>';
|
||||
$serverData['caiji'].='<a href="javascript:;" id="a_collect_now">实时采集</a>';
|
||||
}
|
||||
}else{
|
||||
$runInfo['auto_status']='已停止';
|
||||
$serverInfo['caiji']='<a href="'.url('Admin/Setting/caiji').'">未开启自动采集</a>';
|
||||
$serverData['caiji']='<a href="'.url('Admin/Setting/caiji').'">未开启自动采集</a>';
|
||||
}
|
||||
|
||||
$upgradeDb=false;
|
||||
|
@ -93,7 +93,7 @@ class Backstage extends BaseController{
|
|||
$GLOBALS['breadcrumb']=breadcrumb(array('首页'));
|
||||
|
||||
$this->assign('runInfo',$runInfo);
|
||||
$this->assign('serverInfo',$serverInfo);
|
||||
$this->assign('serverData',$serverData);
|
||||
$this->assign('upgradeDb',$upgradeDb);
|
||||
|
||||
return $this->fetch('backstage/index');
|
||||
|
@ -106,7 +106,7 @@ class Backstage extends BaseController{
|
|||
/*获取推送消息*/
|
||||
public function adminIndexAction(){
|
||||
$callback=input('?'.config('var_jsonp_handler'))?input(config('var_jsonp_handler')):config('default_jsonp_handler');
|
||||
$html=get_html('http://www.skycaiji.com/Store/Client/adminIndex?v='.SKYCAIJI_VERSION.'&'.config('var_jsonp_handler').'='.rawurlencode($callback),null,null,'utf-8');
|
||||
$html=get_html('https://www.skycaiji.com/store/client/adminIndex?v='.SKYCAIJI_VERSION.'&'.config('var_jsonp_handler').'='.rawurlencode($callback),null,null,'utf-8');
|
||||
header('Content-Type:application/json;charset=utf-8');
|
||||
exit($html);
|
||||
}
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
|--------------------------------------------------------------------------
|
||||
| SkyCaiji (蓝天采集器)
|
||||
|--------------------------------------------------------------------------
|
||||
| Copyright (c) 2018 http://www.skycaiji.com All rights reserved.
|
||||
| Copyright (c) 2018 https://www.skycaiji.com All rights reserved.
|
||||
|--------------------------------------------------------------------------
|
||||
| 使用协议 http://www.skycaiji.com/licenses
|
||||
| 使用协议 https://www.skycaiji.com/licenses
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
|--------------------------------------------------------------------------
|
||||
| SkyCaiji (蓝天采集器)
|
||||
|--------------------------------------------------------------------------
|
||||
| Copyright (c) 2018 http://www.skycaiji.com All rights reserved.
|
||||
| Copyright (c) 2018 https://www.skycaiji.com All rights reserved.
|
||||
|--------------------------------------------------------------------------
|
||||
| 使用协议 http://www.skycaiji.com/licenses
|
||||
| 使用协议 https://www.skycaiji.com/licenses
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
|--------------------------------------------------------------------------
|
||||
| SkyCaiji (蓝天采集器)
|
||||
|--------------------------------------------------------------------------
|
||||
| Copyright (c) 2018 http://www.skycaiji.com All rights reserved.
|
||||
| Copyright (c) 2018 https://www.skycaiji.com All rights reserved.
|
||||
|--------------------------------------------------------------------------
|
||||
| 使用协议 http://www.skycaiji.com/licenses
|
||||
| 使用协议 https://www.skycaiji.com/licenses
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
|--------------------------------------------------------------------------
|
||||
| SkyCaiji (蓝天采集器)
|
||||
|--------------------------------------------------------------------------
|
||||
| Copyright (c) 2018 http://www.skycaiji.com All rights reserved.
|
||||
| Copyright (c) 2018 https://www.skycaiji.com All rights reserved.
|
||||
|--------------------------------------------------------------------------
|
||||
| 使用协议 http://www.skycaiji.com/licenses
|
||||
| 使用协议 https://www.skycaiji.com/licenses
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
@ -188,7 +188,7 @@ class Cpattern extends BaseController {
|
|||
'rule' =>array('rule','rule_multi','rule_multi_type','rule_multi_str','rule_merge'),
|
||||
'auto' =>'auto',
|
||||
'xpath' =>array('xpath','xpath_multi','xpath_multi_type','xpath_multi_str','xpath_attr','xpath_attr_custom'),
|
||||
'json' =>array('json','json_arr','json_arr_implode'),
|
||||
'json' =>array('json','json_arr','json_arr_implode','json_loop'),
|
||||
'page' =>array('page','page_rule','page_rule_merge','page_rule_multi','page_rule_multi_str'),
|
||||
'words' =>'words',
|
||||
'num' => array('num_start','num_end'),
|
||||
|
@ -237,6 +237,7 @@ class Cpattern extends BaseController {
|
|||
}elseif($op=='sub'){
|
||||
|
||||
$process=input('process/a',null,'trim');
|
||||
$process=array_array_map('trim', $process);
|
||||
if(empty($process)){
|
||||
$process='';
|
||||
}else{
|
||||
|
@ -246,7 +247,6 @@ class Cpattern extends BaseController {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
$objid=input('objid','');
|
||||
$this->success('',null,array('process'=>$process,'process_json'=>empty($process)?'':json_encode($process),'objid'=>$objid));
|
||||
}
|
||||
|
@ -257,6 +257,7 @@ class Cpattern extends BaseController {
|
|||
}elseif($op=='load'){
|
||||
|
||||
$process=input('process/a',null,'trim');
|
||||
$process=array_array_map('trim', $process);
|
||||
$this->assign('process',$process);
|
||||
return $this->fetch('process_load');
|
||||
}
|
||||
|
@ -382,7 +383,7 @@ class Cpattern extends BaseController {
|
|||
$curLevel=input('level/d',0);
|
||||
$curLevel=$curLevel>0?$curLevel:0;
|
||||
|
||||
$levelData=$eCpattern->get_level_urls($source_url,$curLevel);
|
||||
$levelData=$eCpattern->collLevelUrls($source_url,$curLevel);
|
||||
|
||||
$eCpattern->success('',null,array('urls'=>$levelData['urls'],'levelName'=>$levelData['levelName'],'nextLevel'=>$levelData['nextLevel']));
|
||||
}elseif('cont_url'==$op){
|
||||
|
@ -445,19 +446,36 @@ class Cpattern extends BaseController {
|
|||
}
|
||||
|
||||
$val_list=$eCpattern->getFields($cont_url);
|
||||
|
||||
if(empty($eCpattern->first_loop_field)){
|
||||
|
||||
$val_list=array($val_list);
|
||||
}
|
||||
|
||||
$md5Url=md5($cont_url);
|
||||
$msg='';
|
||||
if(isset($eCpattern->exclude_cont_urls[$md5Url])){
|
||||
if(empty($eCpattern->first_loop_field)){
|
||||
|
||||
$msg=reset($eCpattern->exclude_cont_urls[$md5Url]);
|
||||
$msg=$eCpattern->exclude_url_msg($msg);
|
||||
$this->error('中断采集 > '.$msg);
|
||||
}else{
|
||||
|
||||
$num=0;
|
||||
foreach ($eCpattern->exclude_cont_urls[$md5Url] as $k=>$v){
|
||||
$num+=count($v);
|
||||
}
|
||||
$msg='通过数据处理排除了'.$num.'条数据';
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($val_list as $v_k=>$vals){
|
||||
foreach ($vals as $k=>$v){
|
||||
$vals[$k]=$v['value'];
|
||||
}
|
||||
$val_list[$v_k]=$vals;
|
||||
}
|
||||
$eCpattern->success('',null,$val_list);
|
||||
$eCpattern->success($msg,null,$val_list);
|
||||
}elseif('get_paging_urls'==$op){
|
||||
|
||||
$paging_urls=$eCpattern->getPagingUrls($cont_url,$html,true);
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
|--------------------------------------------------------------------------
|
||||
| SkyCaiji (蓝天采集器)
|
||||
|--------------------------------------------------------------------------
|
||||
| Copyright (c) 2018 http://www.skycaiji.com All rights reserved.
|
||||
| Copyright (c) 2018 https://www.skycaiji.com All rights reserved.
|
||||
|--------------------------------------------------------------------------
|
||||
| 使用协议 http://www.skycaiji.com/licenses
|
||||
| 使用协议 https://www.skycaiji.com/licenses
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
@ -23,7 +23,18 @@ class Develop extends BaseController {
|
|||
'select_func' => '选择函数返回值(select)'
|
||||
);
|
||||
|
||||
public static $packTypes=array(
|
||||
'nav'=>'后台导航'
|
||||
);
|
||||
|
||||
public static $frameworks=array(
|
||||
'thinkphp'=>array('6.0','5.1','5.0'),
|
||||
'laravel'=>array('5.5','5.1'),
|
||||
);
|
||||
|
||||
public function pluginAction(){
|
||||
$this->redirect('develop/releaseCms');
|
||||
}
|
||||
public function releaseCmsAction(){
|
||||
$mapp=model('ReleaseApp');
|
||||
if(request()->isPost()){
|
||||
|
@ -84,6 +95,7 @@ class Develop extends BaseController {
|
|||
$appName=input('app');
|
||||
$appName=ucfirst($appName);
|
||||
$config=array();
|
||||
|
||||
if($appName){
|
||||
$cmsData=$mapp->where(array('module'=>'cms','app'=>$appName))->find();
|
||||
|
||||
|
@ -150,7 +162,7 @@ class Develop extends BaseController {
|
|||
}
|
||||
}
|
||||
|
||||
$GLOBALS['content_header']='开发CMS发布插件 <small><a href="http://www.skycaiji.com/manual/doc/cms" target="_blank"><span class="glyphicon glyphicon-info-sign"></span></a></small>';
|
||||
$GLOBALS['content_header']='开发CMS发布插件 <small><a href="https://www.skycaiji.com/manual/doc/cms" target="_blank"><span class="glyphicon glyphicon-info-sign"></span></a></small>';
|
||||
$GLOBALS['breadcrumb']=breadcrumb(array('开发工具','开发CMS发布插件'));
|
||||
$this->assign('config',$config);
|
||||
$this->assign('is_old_plugin',$is_old_plugin);
|
||||
|
@ -208,6 +220,7 @@ class Develop extends BaseController {
|
|||
|
||||
$mapp=model('ReleaseApp');
|
||||
$cmsData=$mapp->where(array('module'=>'cms','app'=>$appData['app']))->find();
|
||||
|
||||
if(!$is_edit&&!empty($cmsData)){
|
||||
|
||||
$this->error('抱歉,已存在'.$appData['app'].'插件');
|
||||
|
@ -369,4 +382,439 @@ EOF;
|
|||
$this->error('代码错误');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*开发应用*/
|
||||
public function appAction(){
|
||||
$app=input('app');
|
||||
$app=strtolower($app);
|
||||
$mapp=model('App');
|
||||
$appData=null;
|
||||
if($app){
|
||||
$appData=$mapp->getByApp($app);
|
||||
}
|
||||
if(request()->isPost()){
|
||||
|
||||
$is_edit=input('edit');
|
||||
if($is_edit&&empty($appData)){
|
||||
$this->error('修改失败,该应用不存在!');
|
||||
}
|
||||
$framework=input('framework');
|
||||
$frameworkVersion=input('framework_version/a');
|
||||
$frameworkVersion=$frameworkVersion[$framework];
|
||||
|
||||
$config=array(
|
||||
'name'=>input('name'),
|
||||
'version'=>input('version'),
|
||||
'desc'=>input('desc','','trim'),
|
||||
'author'=>input('author'),
|
||||
'website'=>input('website','','trim'),
|
||||
'phpv'=>input('phpv'),
|
||||
'agreement'=>input('agreement','','trim')
|
||||
);
|
||||
|
||||
$install=input('install','','trim');
|
||||
$uninstall=input('uninstall','','trim');
|
||||
$upgrade=input('upgrade','','trim');
|
||||
|
||||
if(!empty($framework)&&empty($frameworkVersion)){
|
||||
$this->error('请选择框架版本');
|
||||
}
|
||||
|
||||
$packs=input('packs/a');
|
||||
if(empty($config['name'])){
|
||||
$this->error('请输入应用名称');
|
||||
}
|
||||
if(!$mapp->right_name($config['name'])){
|
||||
$this->error('应用名称只能由汉字、字母、数字和下划线组成');
|
||||
}
|
||||
if(!$is_edit){
|
||||
|
||||
if(!$mapp->right_app($app)){
|
||||
$this->error('app标识不规范');
|
||||
}
|
||||
if($mapp->where('app',$app)->count()>0){
|
||||
|
||||
$this->error('抱歉,已存在'.$app.'应用');
|
||||
}
|
||||
}
|
||||
if(!$mapp->right_version($config['version'])){
|
||||
$this->error('版本号格式错误');
|
||||
}
|
||||
|
||||
if(is_array($packs)){
|
||||
foreach ($packs as $k=>$v){
|
||||
|
||||
$v=json_decode(url_b64decode($v),true);
|
||||
$packs[$k]=array(
|
||||
'name'=>$v['name'],
|
||||
'type'=>$v['type'],
|
||||
'nav_link'=>$v['nav_link'],
|
||||
'target'=>$v['target'],
|
||||
);
|
||||
}
|
||||
}else{
|
||||
$packs=array();
|
||||
}
|
||||
|
||||
$config['framework']=$framework;
|
||||
$config['framework_version']=$frameworkVersion;
|
||||
$config['packs']=$packs;
|
||||
|
||||
$config=$mapp->clear_config($config);
|
||||
|
||||
$provId=model('Provider')->getIdByUrl($config['website']);
|
||||
|
||||
$tplAppPhp=file_get_contents(config('app_path').'/public/app/skycaiji_php.tpl');
|
||||
|
||||
$tplParams=$config;
|
||||
$tplParams['app']=$app;
|
||||
$tplParams['install']=$install;
|
||||
$tplParams['uninstall']=$uninstall;
|
||||
$tplParams['upgrade']=$upgrade;
|
||||
foreach ($tplParams as $k=>$v){
|
||||
if(is_array($v)){
|
||||
|
||||
$v=$this->_format_array($v,"\t");
|
||||
}
|
||||
$tplAppPhp=str_replace('{$'.$k.'}',$v, $tplAppPhp);
|
||||
}
|
||||
unset($tplParams);
|
||||
|
||||
$tplAppPhp=preg_replace('/\{\$[^\{\}]+\}/', '', $tplAppPhp);
|
||||
if(!$is_edit){
|
||||
|
||||
|
||||
$createFiles = array (
|
||||
'index.php'=>file_get_contents(config('app_path').'/public/app/index_php.tpl'),
|
||||
$app.'.php'=>$tplAppPhp,
|
||||
);
|
||||
|
||||
foreach ($createFiles as $filename=>$filecode){
|
||||
write_dir_file(config('apps_path')."/{$app}/{$filename}",$filecode);
|
||||
}
|
||||
|
||||
$mapp->isUpdate(false)->allowField(true)->save(array(
|
||||
'app'=>$app,
|
||||
'addtime'=>time(),
|
||||
'uptime'=>time(),
|
||||
'provider_id'=>$provId
|
||||
));
|
||||
if($mapp->id>0){
|
||||
$mapp->set_config($app,$config);
|
||||
$this->success('应用创建成功','Develop/app?app='.$app);
|
||||
}else{
|
||||
$this->success('应用创建失败');
|
||||
}
|
||||
}else{
|
||||
|
||||
$appFilename=$mapp->app_class_file($app);
|
||||
|
||||
$codeAppPhp=file_get_contents($appFilename);
|
||||
|
||||
if(!empty($codeAppPhp)){
|
||||
|
||||
$appClass=$mapp->app_class($app);
|
||||
$appConfig=array();
|
||||
if(is_object($appClass)){
|
||||
$appConfig=is_array($appClass->config)?$appClass->config:array();
|
||||
}
|
||||
$appConfig=array_merge($appConfig,$config);
|
||||
|
||||
$replaceVars=array('config'=>$appConfig,'install'=>$install,'uninstall'=>$uninstall,'upgrade'=>$upgrade);
|
||||
$replaceVars=array_reverse($replaceVars);
|
||||
foreach ($replaceVars as $reVar=>$reCont){
|
||||
|
||||
$matchVar='/[a-z]+\s*\$'.$reVar.'\s*=(?:([^\'\"\r\n]+?;)|([\s\S]+?[\]\)\'\"]\s*;))/i';
|
||||
|
||||
if(!preg_match($matchVar,$codeAppPhp)){
|
||||
|
||||
$codeAppPhp=preg_replace('/class\s*\w+\s*extends\s*skycaiji\s*\{/i', "$0\r\n\tpublic \$".$reVar."='';", $codeAppPhp);
|
||||
}
|
||||
if(is_array($reCont)){
|
||||
|
||||
$reCont=$this->_format_array($reCont);
|
||||
$codeAppPhp=preg_replace($matchVar, 'public $'.$reVar.'='.$reCont.';', $codeAppPhp);
|
||||
}else{
|
||||
|
||||
preg_match_all($matchVar,$codeAppPhp,$asd);
|
||||
|
||||
$codeAppPhp=preg_replace($matchVar, 'public $'.$reVar."='".addslashes($reCont)."';", $codeAppPhp);
|
||||
}
|
||||
}
|
||||
|
||||
write_dir_file($appFilename, $codeAppPhp);
|
||||
}else{
|
||||
|
||||
write_dir_file($appFilename, $tplAppPhp);
|
||||
}
|
||||
|
||||
$mapp->strict(false)->where('id',$appData['id'])->update(array(
|
||||
'uptime'=>time(),
|
||||
'provider_id'=>$provId
|
||||
));
|
||||
if(version_compare($config['version'],$appData['config']['version'],'<=')===true){
|
||||
|
||||
$mapp->set_config($app,$config);
|
||||
}
|
||||
|
||||
$this->success('修改成功','Develop/app?app='.$app);
|
||||
}
|
||||
}else{
|
||||
$GLOBALS['content_header']='开发应用程序 <small><a href="https://www.skycaiji.com/manual/doc/app" target="_blank"><span class="glyphicon glyphicon-info-sign"></span></a></small>';
|
||||
|
||||
if($appData){
|
||||
$GLOBALS['breadcrumb']=breadcrumb(array(array('url'=>url('App/manage?app='.$appData['app']),'title'=>$appData['config']['name']),'开发应用'));
|
||||
}else{
|
||||
$GLOBALS['breadcrumb']=breadcrumb(array('开发工具','应用程序'));
|
||||
}
|
||||
|
||||
$appClass=$mapp->app_class($app);
|
||||
|
||||
if(is_object($appClass)){
|
||||
if(version_compare($appClass->config['version'], $appData['config']['version'],'>')===true){
|
||||
|
||||
$this->assign('newest_version',$appClass->config['version']);
|
||||
}
|
||||
|
||||
$appFrameworkPath=$appClass->appFrameworkPath();
|
||||
if(is_dir($appFrameworkPath)){
|
||||
|
||||
$this->assign('appFrameworkPath',$appFrameworkPath);
|
||||
}
|
||||
|
||||
$appData['app_class']=$mapp->get_class_vars($appClass);
|
||||
}
|
||||
|
||||
$this->assign('appData',$appData);
|
||||
$this->assign('frameworks',self::$frameworks);
|
||||
$this->assign('packTypes',self::$packTypes);
|
||||
return $this->fetch();
|
||||
}
|
||||
}
|
||||
|
||||
/*添加扩展*/
|
||||
public function appAddPackAction(){
|
||||
if(request()->isPost()){
|
||||
$pack=input('pack/a','','trim');
|
||||
$pack['name']=strip_tags($pack['name']);
|
||||
$pack['type']=strip_tags($pack['type']);
|
||||
$pack['target']=intval($pack['target']);
|
||||
$pack=array_array_map('trim', $pack);
|
||||
if(empty($pack['name'])){
|
||||
$this->error('请输入名称');
|
||||
}
|
||||
if(!model('App')->right_name($pack['name'])){
|
||||
$this->error('名称只能由汉字、字母、数字和下划线组成');
|
||||
}
|
||||
|
||||
if(empty($pack['type'])){
|
||||
$this->error('请选择类型');
|
||||
}
|
||||
if(empty($pack['nav_link'])){
|
||||
$this->error('请输入链接');
|
||||
}
|
||||
$pack['pack_json']=json_encode($pack);
|
||||
$pack['type_name']=self::$packTypes[$pack['type']];
|
||||
$this->success('',null,$pack);
|
||||
}else{
|
||||
$objid=input('objid');
|
||||
$pack=input('pack','','url_b64decode');
|
||||
$pack=$pack?json_decode($pack,true):'';
|
||||
|
||||
$this->assign('objid',$objid);
|
||||
$this->assign('pack',$pack);
|
||||
$this->assign('packTypes',self::$packTypes);
|
||||
return $this->fetch('appAddPack');
|
||||
}
|
||||
}
|
||||
/*下载安装框架*/
|
||||
public function installFrameworkAction(){
|
||||
$app=input('app');
|
||||
$op=input('op');
|
||||
|
||||
if(empty($app)){
|
||||
$this->error('应用app标识错误');
|
||||
}
|
||||
$mapp=model('App');
|
||||
$appClass=$mapp->app_class($app);
|
||||
if(!is_object($appClass)){
|
||||
$this->error('应用配置错误');
|
||||
}
|
||||
|
||||
if(empty($appClass->config['framework'])){
|
||||
$this->error('框架不能为空');
|
||||
}
|
||||
|
||||
if(empty($appClass->config['framework_version'])){
|
||||
$this->error('框架版本错误');
|
||||
}
|
||||
|
||||
$appFrameworkPath=$appClass->appFrameworkPath();
|
||||
if(is_dir($appFrameworkPath)){
|
||||
$this->error('该应用已有框架,如需重新设置框架,请先删除:'.$appFrameworkPath);
|
||||
}
|
||||
|
||||
$eachSize=1024*100;
|
||||
$fileUrl='https://www.skycaiji.com/download/framework/'.$appClass->config['framework'].'/'.$appClass->config['framework_version'].'.zip';
|
||||
|
||||
$filePath=RUNTIME_PATH.'/cache_framework/'.$appClass->config['framework'].$appClass->config['framework_version'].'/';
|
||||
|
||||
if('files'==$op){
|
||||
|
||||
$fileHeader=get_headers($fileUrl,true);
|
||||
if(!preg_match('/\s+20\d\s+ok/i',$fileHeader[0])){
|
||||
$this->error('文件获取失败');
|
||||
}
|
||||
$fileSize=$fileHeader['Content-Length'];
|
||||
$list=array();
|
||||
$count=ceil($fileSize/$eachSize);
|
||||
for($i=0;$i<$count;$i++){
|
||||
|
||||
$list[$i]=array('id'=>$i+1,'start'=>$i*$eachSize,'end'=>($i+1)*$eachSize);
|
||||
if($list[$i]['end']>=$fileSize){
|
||||
$list[$i]['end']=$fileSize;
|
||||
}
|
||||
$list[$i]['end']-=1;
|
||||
}
|
||||
$this->success(true,'',array('size'=>$fileSize,'list'=>$list));
|
||||
}elseif('down'==$op){
|
||||
$fileSize=input('size/d');
|
||||
$startSize=input('start_size/d');
|
||||
$endSize=input('end_size/d');
|
||||
$id=input('id/d');
|
||||
|
||||
$fileCont=file_get_contents($filePath.$id);
|
||||
|
||||
if(!empty($fileCont)){
|
||||
|
||||
$this->success();
|
||||
}else{
|
||||
$blockData=$this->_down_file($fileUrl,null,"{$startSize}-{$endSize}");
|
||||
if(empty($blockData)){
|
||||
|
||||
$this->error();
|
||||
}else{
|
||||
write_dir_file($filePath.$id, $blockData);
|
||||
$this->success();
|
||||
}
|
||||
}
|
||||
}elseif('install'==$op){
|
||||
$fileSize=input('size/d');
|
||||
$count=ceil($fileSize/$eachSize);
|
||||
$is_end=true;
|
||||
for($i=1;$i<=$count;$i++){
|
||||
|
||||
if(!file_exists($filePath.$i)){
|
||||
$is_end=false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if($is_end){
|
||||
|
||||
$error='';
|
||||
$allData='';
|
||||
for($i=1;$i<=$count;$i++){
|
||||
$allData.=file_get_contents($filePath.$i);
|
||||
}
|
||||
write_dir_file($filePath.'framework.zip', $allData);
|
||||
|
||||
try {
|
||||
$zipClass=new \ZipArchive();
|
||||
if($zipClass->open($filePath.'framework.zip')===TRUE){
|
||||
$zipClass->extractTo($appClass->appPath);
|
||||
$zipClass->close();
|
||||
}else{
|
||||
$error='解压失败';
|
||||
}
|
||||
}catch(\Exception $ex){
|
||||
$error='您的服务器不支持ZipArchive解压';
|
||||
}
|
||||
if(!empty($error)){
|
||||
$error.=',请自行将文件'.$filePath.'framework.zip 解压到'.$appClass->appPath.'里';
|
||||
}
|
||||
if($error){
|
||||
$this->error($error);
|
||||
}else{
|
||||
clear_dir($filePath);
|
||||
$this->success('安装成功','Develop/app?app='.$app);
|
||||
}
|
||||
}
|
||||
$this->error();
|
||||
}
|
||||
}
|
||||
|
||||
public function _format_array($arr,$headStr=''){
|
||||
if(is_array($arr)){
|
||||
$arr=var_export($arr,true);
|
||||
}
|
||||
$arr=preg_replace_callback('/^\s*/m', function($matches) use ($headStr){
|
||||
|
||||
$returnStr="\t";
|
||||
for($i=0;$i<(strlen($matches[0])/2);$i++){
|
||||
$returnStr.="\t";
|
||||
}
|
||||
return $headStr.$returnStr;
|
||||
}, $arr);
|
||||
$arr=preg_replace('/\s+array\s*\(/i', 'array(', $arr);
|
||||
return $arr;
|
||||
}
|
||||
|
||||
public function _copy_files($fromPath,$toPath){
|
||||
if(empty($fromPath)||empty($toPath)){
|
||||
return false;
|
||||
}
|
||||
if(is_dir($fromPath)){
|
||||
|
||||
$fileList=scandir($fromPath);
|
||||
foreach( $fileList as $file ){
|
||||
if('.'== $file || '..' == $file){
|
||||
continue;
|
||||
}
|
||||
$fileName=$fromPath.'/'.$file;
|
||||
if(!file_exists($fileName)){
|
||||
continue;
|
||||
}
|
||||
$toFile=$toPath.'/'.$file;
|
||||
if(is_dir( $fileName )){
|
||||
mkdir($toFile,0777,true);
|
||||
$this->_copy_files($fileName, $toFile);
|
||||
}elseif(is_file($fileName)){
|
||||
write_dir_file($toFile,file_get_contents($fileName));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/*获取内容*/
|
||||
public function _down_file($url, $header=null,$size) {
|
||||
$useragents=array(
|
||||
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; AcooBrowser; .NET CLR 1.1.4322; .NET CLR 2.0.50727)",
|
||||
);
|
||||
static $useragent;
|
||||
if(empty($useragent)){
|
||||
$useragent=$useragents[array_rand($useragents)];
|
||||
}
|
||||
|
||||
$ch = curl_init ();
|
||||
curl_setopt ( $ch, CURLOPT_URL, $url );
|
||||
curl_setopt ( $ch, CURLOPT_TIMEOUT, 100 );
|
||||
curl_setopt ( $ch, CURLOPT_RETURNTRANSFER, 1 );
|
||||
curl_setopt ( $ch, CURLOPT_FOLLOWLOCATION, 1 );
|
||||
curl_setopt ( $ch, CURLOPT_HEADER, 0 );
|
||||
curl_setopt ( $ch, CURLOPT_USERAGENT, $useragent);
|
||||
|
||||
|
||||
curl_setopt ( $ch, CURLOPT_SSL_VERIFYPEER, FALSE );
|
||||
curl_setopt ( $ch, CURLOPT_SSL_VERIFYHOST, FALSE );
|
||||
|
||||
if (! empty ( $header )) {
|
||||
curl_setopt ( $ch, CURLOPT_HTTPHEADER, $header );
|
||||
}
|
||||
|
||||
curl_setopt($ch, CURLOPT_RANGE, $size);
|
||||
|
||||
$bytes = curl_exec ( $ch );
|
||||
curl_close ( $ch );
|
||||
return $bytes;
|
||||
}
|
||||
}
|
|
@ -3,9 +3,9 @@
|
|||
|--------------------------------------------------------------------------
|
||||
| SkyCaiji (蓝天采集器)
|
||||
|--------------------------------------------------------------------------
|
||||
| Copyright (c) 2018 http://www.skycaiji.com All rights reserved.
|
||||
| Copyright (c) 2018 https://www.skycaiji.com All rights reserved.
|
||||
|--------------------------------------------------------------------------
|
||||
| 使用协议 http://www.skycaiji.com/licenses
|
||||
| 使用协议 https://www.skycaiji.com/licenses
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
@ -34,13 +34,25 @@ class Index extends BaseController{
|
|||
cache('caiji_auto_backstage_runtime',$runtime);
|
||||
}else{
|
||||
|
||||
$cahce_runtime=cache('caiji_auto_backstage_runtime');
|
||||
$cahce_runtime=intval($cahce_runtime);
|
||||
if($runtime<$cahce_runtime){
|
||||
$cache_runtime=cache('caiji_auto_backstage_runtime');
|
||||
$cache_runtime=intval($cache_runtime);
|
||||
if($runtime<$cache_runtime){
|
||||
|
||||
$this->error('终止旧进程');
|
||||
}
|
||||
}
|
||||
|
||||
$curlCname='caiji_auto_curltime_'.$runtime;
|
||||
if(input('?curltime')){
|
||||
|
||||
$cacheCurl=cache($curlCname);
|
||||
if(!empty($cacheCurl)&&$cacheCurl>input('curltime')){
|
||||
|
||||
$this->error('终止过期进程');
|
||||
}
|
||||
cache($curlCname,input('curltime'));
|
||||
}
|
||||
|
||||
ignore_user_abort(true);
|
||||
set_time_limit(0);
|
||||
|
||||
|
@ -52,19 +64,55 @@ class Index extends BaseController{
|
|||
|
||||
$this->error('自动采集已停止');
|
||||
}
|
||||
$collectTime1=time();
|
||||
try{
|
||||
@get_html(url('Admin/Api/collect?backstage=1',null,false,true),null,array('timeout'=>3));
|
||||
|
||||
$ch = curl_init ();
|
||||
curl_setopt ( $ch, CURLOPT_URL, url('Admin/Api/collect?backstage=1',null,false,true) );
|
||||
curl_setopt ( $ch, CURLOPT_TIMEOUT, 3 );
|
||||
curl_setopt ( $ch, CURLOPT_RETURNTRANSFER, 1 );
|
||||
curl_setopt ( $ch, CURLOPT_FOLLOWLOCATION, 1 );
|
||||
curl_setopt ( $ch, CURLOPT_HEADER, 1 );
|
||||
curl_setopt ( $ch, CURLOPT_NOBODY, 1 );
|
||||
curl_setopt ( $ch, CURLOPT_SSL_VERIFYPEER, FALSE );
|
||||
curl_setopt ( $ch, CURLOPT_SSL_VERIFYHOST, FALSE );
|
||||
curl_exec ( $ch );
|
||||
curl_close ( $ch );
|
||||
}catch(\Exception $ex){
|
||||
|
||||
}
|
||||
|
||||
sleep(20);
|
||||
sleep(15);
|
||||
|
||||
if($GLOBALS['config']['caiji']['auto']){
|
||||
|
||||
try{
|
||||
@get_html(url('Admin/Index/backstage?autorun=1&runtime='.$runtime,null,false,true),null,array('timeout'=>3));
|
||||
|
||||
do {
|
||||
|
||||
$curltime=time();
|
||||
|
||||
$ch = curl_init ();
|
||||
curl_setopt ( $ch, CURLOPT_URL, url('Admin/Index/backstage?autorun=1&runtime='.$runtime.'&curltime='.$curltime,null,false,true) );
|
||||
curl_setopt ( $ch, CURLOPT_TIMEOUT, 2 );
|
||||
curl_setopt ( $ch, CURLOPT_RETURNTRANSFER, 1 );
|
||||
curl_setopt ( $ch, CURLOPT_FOLLOWLOCATION, 1 );
|
||||
curl_setopt ( $ch, CURLOPT_HEADER, 1 );
|
||||
curl_setopt ( $ch, CURLOPT_NOBODY, 1 );
|
||||
curl_setopt ( $ch, CURLOPT_SSL_VERIFYPEER, FALSE );
|
||||
curl_setopt ( $ch, CURLOPT_SSL_VERIFYHOST, FALSE );
|
||||
curl_exec ( $ch );
|
||||
curl_close ( $ch );
|
||||
|
||||
sleep(1);
|
||||
|
||||
$cacheCurl=cache($curlCname);
|
||||
|
||||
$continue=false;
|
||||
if(empty($cacheCurl)||$cacheCurl<$curltime){
|
||||
|
||||
$continue=true;
|
||||
}
|
||||
}while($continue);
|
||||
}catch(\Exception $ex){
|
||||
|
||||
}
|
||||
|
@ -128,7 +176,7 @@ class Index extends BaseController{
|
|||
|
||||
$muser=new \skycaiji\admin\model\User();
|
||||
$userData=$muser->where('username',$username)->find();
|
||||
if(empty($userData)||$userData['password']!=pwd_encrypt($pwd)){
|
||||
if(empty($userData)||$userData['password']!=\skycaiji\admin\model\User::pwd_encrypt($pwd,$userData['salt'])){
|
||||
|
||||
if(!empty($config_login['limit'])){
|
||||
|
||||
|
@ -160,13 +208,28 @@ class Index extends BaseController{
|
|||
cookie('login_history',$username.'|'.md5($username.$userData['password']),array('expire'=>3600*24*15));
|
||||
}
|
||||
session('user_id',$userData['uid']);
|
||||
|
||||
$userGroup=model('Usergroup')->getById($userData['groupid']);
|
||||
|
||||
$serverinfo=input('serverinfo');
|
||||
if(model('Usergroup')->is_admin($userGroup)){
|
||||
session('is_admin',true);
|
||||
}else{
|
||||
session('is_admin',null);
|
||||
}
|
||||
|
||||
$serverinfo=input('_serverinfo');
|
||||
if(empty($serverinfo)){
|
||||
$this->success(lang('user_login_in'),'Admin/Backstage/index');
|
||||
$url=null;
|
||||
if(input('?_referer')){
|
||||
|
||||
$url=input('_referer','','trim');
|
||||
}
|
||||
$url=empty($url)?'Admin/Backstage/index':$url;
|
||||
|
||||
$this->success(lang('user_login_in'),$url);
|
||||
}else{
|
||||
|
||||
$this->success(lang('user_login_in'),null,array('js'=>'window.parent.postMessage("login_success","http://www.skycaiji.com");'));
|
||||
$this->success(lang('user_login_in'),null,array('js'=>'window.parent.postMessage("login_success","*");'));
|
||||
}
|
||||
}else{
|
||||
$this->error(lang('user_error_sublogin'));
|
||||
|
@ -180,6 +243,7 @@ class Index extends BaseController{
|
|||
\think\Cookie::delete('login_history');
|
||||
unset($GLOBALS['user']);
|
||||
session('user_id',null);
|
||||
session('is_admin',null);
|
||||
$this->success(lang('op_success'),'Admin/Index/index');
|
||||
}
|
||||
/*验证码*/
|
||||
|
@ -291,7 +355,10 @@ class Index extends BaseController{
|
|||
$this->error($check['msg']);
|
||||
}
|
||||
|
||||
$muser->strict(false)->where(array('username'=>$stepSession['user']['username']))->update(array('password'=>pwd_encrypt($pwd)));
|
||||
$salt=\skycaiji\admin\model\User::rand_salt();
|
||||
$pwd=\skycaiji\admin\model\User::pwd_encrypt($pwd,$salt);
|
||||
|
||||
$muser->strict(false)->where(array('username'=>$stepSession['user']['username']))->update(array('password'=>$pwd,'salt'=>$salt));
|
||||
session($stepSname,null);
|
||||
$this->success(lang('find_pwd_success'),'Admin/Index/index');
|
||||
}else{
|
||||
|
@ -330,6 +397,11 @@ class Index extends BaseController{
|
|||
}
|
||||
}
|
||||
|
||||
$newPwd='skycaiji123';
|
||||
$newPwdEncrypt=\skycaiji\admin\model\User::pwd_encrypt($newPwd,$stepSession['user']['salt']);
|
||||
|
||||
$this->assign('newPwd',$newPwd);
|
||||
$this->assign('newPwdEncrypt',$newPwdEncrypt);
|
||||
$this->assign('emailStatus',$emailStatus);
|
||||
}
|
||||
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
|--------------------------------------------------------------------------
|
||||
| SkyCaiji (蓝天采集器)
|
||||
|--------------------------------------------------------------------------
|
||||
| Copyright (c) 2018 http://www.skycaiji.com All rights reserved.
|
||||
| Copyright (c) 2018 https://www.skycaiji.com All rights reserved.
|
||||
|--------------------------------------------------------------------------
|
||||
| 使用协议 http://www.skycaiji.com/licenses
|
||||
| 使用协议 https://www.skycaiji.com/licenses
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
@ -22,11 +22,11 @@ class Mystore extends BaseController {
|
|||
|
||||
|
||||
|
||||
$this->redirect('Mystore/collect');
|
||||
$this->redirect('Mystore/rule');
|
||||
}
|
||||
public function collectAction(){
|
||||
public function ruleAction(){
|
||||
$mrule=model('Rule');
|
||||
$type='collect';
|
||||
$type=input('type','collect');
|
||||
$module=input('module');
|
||||
$page=max(1,input('p/d',0));
|
||||
$cond=array('type'=>$type);
|
||||
|
@ -50,6 +50,21 @@ class Mystore extends BaseController {
|
|||
$pagenav = $ruleList->render();
|
||||
$this->assign('pagenav',$pagenav);
|
||||
$ruleList=$ruleList->all();
|
||||
if(!empty($ruleList)){
|
||||
$provList=array();
|
||||
foreach ($ruleList as $k=>$v){
|
||||
$provList[$v['provider_id']]=$v['provider_id'];
|
||||
}
|
||||
$provList=model('Provider')->where('id','in',$provList)->column('*','id');
|
||||
foreach ($ruleList as $k=>$v){
|
||||
$url='https://www.skycaiji.com';
|
||||
if(!empty($v['provider_id'])&&!empty($provList[$v['provider_id']])){
|
||||
|
||||
$url=$provList[$v['provider_id']]['url'];
|
||||
}
|
||||
$ruleList[$k]['store_url']=$url.'/client/rule/detail?id='.$v['store_id'];
|
||||
}
|
||||
}
|
||||
|
||||
$GLOBALS['content_header']='已下载';
|
||||
$GLOBALS['breadcrumb']=breadcrumb(array(array('url'=>url('Mystore/index'),'title'=>'已下载'),lang('rule_'.$type)));
|
||||
|
@ -66,8 +81,8 @@ class Mystore extends BaseController {
|
|||
$id=input('id/d',0);
|
||||
$op=input('op');
|
||||
|
||||
$ops=array('item'=>array('delete'),'list'=>array('deleteall','check_store_update'));
|
||||
if(!in_array($op,$ops['item'])&&!in_array($op,$ops['list'])){
|
||||
$ops=array('item'=>array('delete'),'list'=>array('deleteall','check_store_update'),'else'=>array('auto_check'));
|
||||
if(!in_array($op,$ops['item'])&&!in_array($op,$ops['list'])&&!in_array($op,$ops['else'])){
|
||||
|
||||
$this->error(lang('invalid_op'));
|
||||
}
|
||||
|
@ -82,33 +97,76 @@ class Mystore extends BaseController {
|
|||
if(is_array($ids)&&count($ids)>0){
|
||||
$mrule->where(array('id'=>array('in',$ids)))->delete();
|
||||
}
|
||||
$this->success(lang('op_success'),'Mystore/collect');
|
||||
$this->success(lang('op_success'),'Mystore/rule');
|
||||
}elseif($op=='auto_check'){
|
||||
|
||||
$auto=input('auto/d',0);
|
||||
model('Config')->setConfig('store_auto_check_rule',$auto);
|
||||
if($auto){
|
||||
$this->success('设置为自动检测更新');
|
||||
}else{
|
||||
$this->error('设置为手动检测更新');
|
||||
}
|
||||
}elseif($op=='check_store_update'){
|
||||
|
||||
$ids=input('ids/a');
|
||||
|
||||
if(!empty($ids)){
|
||||
$ruleList=model('Rule')->where(array('id'=>array('in',$ids)))->column('*','store_id');
|
||||
$ruleList=model('Rule')->where(array('id'=>array('in',$ids)))->select();
|
||||
$ruleList1=array();
|
||||
foreach ($ruleList as $k=>$v){
|
||||
$ruleList1[$v['store_id'].'_'.$v['provider_id']]=$v;
|
||||
}
|
||||
$ruleList=$ruleList1;
|
||||
unset($ruleList1);
|
||||
}else{
|
||||
$ruleList=array();
|
||||
}
|
||||
|
||||
$uptimeList=array();
|
||||
$updateList=array();
|
||||
if(!empty($ruleList)){
|
||||
$storeIds=implode(',', array_keys($ruleList));
|
||||
$uptimeList=get_html('http://www.skycaiji.com/Store/Client/collectUpdate?ids='.rawurlencode($storeIds));
|
||||
$uptimeList=json_decode($uptimeList,true);
|
||||
}
|
||||
|
||||
if(!empty($uptimeList)){
|
||||
$updateList=array();
|
||||
$provList=array();
|
||||
$provStoreIds=array();
|
||||
foreach ($ruleList as $v){
|
||||
$provList[$v['provider_id']]=$v['provider_id'];
|
||||
$provStoreIds[$v['provider_id']][$v['store_id']]=$v['store_id'];
|
||||
}
|
||||
if(!empty($provList)){
|
||||
$provList=model('Provider')->where('id','in',$provList)->column('*','id');
|
||||
}else{
|
||||
$provList=array();
|
||||
}
|
||||
|
||||
foreach ($uptimeList as $storeId=>$storeUptime){
|
||||
if($storeUptime>0&&$storeUptime>$ruleList[$storeId]['uptime']){
|
||||
foreach ($provStoreIds as $provId=>$storeIds){
|
||||
$url='';
|
||||
$storeIds=implode(',',$storeIds);
|
||||
$storeIds=rawurlencode($storeIds);
|
||||
if(empty($provId)){
|
||||
|
||||
$updateList[]=$ruleList[$storeId]['id'];
|
||||
$url='https://www.skycaiji.com';
|
||||
}elseif(!empty($provList[$provId])){
|
||||
|
||||
$url=$provList[$provId]['url'];
|
||||
}
|
||||
$url.='/client/rule/update?ids='.$storeIds;
|
||||
|
||||
$uptimeList=get_html($url,null,array('timeout'=>2));
|
||||
$uptimeList=json_decode($uptimeList,true);
|
||||
|
||||
if(!empty($uptimeList)){
|
||||
|
||||
foreach ($uptimeList as $storeId=>$storeUptime){
|
||||
if($storeUptime>0&&$storeUptime>$ruleList[$storeId.'_'.$provId]['uptime']){
|
||||
|
||||
$updateList[]=$ruleList[$storeId.'_'.$provId]['id'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($updateList)){
|
||||
$this->success('',null,$updateList);
|
||||
}else{
|
||||
$this->error();
|
||||
|
@ -135,6 +193,26 @@ class Mystore extends BaseController {
|
|||
$this->assign('pagenav',$pagenav);
|
||||
$appList=$appList->all();
|
||||
|
||||
if(!empty($appList)){
|
||||
$provList=array();
|
||||
foreach ($appList as $k=>$v){
|
||||
if(!empty($v['provider_id'])){
|
||||
|
||||
$provList[$v['provider_id']]=$v['provider_id'];
|
||||
}
|
||||
}
|
||||
$provList=model('Provider')->where('id','in',$provList)->column('*','id');
|
||||
|
||||
foreach ($appList as $k=>$v){
|
||||
$url='https://www.skycaiji.com';
|
||||
if(!empty($v['provider_id'])&&!empty($provList[$v['provider_id']])){
|
||||
|
||||
$url=$provList[$v['provider_id']]['url'];
|
||||
}
|
||||
$appList[$k]['store_url']=$url.'/client/plugin/detail?app='.$v['app'];
|
||||
}
|
||||
}
|
||||
|
||||
$GLOBALS['content_header']='已下载';
|
||||
$GLOBALS['breadcrumb']=breadcrumb(array(array('url'=>url('Mystore/index'),'title'=>'已下载'),'发布插件'));
|
||||
|
||||
|
@ -145,8 +223,8 @@ class Mystore extends BaseController {
|
|||
$id=input('id/d',0);
|
||||
$op=input('op');
|
||||
|
||||
$ops=array('item'=>array('delete'),'list'=>array('deleteall','check_store_update'));
|
||||
if(!in_array($op,$ops['item'])&&!in_array($op,$ops['list'])){
|
||||
$ops=array('item'=>array('delete'),'list'=>array('deleteall','check_store_update'),'else'=>array('auto_check'));
|
||||
if(!in_array($op,$ops['item'])&&!in_array($op,$ops['list'])&&!in_array($op,$ops['else'])){
|
||||
|
||||
$this->error(lang('invalid_op'));
|
||||
}
|
||||
|
@ -162,31 +240,244 @@ class Mystore extends BaseController {
|
|||
$mapp->where(array('id'=>array('in',$ids)))->delete();
|
||||
}
|
||||
$this->success(lang('op_success'),'Mystore/ReleaseApp');
|
||||
}elseif($op=='auto_check'){
|
||||
|
||||
$auto=input('auto/d');
|
||||
model('Config')->setConfig('store_auto_check_plugin',$auto);
|
||||
if($auto){
|
||||
$this->success('设置为自动检测更新');
|
||||
}else{
|
||||
$this->error('设置为手动检测更新');
|
||||
}
|
||||
}elseif($op=='check_store_update'){
|
||||
|
||||
$ids=input('ids/a');
|
||||
|
||||
$appList=model('ReleaseApp')->where(array('module'=>'cms','id'=>array('in',$ids)))->column('*','app');
|
||||
|
||||
$appList1=array();
|
||||
foreach ($appList as $k=>$v){
|
||||
$appList1[$v['app'].'_'.$v['provider_id']]=$v;
|
||||
}
|
||||
$appList=$appList1;
|
||||
unset($appList1);
|
||||
|
||||
$uptimeList=array();
|
||||
if(!empty($appList)){
|
||||
$apps=implode(',', array_keys($appList));
|
||||
$uptimeList=get_html('http://www.skycaiji.com/Store/Client/cmsUpdate?apps='.rawurlencode($apps));
|
||||
$uptimeList=json_decode($uptimeList,true);
|
||||
}
|
||||
if(!empty($uptimeList)){
|
||||
$updateList=array();
|
||||
$provList=array();
|
||||
$provApps=array();
|
||||
foreach ($appList as $v){
|
||||
$provList[$v['provider_id']]=$v['provider_id'];
|
||||
$provApps[$v['provider_id']][$v['app']]=$v['app'];
|
||||
}
|
||||
if(!empty($provList)){
|
||||
$provList=model('Provider')->where('id','in',$provList)->column('*','id');
|
||||
}else{
|
||||
$provList=array();
|
||||
}
|
||||
|
||||
foreach ($uptimeList as $app=>$storeUptime){
|
||||
if($storeUptime>0&&$storeUptime>$appList[$app]['uptime']){
|
||||
foreach ($provApps as $provId=>$apps){
|
||||
$apps=implode(',',$apps);
|
||||
$apps=rawurlencode($apps);
|
||||
$url='https://www.skycaiji.com';
|
||||
if(!empty($provId)&&!empty($provList[$provId])){
|
||||
|
||||
$updateList[]=$appList[$app]['id'];
|
||||
$url=$provList[$provId]['url'];
|
||||
}
|
||||
$url.='/client/plugin/update?apps='.$apps;
|
||||
|
||||
$uptimeList=get_html($url,null,array('timeout'=>2));
|
||||
$uptimeList=json_decode($uptimeList,true);
|
||||
|
||||
if(!empty($uptimeList)){
|
||||
|
||||
foreach ($uptimeList as $app=>$uptime){
|
||||
if($uptime>0&&$uptime>$appList[$app.'_'.$provId]['uptime']){
|
||||
|
||||
$updateList[]=$appList[$app.'_'.$provId]['id'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($updateList)){
|
||||
$this->success('',null,$updateList);
|
||||
}else{
|
||||
$this->error();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*应用程序列表*/
|
||||
public function appAction(){
|
||||
|
||||
$mapp=model('App');
|
||||
$mprov=model('Provider');
|
||||
$dbApps=$mapp->order('uptime desc')->paginate(20);
|
||||
$pagenav=$dbApps->render();
|
||||
$dbApps=$dbApps->all();
|
||||
$dbApps1=array();
|
||||
$provIds=array();
|
||||
foreach ($dbApps as $k=>$v){
|
||||
$v=$v->toArray();
|
||||
$v['config']=$mapp->get_config($v['app']);
|
||||
|
||||
$dbApps1[$v['app']]=$v;
|
||||
|
||||
try {
|
||||
$appClass=$mapp->app_class($v['app'],false);
|
||||
}catch (\Exception $ex ){
|
||||
$appClass=null;
|
||||
}
|
||||
|
||||
if(is_object($appClass)){
|
||||
|
||||
if(version_compare($appClass->config['version'], $v['config']['version'],'>')===true){
|
||||
|
||||
$dbApps1[$v['app']]['newest_version']=$appClass->config['version'];
|
||||
}
|
||||
}
|
||||
if($v['provider_id']>0){
|
||||
$provIds[$v['provider_id']]=$v['provider_id'];
|
||||
}
|
||||
}
|
||||
|
||||
$dbApps=$dbApps1;
|
||||
unset($dbApps1);
|
||||
|
||||
|
||||
$dirApps=scandir(config('apps_path'));
|
||||
$pathApps=array();
|
||||
if(!empty($dirApps)){
|
||||
foreach( $dirApps as $dirApp ){
|
||||
if(isset($dbApps[$dirApp])){
|
||||
continue;
|
||||
}
|
||||
|
||||
try {
|
||||
$appClass=$mapp->app_class($dirApp,false);
|
||||
}catch (\Exception $ex ){
|
||||
$appClass=null;
|
||||
}
|
||||
|
||||
if(is_object($appClass)){
|
||||
|
||||
$pathApp=array('config'=>$mapp->clear_config($appClass->config));
|
||||
if(!empty($pathApp['config']['website'])){
|
||||
|
||||
$pathApp['provider_id']=$mprov->getIdByUrl($pathApp['config']['website']);
|
||||
if($pathApp['provider_id']>0){
|
||||
$provIds[$pathApp['provider_id']]=$pathApp['provider_id'];
|
||||
}
|
||||
}
|
||||
$pathApps[$dirApp]=$pathApp;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$provList=array();
|
||||
if($provIds){
|
||||
$provList=$mprov->where('id','in',$provIds)->column('*','id');
|
||||
}
|
||||
|
||||
if($pathApps){
|
||||
|
||||
$existApps=$mapp->where('app','in',array_keys($pathApps))->column('*','app');
|
||||
foreach ($pathApps as $k=>$v){
|
||||
if(!empty($existApps[$k])){
|
||||
|
||||
unset($pathApps[$k]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$GLOBALS['content_header']='应用程序';
|
||||
$GLOBALS['breadcrumb']=breadcrumb(array('应用程序'));
|
||||
|
||||
$this->assign('pagenav',$pagenav);
|
||||
$this->assign('dbApps',$dbApps);
|
||||
$this->assign('pathApps',$pathApps);
|
||||
$this->assign('provList',$provList);
|
||||
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
public function appOpAction(){
|
||||
$op=input('op');
|
||||
$mapp=model('App');
|
||||
if($op=='auto_check'){
|
||||
|
||||
$auto=input('auto/d');
|
||||
model('Config')->setConfig('store_auto_check_app',$auto);
|
||||
if($auto){
|
||||
$this->success('设置为自动检测更新');
|
||||
}else{
|
||||
$this->error('设置为手动检测更新');
|
||||
}
|
||||
}elseif($op=='check_store_update'){
|
||||
|
||||
$apps=input('apps/a');
|
||||
|
||||
$mprov=model('Provider');
|
||||
$appList=array();
|
||||
$provList=array();
|
||||
$provApps=array();
|
||||
if(!empty($apps)){
|
||||
foreach( $apps as $app ){
|
||||
try {
|
||||
$appClass=$mapp->app_class($app,false);
|
||||
}catch (\Exception $ex ){
|
||||
$appClass=null;
|
||||
}
|
||||
|
||||
if(is_object($appClass)){
|
||||
$provId=$mprov->getIdByUrl($appClass->config['website']);
|
||||
$provList[$provId]=$provId;
|
||||
$appList[$app]=array('provider_id'=>$provId,'version'=>$appClass->config['version']);
|
||||
$provApps[$provId][$app]=$app;
|
||||
}
|
||||
}
|
||||
}
|
||||
$updateList=array();
|
||||
|
||||
$provList=$mprov->where('id','in',$provList)->column('*','id');
|
||||
foreach($provApps as $provId=>$apps){
|
||||
$apps=implode(',',$apps);
|
||||
$apps=rawurlencode($apps);
|
||||
$url='';
|
||||
$appUrl='';
|
||||
$isProv=false;
|
||||
if(!empty($provList[$provId])){
|
||||
|
||||
$url=$provList[$provId]['url'];
|
||||
$isProv=true;
|
||||
}else{
|
||||
|
||||
$url='https://www.skycaiji.com';
|
||||
}
|
||||
$appUrl=$url;
|
||||
$url.='/client/app/update?apps='.$apps;
|
||||
|
||||
$storeList=get_html($url,null,array('timeout'=>2));
|
||||
$storeList=json_decode($storeList,true);
|
||||
|
||||
if(!empty($storeList)){
|
||||
|
||||
foreach ($storeList as $storeApp=>$storeVer){
|
||||
if(!empty($storeVer)&&version_compare($storeVer,$appList[$app]['version'],'>')){
|
||||
|
||||
$updateList[]=array('app'=>$storeApp,'is_provider'=>$isProv,'app_url'=>$appUrl.'/client/app/detail?app='.rawurlencode($storeApp));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($updateList)){
|
||||
$this->success('',null,$updateList);
|
||||
}else{
|
||||
$this->error('无更新');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,143 @@
|
|||
<?php
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| SkyCaiji (蓝天采集器)
|
||||
|--------------------------------------------------------------------------
|
||||
| Copyright (c) 2018 https://www.skycaiji.com All rights reserved.
|
||||
|--------------------------------------------------------------------------
|
||||
| 使用协议 https://www.skycaiji.com/licenses
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
namespace skycaiji\admin\controller;
|
||||
|
||||
class Provider extends BaseController {
|
||||
/*第三方平台*/
|
||||
public function listAction(){
|
||||
$url=input('url');
|
||||
$title=input('title');
|
||||
|
||||
$mprovider=model('Provider');
|
||||
|
||||
$cond=array();
|
||||
if(!empty($url)){
|
||||
$cond['url']=array('like','%'.$url.'%');
|
||||
}
|
||||
if(!empty($title)){
|
||||
$cond['title']=array('like','%'.$title.'%');
|
||||
}
|
||||
|
||||
$list=$mprovider->where($cond)->order('sort desc')->paginate(20,false,paginate_auto_config());
|
||||
$pagenav=$list->render();
|
||||
$list=$list->all();
|
||||
|
||||
$GLOBALS['content_header']='第三方平台';
|
||||
$GLOBALS['breadcrumb']=breadcrumb(array('第三方平台'));
|
||||
|
||||
$this->assign('list',$list);
|
||||
$this->assign('pagenav',$pagenav);
|
||||
|
||||
return $this->fetch();
|
||||
}
|
||||
public function deleteAction(){
|
||||
$id=input('id/d');
|
||||
if(empty($id)){
|
||||
$this->error('id不存在');
|
||||
}
|
||||
$mprovider=model('Provider');
|
||||
$mprovider->where('id',$id)->delete();
|
||||
|
||||
$this->success();
|
||||
}
|
||||
public function enableAction(){
|
||||
$id=input('id/d');
|
||||
$enable=input('enable/d');
|
||||
if(empty($id)){
|
||||
$this->error('id不存在');
|
||||
}
|
||||
$mprovider=model('Provider');
|
||||
$mprovider->strict(false)->where('id',$id)->update(array('enable'=>$enable));
|
||||
|
||||
$this->success();
|
||||
}
|
||||
public function saveAction(){
|
||||
$id=input('id/d');
|
||||
$mprovider=model('Provider');
|
||||
if($id>0){
|
||||
$proData=$mprovider->where('id',$id)->find();
|
||||
if(!empty($proData)){
|
||||
$proData=$proData->toArray();
|
||||
}
|
||||
$this->assign('proData',$proData);
|
||||
}
|
||||
if(request()->isPost()){
|
||||
$url=input('url','','strip_tags');
|
||||
$title=input('title');
|
||||
$sort=input('sort/d',0);
|
||||
$enable=input('enable/d',0);
|
||||
|
||||
$domain=\skycaiji\admin\model\Provider::matchDomain($url);
|
||||
if(empty($domain)){
|
||||
$this->error('网址格式错误');
|
||||
}
|
||||
|
||||
if(empty($proData)||strcasecmp($proData['url'], $url)!==0){
|
||||
|
||||
if($mprovider->where('url',$url)->count()>0){
|
||||
|
||||
$this->error('该网址已存在');
|
||||
}
|
||||
}
|
||||
|
||||
$domainCond=array(
|
||||
'domain'=>$domain
|
||||
);
|
||||
if(!empty($proData)){
|
||||
$domainCond['id']=array('<>',$proData['id']);
|
||||
}
|
||||
if($mprovider->where($domainCond)->count()>0){
|
||||
|
||||
$this->error($domain.' 域名已存在');
|
||||
}
|
||||
|
||||
if(empty($title)){
|
||||
$html=get_html($url,null,array('timeout'=>3));
|
||||
if(preg_match('/<title[^<>]*>(.*?)<\/title>/i', $html,$title)){
|
||||
$title=strip_tags($title[1]);
|
||||
}else{
|
||||
$title='';
|
||||
}
|
||||
}
|
||||
|
||||
$newData=array(
|
||||
'url'=>$url,
|
||||
'title'=>$title,
|
||||
'domain'=>$domain,
|
||||
'enable'=>$enable,
|
||||
'sort'=>$sort
|
||||
);
|
||||
if(empty($proData)){
|
||||
|
||||
$mprovider->isUpdate(false)->allowField(true)->save($newData);
|
||||
$this->success('添加成功','Provider/list');
|
||||
}else{
|
||||
|
||||
$mprovider->strict(false)->where('id',$id)->update($newData);
|
||||
$this->success('修改成功','Provider/list');
|
||||
}
|
||||
}else{
|
||||
return $this->fetch();
|
||||
}
|
||||
}
|
||||
|
||||
public function saveallAction(){
|
||||
$newsort=input('newsort/a');
|
||||
$mprovider=model('Provider');
|
||||
if(is_array($newsort)&&count($newsort)>0){
|
||||
foreach ($newsort as $key=>$val){
|
||||
$mprovider->strict(false)->where('id',intval($key))->update(array('sort'=>intval($val)));
|
||||
}
|
||||
}
|
||||
$this->success('保存成功','Provider/list');
|
||||
}
|
||||
}
|
|
@ -3,9 +3,9 @@
|
|||
|--------------------------------------------------------------------------
|
||||
| SkyCaiji (蓝天采集器)
|
||||
|--------------------------------------------------------------------------
|
||||
| Copyright (c) 2018 http://www.skycaiji.com All rights reserved.
|
||||
| Copyright (c) 2018 https://www.skycaiji.com All rights reserved.
|
||||
|--------------------------------------------------------------------------
|
||||
| 使用协议 http://www.skycaiji.com/licenses
|
||||
| 使用协议 https://www.skycaiji.com/licenses
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
|--------------------------------------------------------------------------
|
||||
| SkyCaiji (蓝天采集器)
|
||||
|--------------------------------------------------------------------------
|
||||
| Copyright (c) 2018 http://www.skycaiji.com All rights reserved.
|
||||
| Copyright (c) 2018 https://www.skycaiji.com All rights reserved.
|
||||
|--------------------------------------------------------------------------
|
||||
| 使用协议 http://www.skycaiji.com/licenses
|
||||
| 使用协议 https://www.skycaiji.com/licenses
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
@ -317,7 +317,7 @@ class Setting extends BaseController {
|
|||
}
|
||||
$this->success(lang('op_success'),'Setting/page_render');
|
||||
}else{
|
||||
$GLOBALS['content_header']='页面渲染设置 <small><a href="http://www.skycaiji.com/manual/doc/page_render" target="_blank"><span class="glyphicon glyphicon-info-sign"></span></a></small>';
|
||||
$GLOBALS['content_header']='页面渲染设置 <small><a href="https://www.skycaiji.com/manual/doc/page_render" target="_blank"><span class="glyphicon glyphicon-info-sign"></span></a></small>';
|
||||
$GLOBALS['breadcrumb']=breadcrumb(array(array('url'=>url('Setting/page_render'),'title'=>'页面渲染设置')));
|
||||
$config=$mconfig->getConfig('page_render','data');
|
||||
$this->assign('config',$config);
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
|--------------------------------------------------------------------------
|
||||
| SkyCaiji (蓝天采集器)
|
||||
|--------------------------------------------------------------------------
|
||||
| Copyright (c) 2018 http://www.skycaiji.com All rights reserved.
|
||||
| Copyright (c) 2018 https://www.skycaiji.com All rights reserved.
|
||||
|--------------------------------------------------------------------------
|
||||
| 使用协议 http://www.skycaiji.com/licenses
|
||||
| 使用协议 https://www.skycaiji.com/licenses
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
@ -21,15 +21,42 @@ class Store extends BaseController {
|
|||
}
|
||||
}
|
||||
public function indexAction(){
|
||||
$url=input('url','','strip_tags');
|
||||
if(!empty($url)&&!is_official_url($url)){
|
||||
|
||||
$provData=model('Provider')->where('url',$url)->find();
|
||||
if(empty($provData)){
|
||||
$this->error($url.' 平台未添加');
|
||||
}
|
||||
if(empty($provData['enable'])){
|
||||
$this->error($url.' 已设置为拒绝访问');
|
||||
}
|
||||
$url=$provData['url'];
|
||||
|
||||
$url.=strpos($url, '?')===false?'?':'&';
|
||||
$url.='clientinfo='.urlencode($GLOBALS['clientinfo']);
|
||||
|
||||
$this->assign('provData',$provData);
|
||||
}
|
||||
if(empty($url)){
|
||||
$url='https://www.skycaiji.com/store';
|
||||
}
|
||||
|
||||
if(!empty($url)){
|
||||
|
||||
}
|
||||
|
||||
$GLOBALS['content_header']=lang('store');
|
||||
$GLOBALS['breadcrumb']=breadcrumb(array(lang('store')));
|
||||
|
||||
$this->assign('url',$url);
|
||||
return $this->fetch();
|
||||
}
|
||||
/*安装规则*/
|
||||
public function installRuleAction(){
|
||||
$mrule=model('Rule');
|
||||
$rule=json_decode(base64_decode(input('post.rule')),true);
|
||||
|
||||
$store_id=intval($rule['store_id']);
|
||||
if(empty($store_id)){
|
||||
$this->dispatchJump(false,'规则id为空');
|
||||
|
@ -48,11 +75,12 @@ class Store extends BaseController {
|
|||
$this->dispatchJump(false,'规则为空');
|
||||
}
|
||||
if($store_id>0){
|
||||
$newRule=array('type'=>$rule['type'],'name'=>$rule['name'],'module'=>$rule['module'],'uptime'=>($rule['uptime']>0?$rule['uptime']:NOW_TIME),'config'=>$rule['config']);
|
||||
$ruleData=$mrule->where(array('type'=>$rule['type'],'store_id'=>$store_id))->find();
|
||||
$newRule=array('type'=>$rule['type'],'module'=>$rule['module'],'store_id'=>$store_id,'name'=>$rule['name'],'uptime'=>($rule['uptime']>0?$rule['uptime']:time()),'config'=>$rule['config']);
|
||||
|
||||
$newRule['provider_id']=$this->_getStoreProvid($rule['store_url']);
|
||||
$ruleData=$mrule->where(array('store_id'=>$newRule['store_id'],'provider_id'=>$newRule['provider_id']))->find();
|
||||
if(empty($ruleData)){
|
||||
|
||||
$newRule['store_id']=$store_id;
|
||||
$newRule['addtime']=NOW_TIME;
|
||||
$mrule->isUpdate(false)->allowField(true)->save($newRule);
|
||||
$ruleId=$mrule->id;
|
||||
|
@ -66,66 +94,169 @@ class Store extends BaseController {
|
|||
$this->dispatchJump(false,'id错误');
|
||||
}
|
||||
}
|
||||
/*规则更新时间*/
|
||||
public function ruleUpdateAction(){
|
||||
$storeIds=input('store_ids');
|
||||
$storeIdList=array('collect'=>array());
|
||||
foreach (array_keys($storeIdList) as $type){
|
||||
if(preg_match_all('/\b'.$type.'\_(\d+)/i', $storeIds,$typeIds)){
|
||||
$storeIdList[$type]=$typeIds[1];
|
||||
}
|
||||
/*安装插件*/
|
||||
public function installPluginAction(){
|
||||
$plugin=json_decode(base64_decode(input('post.plugin')),true);
|
||||
$plugin['code']=base64_decode($plugin['code']);
|
||||
if(empty($plugin['app'])){
|
||||
$this->dispatchJump(false,'标识错误');
|
||||
}
|
||||
$uptimeList=array('status'=>1,'data'=>array());
|
||||
$mrule=model('Rule');
|
||||
if(!empty($storeIdList)){
|
||||
foreach ($storeIdList as $type=>$ids){
|
||||
if(!empty($ids)){
|
||||
$cond=array();
|
||||
$cond['type']=$type;
|
||||
$cond['store_id']=array('in',$ids);
|
||||
$uptimeList['data'][$type]=$mrule->field('`id`,`type`,`store_id`,`uptime`')->where($cond)->column('uptime','store_id');
|
||||
}
|
||||
}
|
||||
if(empty($plugin['name'])){
|
||||
$this->dispatchJump(false,'名称错误');
|
||||
}
|
||||
return jsonp($uptimeList);
|
||||
}
|
||||
/*安装cms发布程序*/
|
||||
public function installCmsAction(){
|
||||
$cms=json_decode(base64_decode(input('post.cms')),true);
|
||||
$cms['code']=base64_decode($cms['code']);
|
||||
if(empty($cms['app'])){
|
||||
$this->dispatchJump(false,'插件id错误');
|
||||
if(empty($plugin['type'])){
|
||||
$this->dispatchJump(false,'类型错误');
|
||||
}
|
||||
if(empty($cms['name'])){
|
||||
$this->dispatchJump(false,'插件名错误');
|
||||
if(empty($plugin['module'])){
|
||||
$this->dispatchJump(false,'模块错误');
|
||||
}
|
||||
if(empty($cms['code'])){
|
||||
if(empty($plugin['code'])){
|
||||
$this->dispatchJump(false,'不是可用的程序');
|
||||
}
|
||||
if(!empty($cms['tpl'])){
|
||||
if(!empty($plugin['tpl'])){
|
||||
|
||||
$cms['tpl']=base64_decode($cms['tpl']);
|
||||
$plugin['tpl']=base64_decode($plugin['tpl']);
|
||||
}
|
||||
|
||||
model('ReleaseApp')->addCms(array('app'=>$cms['app'],'name'=>$cms['name'],'desc'=>$cms['desc'],'uptime'=>$cms['uptime'])
|
||||
,$cms['code'],$cms['tpl']);
|
||||
$newData=array('app'=>$plugin['app'],'name'=>$plugin['name'],'desc'=>$plugin['desc'],'uptime'=>$plugin['uptime']);
|
||||
|
||||
$this->dispatchJump(true);
|
||||
|
||||
$newData['provider_id']=$this->_getStoreProvid($plugin['store_url']);
|
||||
|
||||
if($plugin['type']=='release'){
|
||||
model('ReleaseApp')->addCms($newData,$plugin['code'],$plugin['tpl']);
|
||||
$this->dispatchJump(true);
|
||||
}else{
|
||||
$this->dispatchJump(false);
|
||||
}
|
||||
}
|
||||
/*cms发布插件更新时间*/
|
||||
public function cmsUpdateAction(){
|
||||
/*安装应用程序*/
|
||||
public function installAppAction(){
|
||||
$app=json_decode(base64_decode(input('post.app')),true);
|
||||
if(empty($app['app'])){
|
||||
$this->dispatchJump(false,'app标识错误');
|
||||
}
|
||||
if(!preg_match('/^[\w\-]+$/',$app['app'])){
|
||||
$this->dispatchJump(false,'app标识不规范');
|
||||
}
|
||||
if(empty($app['data'])){
|
||||
$this->dispatchJump(false,'数据错误');
|
||||
}
|
||||
$app['data']=base64_decode($app['data']);
|
||||
|
||||
$filePath=RUNTIME_PATH.'/cache_app_zip/'.$app['app'].'/';
|
||||
|
||||
$complete=false;
|
||||
if($app['block']>0){
|
||||
|
||||
$app['no']=intval($app['no']);
|
||||
write_dir_file($filePath.$app['no'],$app['data']);
|
||||
|
||||
$blockComplete=true;
|
||||
for($i=1;$i<=$app['block'];$i++){
|
||||
if(!file_exists($filePath.$i)){
|
||||
|
||||
$blockComplete=false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if($blockComplete){
|
||||
|
||||
$data=null;
|
||||
for($i=1;$i<=$app['block'];$i++){
|
||||
$data.=file_get_contents($filePath.$i);
|
||||
}
|
||||
write_dir_file($filePath.$app['app'].'.zip',$data);
|
||||
$complete=true;
|
||||
unset($data);
|
||||
}
|
||||
}else{
|
||||
|
||||
write_dir_file($filePath.$app['app'].'.zip',$app['data']);
|
||||
$complete=true;
|
||||
}
|
||||
if($complete){
|
||||
|
||||
$error='';
|
||||
try {
|
||||
$zipClass=new \ZipArchive();
|
||||
if($zipClass->open($filePath.$app['app'].'.zip')===TRUE){
|
||||
$zipClass->extractTo(config('apps_path').'/'.$app['app']);
|
||||
$zipClass->close();
|
||||
}else{
|
||||
$error='解压失败';
|
||||
}
|
||||
}catch(\Exception $ex){
|
||||
$error='您的服务器不支持ZipArchive解压';
|
||||
}
|
||||
|
||||
if($error){
|
||||
$this->dispatchJump(false,$error);
|
||||
}else{
|
||||
clear_dir($filePath);
|
||||
$this->dispatchJump(true);
|
||||
}
|
||||
}else{
|
||||
$this->dispatchJump(true);
|
||||
}
|
||||
}
|
||||
/*统一检测更新*/
|
||||
public function updateAction(){
|
||||
$storeIds=input('store_ids');
|
||||
$storeIds=explode(',', $storeIds);
|
||||
|
||||
$storeApps=input('store_apps');
|
||||
if(preg_match_all('/\bcms\_(\w+)/i', $storeApps,$apps)){
|
||||
$apps=$apps[1];
|
||||
$storeApps=explode(',', $storeApps);
|
||||
|
||||
$storeIdList=array();
|
||||
foreach ($storeIds as $id){
|
||||
if(preg_match('/^(\w+)_(\w+)$/',$id,$id)){
|
||||
$storeIdList[$id[1]][$id[2]]=$id[2];
|
||||
}
|
||||
}
|
||||
$uptimeList=array('status'=>1,'data'=>array());
|
||||
if(!empty($apps)){
|
||||
$cond=array();
|
||||
$cond['module']='cms';
|
||||
$cond['app']=array('in',$apps);
|
||||
$uptimeList['data']=model('ReleaseApp')->where($cond)->column('uptime','app');
|
||||
|
||||
$storeAppList=array();
|
||||
foreach ($storeApps as $app){
|
||||
if(preg_match('/^(\w+)_(\w+)$/',$app,$app)){
|
||||
$storeAppList[$app[1]][$app[2]]=$app[2];
|
||||
}
|
||||
}
|
||||
return jsonp($uptimeList);
|
||||
|
||||
$provId=$this->_getStoreProvid(input('store_url'));
|
||||
|
||||
$updateList=array('status'=>1,'data'=>array());
|
||||
|
||||
if(!empty($storeIdList)){
|
||||
foreach ($storeIdList as $type=>$ids){
|
||||
$list=array();
|
||||
$cond=array('store_id'=>array('in',$ids),'provider_id'=>$provId,'type'=>$type);
|
||||
$list=model('Rule')->field('`id`,`store_id`,`uptime`')->where($cond)->column('uptime','store_id');
|
||||
$list=is_array($list)?$list:array();
|
||||
$updateList['data'][$type]=$list;
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($storeAppList)){
|
||||
foreach ($storeAppList as $type=>$apps){
|
||||
if(empty($type)){
|
||||
continue;
|
||||
}
|
||||
$list=array();
|
||||
$cond=array('app'=>array('in',$apps),'provider_id'=>$provId);
|
||||
if($type=='release'||$type=='cms'){
|
||||
$list=model('ReleaseApp')->where($cond)->column('uptime','app');
|
||||
}elseif($type=='app'){
|
||||
foreach ($apps as $app){
|
||||
|
||||
$appClass=model('App')->app_class($app,false);
|
||||
$list[$app]=$appClass->config['version'];
|
||||
}
|
||||
}
|
||||
$list=is_array($list)?$list:array();
|
||||
$updateList['data'][$type]=$list;
|
||||
}
|
||||
}
|
||||
return jsonp($updateList);
|
||||
}
|
||||
/*站点验证*/
|
||||
public function siteCertificationAction(){
|
||||
|
@ -142,4 +273,13 @@ class Store extends BaseController {
|
|||
$this->dispatchJump(false,'操作错误!');
|
||||
}
|
||||
}
|
||||
/*获取平台域名Id*/
|
||||
protected function _getStoreProvid($storeUrl=null){
|
||||
$referer=request()->server('HTTP_REFERER');
|
||||
if(!empty($referer)){
|
||||
$storeUrl=$referer;
|
||||
}
|
||||
$provId=model('Provider')->getIdByUrl($storeUrl);
|
||||
return $provId;
|
||||
}
|
||||
}
|
|
@ -3,9 +3,9 @@
|
|||
|--------------------------------------------------------------------------
|
||||
| SkyCaiji (蓝天采集器)
|
||||
|--------------------------------------------------------------------------
|
||||
| Copyright (c) 2018 http://www.skycaiji.com All rights reserved.
|
||||
| Copyright (c) 2018 https://www.skycaiji.com All rights reserved.
|
||||
|--------------------------------------------------------------------------
|
||||
| 使用协议 http://www.skycaiji.com/licenses
|
||||
| 使用协议 https://www.skycaiji.com/licenses
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
|--------------------------------------------------------------------------
|
||||
| SkyCaiji (蓝天采集器)
|
||||
|--------------------------------------------------------------------------
|
||||
| Copyright (c) 2018 http://www.skycaiji.com All rights reserved.
|
||||
| Copyright (c) 2018 https://www.skycaiji.com All rights reserved.
|
||||
|--------------------------------------------------------------------------
|
||||
| 使用协议 http://www.skycaiji.com/licenses
|
||||
| 使用协议 https://www.skycaiji.com/licenses
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
|--------------------------------------------------------------------------
|
||||
| SkyCaiji (蓝天采集器)
|
||||
|--------------------------------------------------------------------------
|
||||
| Copyright (c) 2018 http://www.skycaiji.com All rights reserved.
|
||||
| Copyright (c) 2018 https://www.skycaiji.com All rights reserved.
|
||||
|--------------------------------------------------------------------------
|
||||
| 使用协议 http://www.skycaiji.com/licenses
|
||||
| 使用协议 https://www.skycaiji.com/licenses
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
@ -425,10 +425,21 @@ class Tool extends BaseController {
|
|||
public function json_treeAction(){
|
||||
if(request()->isPost()){
|
||||
$url=input('url','','trim');
|
||||
$html=input('html','','trim');
|
||||
$json='';
|
||||
$eCpattern=controller('admin/Cpattern','event');
|
||||
if(!empty($url)){
|
||||
$json=get_html($url);
|
||||
|
||||
$html=get_html($url);
|
||||
}
|
||||
if(!empty($html)){
|
||||
|
||||
if(preg_match($eCpattern::$jsonpRegExp,$html,$json)){
|
||||
|
||||
$json=trim($json['json']).'}';
|
||||
}
|
||||
}
|
||||
|
||||
$this->success('','',array('json'=>$json));
|
||||
}else{
|
||||
$GLOBALS['content_header']='JSON解析';
|
||||
|
@ -436,5 +447,4 @@ class Tool extends BaseController {
|
|||
return $this->fetch();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -3,9 +3,9 @@
|
|||
|--------------------------------------------------------------------------
|
||||
| SkyCaiji (蓝天采集器)
|
||||
|--------------------------------------------------------------------------
|
||||
| Copyright (c) 2018 http://www.skycaiji.com All rights reserved.
|
||||
| Copyright (c) 2018 https://www.skycaiji.com All rights reserved.
|
||||
|--------------------------------------------------------------------------
|
||||
| 使用协议 http://www.skycaiji.com/licenses
|
||||
| 使用协议 https://www.skycaiji.com/licenses
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
@ -22,7 +22,7 @@ class Upgrade extends BaseController{
|
|||
}
|
||||
/*检测更新*/
|
||||
public function newVersionAction(){
|
||||
$version=get_html('http://www.skycaiji.com/upgrade/program/version?v='.SKYCAIJI_VERSION,null,null,'utf-8');
|
||||
$version=get_html('https://www.skycaiji.com/upgrade/program/version?v='.SKYCAIJI_VERSION,null,null,'utf-8');
|
||||
$version=json_decode($version,true);
|
||||
$new_version=trim($version['new_version']);
|
||||
$cur_version=$GLOBALS['config']['version'];
|
||||
|
@ -88,8 +88,8 @@ class Upgrade extends BaseController{
|
|||
$this->success();
|
||||
}
|
||||
}
|
||||
$fileUrl='http://www.skycaiji.com/upgrade/program/getFile?filename='.rawurlencode(base64_encode($fileName));
|
||||
$result=\Requests::get($fileUrl,array(),array('timeout'=>100));
|
||||
$fileUrl='https://www.skycaiji.com/upgrade/program/getFile?filename='.rawurlencode(base64_encode($fileName));
|
||||
$result=\Requests::get($fileUrl,array(),array('timeout'=>100,'verify'=>false));
|
||||
if(200==$result->status_code){
|
||||
|
||||
$newFile=$result->body;
|
||||
|
@ -133,7 +133,7 @@ class Upgrade extends BaseController{
|
|||
unset($md5Files);
|
||||
|
||||
|
||||
$newFileList=get_html('http://www.skycaiji.com/upgrade/program/files',null,array('timeout'=>100),'utf-8');
|
||||
$newFileList=get_html('https://www.skycaiji.com/upgrade/program/files',null,array('timeout'=>100),'utf-8');
|
||||
$newFileList=json_decode($newFileList,true);
|
||||
|
||||
$downFileList=array();
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
|--------------------------------------------------------------------------
|
||||
| SkyCaiji (蓝天采集器)
|
||||
|--------------------------------------------------------------------------
|
||||
| Copyright (c) 2018 http://www.skycaiji.com All rights reserved.
|
||||
| Copyright (c) 2018 https://www.skycaiji.com All rights reserved.
|
||||
|--------------------------------------------------------------------------
|
||||
| 使用协议 http://www.skycaiji.com/licenses
|
||||
| 使用协议 https://www.skycaiji.com/licenses
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
@ -61,7 +61,8 @@ class User extends BaseController {
|
|||
if(!$check['success']){
|
||||
$this->error($check['msg']);
|
||||
}
|
||||
$newData['password']=pwd_encrypt($newData['password']);
|
||||
$newData['salt']=\skycaiji\admin\model\User::rand_salt();
|
||||
$newData['password']=\skycaiji\admin\model\User::pwd_encrypt($newData['password'],$newData['salt']);
|
||||
$newGroup=$musergroup->getById($newData['groupid']);
|
||||
if($musergroup->user_level_limit($newGroup['level'])){
|
||||
$this->error('您不能添加“'.$GLOBALS['user']['group']['name'].'”用户组');
|
||||
|
@ -129,7 +130,8 @@ class User extends BaseController {
|
|||
$this->error($check['msg']);
|
||||
}
|
||||
if(!empty($newData['password'])){
|
||||
$newData['password']=pwd_encrypt($newData['password']);
|
||||
$newData['salt']=\skycaiji\admin\model\User::rand_salt();
|
||||
$newData['password']=\skycaiji\admin\model\User::pwd_encrypt($newData['password'],$newData['salt']);
|
||||
}
|
||||
$newGroup=$musergroup->getById($newData['groupid']);
|
||||
if($musergroup->user_level_limit($newGroup['level'])){
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
|--------------------------------------------------------------------------
|
||||
| SkyCaiji (蓝天采集器)
|
||||
|--------------------------------------------------------------------------
|
||||
| Copyright (c) 2018 http://www.skycaiji.com All rights reserved.
|
||||
| Copyright (c) 2018 https://www.skycaiji.com All rights reserved.
|
||||
|--------------------------------------------------------------------------
|
||||
| 使用协议 http://www.skycaiji.com/licenses
|
||||
| 使用协议 https://www.skycaiji.com/licenses
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -3,9 +3,9 @@
|
|||
|--------------------------------------------------------------------------
|
||||
| SkyCaiji (蓝天采集器)
|
||||
|--------------------------------------------------------------------------
|
||||
| Copyright (c) 2018 http://www.skycaiji.com All rights reserved.
|
||||
| Copyright (c) 2018 https://www.skycaiji.com All rights reserved.
|
||||
|--------------------------------------------------------------------------
|
||||
| 使用协议 http://www.skycaiji.com/licenses
|
||||
| 使用协议 https://www.skycaiji.com/licenses
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
|--------------------------------------------------------------------------
|
||||
| SkyCaiji (蓝天采集器)
|
||||
|--------------------------------------------------------------------------
|
||||
| Copyright (c) 2018 http://www.skycaiji.com All rights reserved.
|
||||
| Copyright (c) 2018 https://www.skycaiji.com All rights reserved.
|
||||
|--------------------------------------------------------------------------
|
||||
| 使用协议 http://www.skycaiji.com/licenses
|
||||
| 使用协议 https://www.skycaiji.com/licenses
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
|--------------------------------------------------------------------------
|
||||
| SkyCaiji (蓝天采集器)
|
||||
|--------------------------------------------------------------------------
|
||||
| Copyright (c) 2018 http://www.skycaiji.com All rights reserved.
|
||||
| Copyright (c) 2018 https://www.skycaiji.com All rights reserved.
|
||||
|--------------------------------------------------------------------------
|
||||
| 使用协议 http://www.skycaiji.com/licenses
|
||||
| 使用协议 https://www.skycaiji.com/licenses
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
@ -115,11 +115,11 @@ class Rdb extends Release{
|
|||
$table=strtolower($table);
|
||||
foreach ($fields as $k=>$v){
|
||||
|
||||
if(preg_match('/^auto_id\@([^\s]+)$/i', $v,$autoidTbName)){
|
||||
$fields[$k]=preg_replace_callback('/auto_id\@([^\s\#]+)[\#]{0,1}/i',function($autoidTbName)use($autoidList){
|
||||
$autoidTbName=trim($autoidTbName[1]);
|
||||
$autoidTbName=strtolower($autoidTbName);
|
||||
$fields[$k]=$autoidList[$autoidTbName];
|
||||
}
|
||||
return $autoidList[$autoidTbName];
|
||||
},$v);
|
||||
}
|
||||
try {
|
||||
if('oracle'==$db_config['db_type']){
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
|--------------------------------------------------------------------------
|
||||
| SkyCaiji (蓝天采集器)
|
||||
|--------------------------------------------------------------------------
|
||||
| Copyright (c) 2018 http://www.skycaiji.com All rights reserved.
|
||||
| Copyright (c) 2018 https://www.skycaiji.com All rights reserved.
|
||||
|--------------------------------------------------------------------------
|
||||
| 使用协议 http://www.skycaiji.com/licenses
|
||||
| 使用协议 https://www.skycaiji.com/licenses
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
|--------------------------------------------------------------------------
|
||||
| SkyCaiji (蓝天采集器)
|
||||
|--------------------------------------------------------------------------
|
||||
| Copyright (c) 2018 http://www.skycaiji.com All rights reserved.
|
||||
| Copyright (c) 2018 https://www.skycaiji.com All rights reserved.
|
||||
|--------------------------------------------------------------------------
|
||||
| 使用协议 http://www.skycaiji.com/licenses
|
||||
| 使用协议 https://www.skycaiji.com/licenses
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
|--------------------------------------------------------------------------
|
||||
| SkyCaiji (蓝天采集器)
|
||||
|--------------------------------------------------------------------------
|
||||
| Copyright (c) 2018 http://www.skycaiji.com All rights reserved.
|
||||
| Copyright (c) 2018 https://www.skycaiji.com All rights reserved.
|
||||
|--------------------------------------------------------------------------
|
||||
| 使用协议 http://www.skycaiji.com/licenses
|
||||
| 使用协议 https://www.skycaiji.com/licenses
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
|--------------------------------------------------------------------------
|
||||
| SkyCaiji (蓝天采集器)
|
||||
|--------------------------------------------------------------------------
|
||||
| Copyright (c) 2018 http://www.skycaiji.com All rights reserved.
|
||||
| Copyright (c) 2018 https://www.skycaiji.com All rights reserved.
|
||||
|--------------------------------------------------------------------------
|
||||
| 使用协议 http://www.skycaiji.com/licenses
|
||||
| 使用协议 https://www.skycaiji.com/licenses
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
|--------------------------------------------------------------------------
|
||||
| SkyCaiji (蓝天采集器)
|
||||
|--------------------------------------------------------------------------
|
||||
| Copyright (c) 2018 http://www.skycaiji.com All rights reserved.
|
||||
| Copyright (c) 2018 https://www.skycaiji.com All rights reserved.
|
||||
|--------------------------------------------------------------------------
|
||||
| 使用协议 http://www.skycaiji.com/licenses
|
||||
| 使用协议 https://www.skycaiji.com/licenses
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
@ -159,13 +159,19 @@ return array(
|
|||
|
||||
'process_module_html'=>'html标签过滤',
|
||||
'process_module_replace'=>'内容替换',
|
||||
'process_module_filter'=>'过滤词',
|
||||
'process_module_filter'=>'关键词过滤',
|
||||
'process_module_if'=>'条件判断',
|
||||
'process_module_translate'=>'翻译',
|
||||
'process_module_tool'=>'工具箱',
|
||||
'process_module_batch'=>'批量替换',
|
||||
'process_module_substr'=>'截取字符串',
|
||||
'process_module_func'=>'使用函数',
|
||||
|
||||
|
||||
'p_m_if_1'=>'满足条件采集',
|
||||
'p_m_if_2'=>'满足条件不采集',
|
||||
'p_m_if_3'=>'不满足条件采集',
|
||||
'p_m_if_4'=>'不满足条件不采集',
|
||||
|
||||
'rele_set'=>'发布设置',
|
||||
'rele_error_detect_null'=>'没有检测到本地CMS程序,您可以手动绑定数据',
|
||||
'rele_error_empty_rele'=>'发布设置不存在',
|
||||
|
@ -296,6 +302,6 @@ return array(
|
|||
'tips_match_url'=>'示例:<a href="http://demo.com/[内容1]/[内容2]">(*)</a>',
|
||||
'tips_matchn_url'=>'示例:http://www.demo.com/[内容1]-[内容2].html',
|
||||
|
||||
'release_upgrade'=>'插件版本过低,请升级插件 <a href="http://www.skycaiji.com/manual/doc/release_upgrade" target="_blank">升级教程</a>',
|
||||
'release_upgrade'=>'插件版本过低,请升级插件 <a href="https://www.skycaiji.com/manual/doc/release_upgrade" target="_blank">升级教程</a>',
|
||||
);
|
||||
?>
|
|
@ -0,0 +1,193 @@
|
|||
<?php
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| SkyCaiji (蓝天采集器)
|
||||
|--------------------------------------------------------------------------
|
||||
| Copyright (c) 2018 https://www.skycaiji.com All rights reserved.
|
||||
|--------------------------------------------------------------------------
|
||||
| 使用协议 https://www.skycaiji.com/licenses
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
namespace skycaiji\admin\model;
|
||||
|
||||
class App extends BaseModel{
|
||||
/*检测是否是应用并获取配置文件实例化*/
|
||||
public function app_class($app,$includeClass=true){
|
||||
static $passPaths=array('.','..','common','admin','skycaiji','vendor');
|
||||
if($this->right_app($app)){
|
||||
|
||||
$path=realpath(config('apps_path').'/'.$app);
|
||||
if(!empty($path)&&is_dir($path)){
|
||||
$appFilename=$this->app_class_file($app);
|
||||
if(!in_array($app,$passPaths)&&file_exists($appFilename)){
|
||||
|
||||
if($includeClass){
|
||||
|
||||
include $appFilename;
|
||||
$appClass=new $app();
|
||||
}else{
|
||||
|
||||
$appFile=file_get_contents($appFilename);
|
||||
if(!empty($appFile)){
|
||||
$appClass=new \stdClass();
|
||||
if(preg_match('/public\s*\$config\s*=(\s*[\s\S]+?[\]\)]\s*\;)/i', $appFile,$config)){
|
||||
|
||||
set_error_handler(null);
|
||||
|
||||
$config=trim($config[1]);
|
||||
try {
|
||||
$config=@eval('return '.$config);
|
||||
}catch(\Exception $e){
|
||||
$config=array();
|
||||
}
|
||||
$appClass->config=is_array($config)?$config:array();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if($appClass){
|
||||
$appClass->config=$this->clear_config($appClass->config);
|
||||
return $appClass;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public function getByApp($app){
|
||||
$data=$this->where('app',$app)->find();
|
||||
if(!empty($data)){
|
||||
$data=$data->toArray();
|
||||
$data['config']=$this->get_config($app);
|
||||
}else{
|
||||
$data=array();
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
public function deleteByApp($app){
|
||||
if($app){
|
||||
$this->where('app',$app)->delete();
|
||||
$this->delete_config($app);
|
||||
}
|
||||
}
|
||||
/*应用配置文件名*/
|
||||
public function app_class_file($app){
|
||||
return realpath(config('apps_path')).DIRECTORY_SEPARATOR.$app.DIRECTORY_SEPARATOR.$app.'.php';
|
||||
}
|
||||
|
||||
/*应用命名规范*/
|
||||
public function right_app($app){
|
||||
|
||||
if(preg_match('/^[a-z]+[a-z\_0-9]*$/', $app)){
|
||||
return strlen($app)<3?false:true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/*版本号格式*/
|
||||
public function right_version($version){
|
||||
if(preg_match('/^\d+(\.\d{1,2}){1,2}$/', $version)){
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
/*名称只能由汉字、字母、数字和下划线组成*/
|
||||
public function right_name($name){
|
||||
if(preg_match('/^[\w+\x{4e00}-\x{9fa5}]+$/iu', $name)){
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
/*清理描述html*/
|
||||
public function clear_desc($desc){
|
||||
$desc=strip_tags($desc,'<p><br><b><i><a>');
|
||||
$desc=preg_replace('/<(p|br|b|i)\s+.*?>/i', "<$1>", $desc);
|
||||
$desc=preg_replace('/[\r\n]+/', ' ', $desc);
|
||||
$desc=trim($desc);
|
||||
return $desc;
|
||||
}
|
||||
/*清理配置信息*/
|
||||
public function clear_config($arr){
|
||||
$arr=is_array($arr)?$arr:array();
|
||||
$desc=$this->clear_desc($arr['desc']);
|
||||
$arr=$this->_array_map('strip_tags', $arr);
|
||||
$arr['desc']=$desc;
|
||||
if(!empty($arr['agreement'])){
|
||||
$arr['agreement']=preg_replace('/^[\s]+/m', '', $arr['agreement']);
|
||||
}
|
||||
return $arr;
|
||||
}
|
||||
/*缓存配置*/
|
||||
public function set_config($app,$config){
|
||||
if(empty($app)){
|
||||
return;
|
||||
}
|
||||
$config=is_array($config)?$config:array();
|
||||
$filename=$this->config_filename($app);
|
||||
$oldConfig=$this->get_config($app);
|
||||
$oldConfig=is_array($oldConfig)?$oldConfig:array();
|
||||
|
||||
$config=array_merge($oldConfig,$config);
|
||||
$config=$this->clear_config($config);
|
||||
|
||||
$config=var_export($config,true);
|
||||
$config='<?php return '.$config.'; ?>';
|
||||
|
||||
write_dir_file($filename, $config);
|
||||
}
|
||||
/*读取配置*/
|
||||
public function get_config($app){
|
||||
$filename=$this->config_filename($app);
|
||||
$config=array();
|
||||
if(file_exists($filename)){
|
||||
|
||||
$config=include $filename;
|
||||
$config=is_array($config)?$config:array();
|
||||
}
|
||||
$config=$this->clear_config($config);
|
||||
|
||||
return $config;
|
||||
}
|
||||
public function delete_config($app){
|
||||
$filename=$this->config_filename($app);
|
||||
unlink($filename);
|
||||
}
|
||||
private function _array_map($callback, $arr1){
|
||||
if(is_array($arr1)){
|
||||
$arr=array();
|
||||
foreach ($arr1 as $k=>$v){
|
||||
if(!is_array($v)){
|
||||
$arr[$k]=call_user_func($callback, $v);
|
||||
}else{
|
||||
$arr[$k]=$this->_array_map($callback,$v);
|
||||
}
|
||||
}
|
||||
}
|
||||
return $arr;
|
||||
}
|
||||
public function config_filename($app){
|
||||
return config('apps_path').'/app/config/'.$app.'.php';
|
||||
}
|
||||
/*获取应用类的变量*/
|
||||
public function get_class_vars($appClass){
|
||||
if(!is_object($appClass)){
|
||||
return null;
|
||||
}
|
||||
$class=new \ReflectionClass($appClass);
|
||||
$vars=$class->getProperties();
|
||||
$values=array();
|
||||
if(is_array($vars)){
|
||||
foreach ($vars as $var){
|
||||
$var=$var->name;
|
||||
$values[$var]=$appClass->$var;
|
||||
}
|
||||
}
|
||||
return $values;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
|
@ -3,9 +3,9 @@
|
|||
|--------------------------------------------------------------------------
|
||||
| SkyCaiji (蓝天采集器)
|
||||
|--------------------------------------------------------------------------
|
||||
| Copyright (c) 2018 http://www.skycaiji.com All rights reserved.
|
||||
| Copyright (c) 2018 https://www.skycaiji.com All rights reserved.
|
||||
|--------------------------------------------------------------------------
|
||||
| 使用协议 http://www.skycaiji.com/licenses
|
||||
| 使用协议 https://www.skycaiji.com/licenses
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
|--------------------------------------------------------------------------
|
||||
| SkyCaiji (蓝天采集器)
|
||||
|--------------------------------------------------------------------------
|
||||
| Copyright (c) 2018 http://www.skycaiji.com All rights reserved.
|
||||
| Copyright (c) 2018 https://www.skycaiji.com All rights reserved.
|
||||
|--------------------------------------------------------------------------
|
||||
| 使用协议 http://www.skycaiji.com/licenses
|
||||
| 使用协议 https://www.skycaiji.com/licenses
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
|--------------------------------------------------------------------------
|
||||
| SkyCaiji (蓝天采集器)
|
||||
|--------------------------------------------------------------------------
|
||||
| Copyright (c) 2018 http://www.skycaiji.com All rights reserved.
|
||||
| Copyright (c) 2018 https://www.skycaiji.com All rights reserved.
|
||||
|--------------------------------------------------------------------------
|
||||
| 使用协议 http://www.skycaiji.com/licenses
|
||||
| 使用协议 https://www.skycaiji.com/licenses
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
|--------------------------------------------------------------------------
|
||||
| SkyCaiji (蓝天采集器)
|
||||
|--------------------------------------------------------------------------
|
||||
| Copyright (c) 2018 http://www.skycaiji.com All rights reserved.
|
||||
| Copyright (c) 2018 https://www.skycaiji.com All rights reserved.
|
||||
|--------------------------------------------------------------------------
|
||||
| 使用协议 http://www.skycaiji.com/licenses
|
||||
| 使用协议 https://www.skycaiji.com/licenses
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
|--------------------------------------------------------------------------
|
||||
| SkyCaiji (蓝天采集器)
|
||||
|--------------------------------------------------------------------------
|
||||
| Copyright (c) 2018 http://www.skycaiji.com All rights reserved.
|
||||
| Copyright (c) 2018 https://www.skycaiji.com All rights reserved.
|
||||
|--------------------------------------------------------------------------
|
||||
| 使用协议 http://www.skycaiji.com/licenses
|
||||
| 使用协议 https://www.skycaiji.com/licenses
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
|--------------------------------------------------------------------------
|
||||
| SkyCaiji (蓝天采集器)
|
||||
|--------------------------------------------------------------------------
|
||||
| Copyright (c) 2018 http://www.skycaiji.com All rights reserved.
|
||||
| Copyright (c) 2018 https://www.skycaiji.com All rights reserved.
|
||||
|--------------------------------------------------------------------------
|
||||
| 使用协议 http://www.skycaiji.com/licenses
|
||||
| 使用协议 https://www.skycaiji.com/licenses
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
|
|
@ -0,0 +1,41 @@
|
|||
<?php
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| SkyCaiji (蓝天采集器)
|
||||
|--------------------------------------------------------------------------
|
||||
| Copyright (c) 2018 https://www.skycaiji.com All rights reserved.
|
||||
|--------------------------------------------------------------------------
|
||||
| 使用协议 https://www.skycaiji.com/licenses
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
namespace skycaiji\admin\model;
|
||||
/*第三方服务商*/
|
||||
class Provider extends BaseModel{
|
||||
/*匹配域名*/
|
||||
public static function matchDomain($url){
|
||||
$domain=null;
|
||||
if(preg_match('/^\w+\:\/\/[\w\-]+(\.[\w\-]+)*(\:\d+){0,1}/', $url,$domain)){
|
||||
$domain=rtrim($domain[0],'/');
|
||||
}else{
|
||||
$domain=null;
|
||||
}
|
||||
return $domain;
|
||||
}
|
||||
/*获取id*/
|
||||
public function getIdByUrl($url){
|
||||
$url=self::matchDomain($url);
|
||||
if(is_official_url($url)){
|
||||
|
||||
$url=null;
|
||||
}
|
||||
$id=0;
|
||||
if(!empty($url)){
|
||||
$id=model('Provider')->where('domain',$url)->value('id');
|
||||
$id=intval($id);
|
||||
}
|
||||
return $id;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
|
@ -3,9 +3,9 @@
|
|||
|--------------------------------------------------------------------------
|
||||
| SkyCaiji (蓝天采集器)
|
||||
|--------------------------------------------------------------------------
|
||||
| Copyright (c) 2018 http://www.skycaiji.com All rights reserved.
|
||||
| Copyright (c) 2018 https://www.skycaiji.com All rights reserved.
|
||||
|--------------------------------------------------------------------------
|
||||
| 使用协议 http://www.skycaiji.com/licenses
|
||||
| 使用协议 https://www.skycaiji.com/licenses
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
|--------------------------------------------------------------------------
|
||||
| SkyCaiji (蓝天采集器)
|
||||
|--------------------------------------------------------------------------
|
||||
| Copyright (c) 2018 http://www.skycaiji.com All rights reserved.
|
||||
| Copyright (c) 2018 https://www.skycaiji.com All rights reserved.
|
||||
|--------------------------------------------------------------------------
|
||||
| 使用协议 http://www.skycaiji.com/licenses
|
||||
| 使用协议 https://www.skycaiji.com/licenses
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
|--------------------------------------------------------------------------
|
||||
| SkyCaiji (蓝天采集器)
|
||||
|--------------------------------------------------------------------------
|
||||
| Copyright (c) 2018 http://www.skycaiji.com All rights reserved.
|
||||
| Copyright (c) 2018 https://www.skycaiji.com All rights reserved.
|
||||
|--------------------------------------------------------------------------
|
||||
| 使用协议 http://www.skycaiji.com/licenses
|
||||
| 使用协议 https://www.skycaiji.com/licenses
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
|--------------------------------------------------------------------------
|
||||
| SkyCaiji (蓝天采集器)
|
||||
|--------------------------------------------------------------------------
|
||||
| Copyright (c) 2018 http://www.skycaiji.com All rights reserved.
|
||||
| Copyright (c) 2018 https://www.skycaiji.com All rights reserved.
|
||||
|--------------------------------------------------------------------------
|
||||
| 使用协议 http://www.skycaiji.com/licenses
|
||||
| 使用协议 https://www.skycaiji.com/licenses
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
@ -22,12 +22,12 @@ class ReleaseApp extends BaseModel{
|
|||
|
||||
$cms['module']='cms';
|
||||
$cms['uptime']=$cms['uptime']>0?$cms['uptime']:NOW_TIME;
|
||||
$cmsData=$this->where(array('module'=>'cms','app'=>$cms['app']))->find();
|
||||
$cmsData=$this->where('app',$cms['app'])->find();
|
||||
$success=false;
|
||||
|
||||
if(!empty($cmsData)){
|
||||
|
||||
$this->strict(false)->where(array('module'=>'cms','app'=>$cms['app']))->update($cms);
|
||||
$this->strict(false)->where('app',$cms['app'])->update($cms);
|
||||
$success=true;
|
||||
}else{
|
||||
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
|--------------------------------------------------------------------------
|
||||
| SkyCaiji (蓝天采集器)
|
||||
|--------------------------------------------------------------------------
|
||||
| Copyright (c) 2018 http://www.skycaiji.com All rights reserved.
|
||||
| Copyright (c) 2018 https://www.skycaiji.com All rights reserved.
|
||||
|--------------------------------------------------------------------------
|
||||
| 使用协议 http://www.skycaiji.com/licenses
|
||||
| 使用协议 https://www.skycaiji.com/licenses
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
|--------------------------------------------------------------------------
|
||||
| SkyCaiji (蓝天采集器)
|
||||
|--------------------------------------------------------------------------
|
||||
| Copyright (c) 2018 http://www.skycaiji.com All rights reserved.
|
||||
| Copyright (c) 2018 https://www.skycaiji.com All rights reserved.
|
||||
|--------------------------------------------------------------------------
|
||||
| 使用协议 http://www.skycaiji.com/licenses
|
||||
| 使用协议 https://www.skycaiji.com/licenses
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
|--------------------------------------------------------------------------
|
||||
| SkyCaiji (蓝天采集器)
|
||||
|--------------------------------------------------------------------------
|
||||
| Copyright (c) 2018 http://www.skycaiji.com All rights reserved.
|
||||
| Copyright (c) 2018 https://www.skycaiji.com All rights reserved.
|
||||
|--------------------------------------------------------------------------
|
||||
| 使用协议 http://www.skycaiji.com/licenses
|
||||
| 使用协议 https://www.skycaiji.com/licenses
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
|--------------------------------------------------------------------------
|
||||
| SkyCaiji (蓝天采集器)
|
||||
|--------------------------------------------------------------------------
|
||||
| Copyright (c) 2018 http://www.skycaiji.com All rights reserved.
|
||||
| Copyright (c) 2018 https://www.skycaiji.com All rights reserved.
|
||||
|--------------------------------------------------------------------------
|
||||
| 使用协议 http://www.skycaiji.com/licenses
|
||||
| 使用协议 https://www.skycaiji.com/licenses
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
@ -97,6 +97,24 @@ class User extends BaseModel{
|
|||
}
|
||||
return $check;
|
||||
}
|
||||
/*获取随机盐*/
|
||||
public static function rand_salt($len=20){
|
||||
$salt="QWERTYUIOPASDFGHJKLZXCVBNM1234567890qwertyuiopasdfghjklzxcvbnm";
|
||||
$salt=str_shuffle($salt);
|
||||
if($len>=strlen($salt)){
|
||||
return $salt;
|
||||
}else{
|
||||
return substr($salt,mt_rand(0,strlen($salt)-$len-1),$len);
|
||||
}
|
||||
}
|
||||
/*密码加密*/
|
||||
public static function pwd_encrypt($pwd,$salt=''){
|
||||
$pwd=sha1($pwd);
|
||||
if(!empty($salt)){
|
||||
$pwd.=$salt;
|
||||
}
|
||||
return md5($pwd);
|
||||
}
|
||||
|
||||
/*检测用户名正确且是否存在*/
|
||||
public function checkUsername($username){
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
|--------------------------------------------------------------------------
|
||||
| SkyCaiji (蓝天采集器)
|
||||
|--------------------------------------------------------------------------
|
||||
| Copyright (c) 2018 http://www.skycaiji.com All rights reserved.
|
||||
| Copyright (c) 2018 https://www.skycaiji.com All rights reserved.
|
||||
|--------------------------------------------------------------------------
|
||||
| 使用协议 http://www.skycaiji.com/licenses
|
||||
| 使用协议 https://www.skycaiji.com/licenses
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
@ -28,6 +28,16 @@ class Usergroup extends BaseModel{
|
|||
return false;
|
||||
}
|
||||
}
|
||||
/*是管理员账号*/
|
||||
public function is_admin($userGroup){
|
||||
if(empty($userGroup)){
|
||||
return false;
|
||||
}
|
||||
if(!empty($userGroup['founder'])||!empty($userGroup['admin'])){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
|
@ -3,9 +3,9 @@
|
|||
|--------------------------------------------------------------------------
|
||||
| SkyCaiji (蓝天采集器)
|
||||
|--------------------------------------------------------------------------
|
||||
| Copyright (c) 2018 http://www.skycaiji.com All rights reserved.
|
||||
| Copyright (c) 2018 https://www.skycaiji.com All rights reserved.
|
||||
|--------------------------------------------------------------------------
|
||||
| 使用协议 http://www.skycaiji.com/licenses
|
||||
| 使用协议 https://www.skycaiji.com/licenses
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
|--------------------------------------------------------------------------
|
||||
| SkyCaiji (蓝天采集器)
|
||||
|--------------------------------------------------------------------------
|
||||
| Copyright (c) 2018 http://www.skycaiji.com All rights reserved.
|
||||
| Copyright (c) 2018 https://www.skycaiji.com All rights reserved.
|
||||
|--------------------------------------------------------------------------
|
||||
| 使用协议 http://www.skycaiji.com/licenses
|
||||
| 使用协议 https://www.skycaiji.com/licenses
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
|--------------------------------------------------------------------------
|
||||
| SkyCaiji (蓝天采集器)
|
||||
|--------------------------------------------------------------------------
|
||||
| Copyright (c) 2018 http://www.skycaiji.com All rights reserved.
|
||||
| Copyright (c) 2018 https://www.skycaiji.com All rights reserved.
|
||||
|--------------------------------------------------------------------------
|
||||
| 使用协议 http://www.skycaiji.com/licenses
|
||||
| 使用协议 https://www.skycaiji.com/licenses
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
<textarea id="win_txt_agreement">{$agreement}</textarea>
|
||||
<script type="text/javascript">
|
||||
(function(){
|
||||
modal('“{$name}({$app})”使用协议','<pre style="max-height:400px;">'+$('#win_txt_agreement').val()+'</pre>',{lg:1});
|
||||
$('#myModal .modal-footer .close').addClass('btn btn-default').removeClass('close');
|
||||
$('#myModal .modal-footer').prepend('<button type="button" class="btn btn-success btn-agreement" data-dismiss="modal">同意</button>');
|
||||
$('#myModal .modal-footer .btn-agreement').bind('click',function(){
|
||||
windowModal('正在安装...',"{:url('Admin/App/install?app='.$app)}");
|
||||
});
|
||||
})();
|
||||
</script>
|
|
@ -0,0 +1,59 @@
|
|||
<script type="text/javascript">
|
||||
'use strict';
|
||||
function apiop_show_msg(msg,success){
|
||||
$('#myModal').modal('hide');//隐藏
|
||||
if(success){
|
||||
toastr.success(msg);
|
||||
}else{
|
||||
toastr.error(msg);
|
||||
}
|
||||
}
|
||||
(function(){
|
||||
var apiName={'install':'安装','uninstall':'卸载','upgrade':'升级'};
|
||||
var apiUrl='{$apiUrl}';
|
||||
var op='{$op}';
|
||||
$.ajax({
|
||||
type:'get',
|
||||
dataType:'json',
|
||||
url:apiUrl,
|
||||
success:function(data){
|
||||
if(typeof(data)=='object'){
|
||||
if(data.status==1){
|
||||
//接口执行成功
|
||||
$.ajax({
|
||||
type:'get',
|
||||
dataType:'json',
|
||||
url:"{:url('App/'.$op.'?success=1&app='.$app)}",
|
||||
success:function(data){
|
||||
if(data.code){
|
||||
//操作成功
|
||||
apiop_show_msg(data.msg,true);
|
||||
if(data.url){
|
||||
setTimeout("window.location.href='"+data.url+"';",2500);
|
||||
}else{
|
||||
setTimeout("window.location.reload()",2500);
|
||||
}
|
||||
}else{
|
||||
//失败
|
||||
apiop_show_msg(data.msg,false);
|
||||
}
|
||||
},
|
||||
error:function(){
|
||||
apiop_show_msg(apiName[op]+'操作失败,请重试!',false);
|
||||
}
|
||||
});
|
||||
}else{
|
||||
//失败
|
||||
var msg=data.info?data.info:(apiName[op]+'失败');
|
||||
apiop_show_msg(msg,false);
|
||||
}
|
||||
}else{
|
||||
apiop_show_msg('返回的不是JSON数据',false);
|
||||
}
|
||||
},
|
||||
error:function(){
|
||||
apiop_show_msg(apiName[op]+'接口运行失败!',false);
|
||||
}
|
||||
});
|
||||
})();
|
||||
</script>
|
|
@ -0,0 +1,68 @@
|
|||
{extend name="common:main" /}
|
||||
{block name="cssjs"}
|
||||
<link rel="stylesheet" href="__PUBLIC__/static/css/app.css?{$Think.config.html_v}" />
|
||||
<script src="__PUBLIC__/static/js/admin/app.js?{$Think.config.html_v}"></script>
|
||||
{/block}
|
||||
{block name="content"}
|
||||
<ul class="manage-nav">
|
||||
<li><a href="{:url('Admin/Mystore/app')}" class="glyphicon glyphicon-list" title="应用列表"></a></li>
|
||||
<li{if !isset($navid)} class="active"{/if}><a href="{:url('App/manage?app='.$app)}">应用详细</a></li>
|
||||
{foreach $navPacks as $k=>$v}
|
||||
<li{$v['is_current']?' class="active"':''}><a href="{:url('App/manage?app='.$app.'&navid='.$k)}" data-url="{$v['nav_link']}"{if $v['target']} target="_blank"{/if}>{$v['name']}</a></li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
{if !isset($navid)}
|
||||
<dl class="dl-info" style="margin-left:20px;margin-top:5px;">
|
||||
<dt>启用</dt>
|
||||
<dd>
|
||||
<a href="javascript:;" id="enable" data-app="{$appData['app']}" data-enable="{$appData['config']['enable']}">{$appData['config']['enable']?'已开启':'已关闭'}</a>
|
||||
</dd>
|
||||
<dt>名称</dt>
|
||||
<dd>{$appData['config']['name']}</dd>
|
||||
<dt>标识</dt>
|
||||
<dd>{$appData['app']}</dd>
|
||||
<dt>版本</dt>
|
||||
<dd>
|
||||
{$appData['config']['version']}
|
||||
{if $newest_version}
|
||||
<a href="javascript:;" id="newest_version" data-app="{$appData['app']}">新版本{$newest_version}</a>
|
||||
{/if}
|
||||
</dd>
|
||||
<dt>框架</dt>
|
||||
<dd>{$appData['config']['framework']?($appData['config']['framework'].$appData['config']['framework_version']):'自定义'}</dd>
|
||||
{if !empty($appData['config']['phpv'])}
|
||||
<dt>PHP</dt>
|
||||
<dd>最低要求php{$appData['config']['phpv']}版本</dd>
|
||||
{/if}
|
||||
<dt>首页</dt>
|
||||
<dd>
|
||||
<a href="{$appUrl}" target="_blank">应用首页</a>
|
||||
</dd>
|
||||
{if !empty($appData['config']['author'])}
|
||||
<dt>作者</dt>
|
||||
<dd>{$appData['config']['author']}</dd>
|
||||
{/if}
|
||||
{if !empty($provData)}
|
||||
<dt>平台</dt>
|
||||
<dd><a href="{:url('admin/store/index?url='.urlencode($provData['url']))}">第三方平台</a></dd>
|
||||
{elseif !empty($appData['config']['website'])}
|
||||
<dt>网站</dt>
|
||||
<dd><a href="{$appData['config']['website']}" target="_blank">作者网站</a></dd>
|
||||
{/if}
|
||||
{if $appData['config']['desc']}
|
||||
<dt>描述</dt>
|
||||
<dd>{$appData['config']['desc']}</dd>
|
||||
{/if}
|
||||
<dt>开发</dt>
|
||||
<dd><a href="{:url('Develop/app?app='.$app)}" class="develop">开发应用</a></dd>
|
||||
</dl>
|
||||
{else /}
|
||||
<div class="manage-wrap">
|
||||
<div class="iframe-loading"><div class="loading"> </div>页面加载中...</div>
|
||||
<iframe src="{$navPacks[$navid]['nav_link']}" id="iframe_main" class="iframe-main" width="100%" height="100%" frameborder="0" scrolling="yes"></iframe>
|
||||
</div>
|
||||
{/if}
|
||||
<script type="text/javascript">
|
||||
appClass.init_manage();
|
||||
</script>
|
||||
{/block}
|
|
@ -66,12 +66,12 @@
|
|||
{/if}
|
||||
<tr>
|
||||
<th>当前版本</th>
|
||||
<td>SkyCaiji V{$serverInfo['version']}</td>
|
||||
<td>SkyCaiji V{$serverData['version']}</td>
|
||||
</tr>
|
||||
{if condition="isset($serverInfo['caiji'])"}
|
||||
{if condition="isset($serverData['caiji'])"}
|
||||
<tr>
|
||||
<th>采集状态</th>
|
||||
<td>{$serverInfo['caiji']}</td>
|
||||
<td>{$serverData['caiji']}</td>
|
||||
</tr>
|
||||
{/if}
|
||||
<tr>
|
||||
|
@ -90,23 +90,23 @@
|
|||
<tbody>
|
||||
<tr>
|
||||
<th style="width:90px;">操作系统</th>
|
||||
<td>{$serverInfo['os']}</td>
|
||||
<td>{$serverData['os']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>运行环境</th>
|
||||
<td>{$serverInfo['server']}</td>
|
||||
<td>{$serverData['server']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>数据库</th>
|
||||
<td>{$serverInfo['db']}</td>
|
||||
<td>{$serverData['db']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>PHP版本</th>
|
||||
<td>{$serverInfo['php']}</td>
|
||||
<td>{$serverData['php']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>上传限制</th>
|
||||
<td>{$serverInfo['upload_max']}</td>
|
||||
<td>{$serverData['upload_max']}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{if condition="!empty($collData)"}
|
||||
<script src="__PUBLIC__/static/js/admin/store.js?{$Think.config.html_v}"></script>
|
||||
<div>
|
||||
<form id="win_form_save2store" action="http://www.skycaiji.com/store/client/upload" method="post" target="myModalIframe">
|
||||
<form id="win_form_save2store" action="https://www.skycaiji.com/store/client/upload" method="post" target="myModalIframe">
|
||||
<input type="hidden" name="rule" value="{:base64_encode(serialize($collData))}" />
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
{include file="common:browser_is_old" /}
|
||||
<footer class="footer-end">
|
||||
<p>Powered by <a href="https://www.skycaiji.com" target="_blank">蓝天采集器</a></p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
|
@ -5,6 +5,7 @@
|
|||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
|
||||
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
|
||||
<title>蓝天采集器 后台管理</title>
|
||||
<meta name="generator" content="skycaiji" />
|
||||
<!-- Bootstrap 3.3.7 -->
|
||||
<link rel="stylesheet" href="__PUBLIC__/bootstrap/css/bootstrap.min.css?{$Think.config.html_v}">
|
||||
<!-- Font Awesome -->
|
||||
|
|
|
@ -77,7 +77,7 @@
|
|||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="treeview{$curMenu['store']}{$curMenu['mystore']}">
|
||||
<li class="treeview{$curMenu['store']}{$curMenu['mystore']}{$curMenu['provider']}">
|
||||
<a href="#">
|
||||
<i class="fa fa-cloud"></i> <span>云端</span>
|
||||
<span class="pull-right-container">
|
||||
|
@ -86,6 +86,7 @@
|
|||
</a>
|
||||
<ul class="treeview-menu">
|
||||
<li><a href="{:url('Admin/Store/index')}"><i class="fa fa-circle-o"></i> 云平台</a></li>
|
||||
<li><a href="{:url('Admin/Provider/list')}"><i class="fa fa-circle-o"></i> 第三方</a></li>
|
||||
<li class="treeview menu-open">
|
||||
<a href="#"><i class="fa fa-circle-o"></i> 已下载
|
||||
<span class="pull-right-container">
|
||||
|
@ -93,8 +94,9 @@
|
|||
</span>
|
||||
</a>
|
||||
<ul class="treeview-menu" style="display:block;">
|
||||
<li><a href="{:url('Admin/Mystore/Collect')}"><i class="fa fa-circle-o"></i> 采集规则</a></li>
|
||||
<li><a href="{:url('Admin/Mystore/rule')}"><i class="fa fa-circle-o"></i> 采集规则</a></li>
|
||||
<li><a href="{:url('Admin/Mystore/ReleaseApp')}"><i class="fa fa-circle-o"></i> 发布插件</a></li>
|
||||
<li><a href="{:url('Admin/Mystore/app')}"><i class="fa fa-circle-o"></i> 应用程序</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
@ -129,14 +131,24 @@
|
|||
</span>
|
||||
</a>
|
||||
<ul class="treeview-menu">
|
||||
<li><a href="{:url('Admin/Develop/releaseCms')}"><i class="fa fa-circle-o"></i> CMS发布插件</a></li>
|
||||
<li class="treeview">
|
||||
<a href="#"><i class="fa fa-circle-o"></i> 开发
|
||||
<span class="pull-right-container">
|
||||
<i class="fa fa-angle-left pull-right"></i>
|
||||
</span>
|
||||
</a>
|
||||
<ul class="treeview-menu" style="display:none;">
|
||||
<li><a href="{:url('Admin/Develop/releaseCms')}"><i class="fa fa-circle-o"></i> CMS发布插件</a></li>
|
||||
<li><a href="{:url('Admin/Develop/app')}"><i class="fa fa-circle-o"></i> 应用程序</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="{:url('Admin/Tool/fileManager')}"><i class="fa fa-circle-o"></i> 文件管理</a></li>
|
||||
<li><a href="{:url('Admin/Tool/json_tree')}" target="_blank"><i class="fa fa-circle-o"></i> JSON解析</a></li>
|
||||
<li><a href="{:url('Admin/Tool/logs')}"><i class="fa fa-circle-o"></i> 错误日志</a></li>
|
||||
<li class="treeview">
|
||||
<a href="#"><i class="fa fa-circle-o"></i> 校验
|
||||
<span class="pull-right-container">
|
||||
<i class="fa fa-angle-left pull-right"></i>
|
||||
<i class="fa fa-angle-left pull-right"></i>
|
||||
</span>
|
||||
</a>
|
||||
<ul class="treeview-menu" style="display:none;">
|
||||
|
@ -144,22 +156,21 @@
|
|||
<li><a href="{:url('Admin/Tool/checkdb')}"><i class="fa fa-circle-o"></i> 数据库</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="treeview">
|
||||
<a href="#">
|
||||
<i class="fa fa-dashboard"></i> <span>{$Think.lang.admincp_style}</span>
|
||||
<span class="pull-right-container">
|
||||
<i class="fa fa-angle-left pull-right"></i>
|
||||
</span>
|
||||
</a>
|
||||
<ul class="treeview-menu treeview-config">
|
||||
<li>
|
||||
<div class="checkbox"><label><input id="chk_sidebar_mini" type="checkbox"> {$Think.lang.admincp_sidebar_mini}</label></div>
|
||||
</li>
|
||||
<li>
|
||||
<div>{$Think.lang.admincp_skins}</div>
|
||||
<div id="sidebar_skins"></div>
|
||||
|
||||
<li class="treeview">
|
||||
<a href="#" id="treeview_skins"><i class="fa fa-circle-o"></i> {$Think.lang.admincp_style}
|
||||
<span class="pull-right-container">
|
||||
<i class="fa fa-angle-left pull-right"></i>
|
||||
</span>
|
||||
</a>
|
||||
<ul class="treeview-menu treeview-skins" style="display:none;">
|
||||
<li>
|
||||
<div class="checkbox"><label><input id="chk_sidebar_mini" type="checkbox"> {$Think.lang.admincp_sidebar_mini}</label></div>
|
||||
</li>
|
||||
<li>
|
||||
<div id="sidebar_skins"></div>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
|
|
@ -161,7 +161,10 @@
|
|||
<p class="help-block">直接输入键名,子元素用:[a][b][c]或a.b.c,通配符*</p>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>结果是数组则转换为</label>
|
||||
<div class="checkbox"><label><input type="checkbox" name="field[json_loop]" value="1" {$field['json_loop']?'checked="checked"':''}> 匹配到多个节点允许循环入库</label></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>节点值是数组转换为</label>
|
||||
<select name="field[json_arr]" class="form-control">
|
||||
<option value="implode">字符串</option>
|
||||
<option value="jsonencode">json编码</option>
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
<option value="replace">{$Think.lang.process_module_replace}</option>
|
||||
<option value="batch">{$Think.lang.process_module_batch}</option>
|
||||
<option value="filter">{$Think.lang.process_module_filter}</option>
|
||||
<option value="if">{$Think.lang.process_module_if}</option>
|
||||
<option value="substr">{$Think.lang.process_module_substr}</option>
|
||||
<option value="translate">{$Think.lang.process_module_translate}</option>
|
||||
<option value="tool">{$Think.lang.process_module_tool}</option>
|
||||
|
|
|
@ -56,14 +56,126 @@
|
|||
</div>
|
||||
<div class="c-p-process-module" module="filter">
|
||||
<div class="form-group">
|
||||
<label>一行一个过滤词</label>
|
||||
<label>一行一个关键词</label>
|
||||
<textarea data-process="filter:filter_list" rows="3" class="form-control"></textarea>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>过滤词替换成</label>
|
||||
<div class="radio"><label><input type="radio" data-process="filter:filter_pass" value="" /> 关键词替换成</label></div>
|
||||
<input type="text" data-process="filter:filter_replace" class="form-control" value="" />
|
||||
</div>
|
||||
<div class="checkbox"><label><input type="checkbox" data-process="filter:filter_pass" value="1" /> 检测到过滤词将该字段值设为空</label></div>
|
||||
<div class="radio"><label><input type="radio" data-process="filter:filter_pass" value="1" /> 检测到关键词将该字段值设为空</label></div>
|
||||
<div class="radio"><label><input type="radio" data-process="filter:filter_pass" value="2" /> 检测到关键词不采集该条数据</label></div>
|
||||
<div class="radio"><label><input type="radio" data-process="filter:filter_pass" value="3" /> 未检测到关键词将该字段值设为空</label></div>
|
||||
<div class="radio"><label><input type="radio" data-process="filter:filter_pass" value="4" /> 未检测到关键词不采集该条数据</label></div>
|
||||
</div>
|
||||
<div class="c-p-process-module" module="if">
|
||||
<section>
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">条件判断</span>
|
||||
<select data-process="if:if_type" class="form-control">
|
||||
<option value="1">{$Think.lang.p_m_if_1}</option>
|
||||
<option value="2">{$Think.lang.p_m_if_2}</option>
|
||||
<option value="3">{$Think.lang.p_m_if_3}</option>
|
||||
<option value="4">{$Think.lang.p_m_if_4}</option>
|
||||
</select>
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-default p-m-if-add" type="button"><span class="glyphicon glyphicon-plus" style="color:#3c8dbc"></span></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover p-m-if-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="min-width:95px;">逻辑</th>
|
||||
<th style="min-width:150px;">条件</th>
|
||||
<th style="min-width:200px;">值</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="p-m-if-table-tpl" style="display:none;">
|
||||
<td>
|
||||
<select data-process="if:if_logic" data-is-array="1" class="form-control">
|
||||
<option value="and">并且</option>
|
||||
<option value="or">或者</option>
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<select data-process="if:if_cond" data-is-array="1" class="form-control">
|
||||
<option value="has">包含</option>
|
||||
<option value="nhas">不包含</option>
|
||||
<option value="eq">等于</option>
|
||||
<option value="neq">不等于</option>
|
||||
<option value="heq">恒等于</option>
|
||||
<option value="nheq">不恒等于</option>
|
||||
<option value="gt">大于</option>
|
||||
<option value="egt">大于等于</option>
|
||||
<option value="lt">小于</option>
|
||||
<option value="elt">小于等于</option>
|
||||
<option value="time_eq">时间等于</option>
|
||||
<option value="time_egt">时间大于等于</option>
|
||||
<option value="time_elt">时间小于等于</option>
|
||||
<option value="regexp">正则表达式</option>
|
||||
<option value="func">使用函数</option>
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" data-process="if:if_val" data-is-array="1" class="form-control" />
|
||||
<div class="input-group-btn p-m-if-time" style="display:none;">
|
||||
<select class="form-control">
|
||||
<option value="now">当前时间</option>
|
||||
<option value="today">今天</option>
|
||||
<option value="today +1 day">明天</option>
|
||||
<option value="today +2 day">后天</option>
|
||||
<option value="today -1 day">昨天</option>
|
||||
<option value="today -2 day">前天</option>
|
||||
<option value="-1 monday">本周一</option>
|
||||
<option value="sunday">本周日</option>
|
||||
<option value="today -1 week">上周今天</option>
|
||||
<option value="-2 monday">上周一</option>
|
||||
<option value="-1 sunday">上周日</option>
|
||||
<option value="today +1 week">下周今天</option>
|
||||
<option value="+1 monday">下周一</option>
|
||||
<option value="+2 sunday">下周日</option>
|
||||
<option value="today -1 month">上月今天</option>
|
||||
<option value="first day of today -1 month">上月第一天</option>
|
||||
<option value="last day of today -1 month">上月最后一天</option>
|
||||
<option value="today +1 month">下月今天</option>
|
||||
<option value="first day of today +1 month">下月第一天</option>
|
||||
<option value="last day of today +1 month">下月最后一天</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="input-group-btn p-m-if-func" style="display:none;">
|
||||
<select class="form-control">
|
||||
<option value="">--请选择--</option>
|
||||
{foreach $Think.config.allow_process_if as $k=>$v}
|
||||
<option value="{$k}">{$k}:{$v}</option>
|
||||
{/foreach}
|
||||
{if is_array($Think.config.EXTEND_PROCESS_IF)}
|
||||
{foreach $Think.config.EXTEND_PROCESS_IF as $k=>$v}
|
||||
<option value="{$k}">{$k}:{$v}</option>
|
||||
{/foreach}
|
||||
{/if}
|
||||
</select>
|
||||
<a href="javascript:;" class="form-control"><span class="glyphicon glyphicon-info-sign"></span></a>
|
||||
<span style="display:none;">
|
||||
直接输入函数名(函数名开头可以加!取反),默认会传入字段值,如需传入多个参数,一行一个参数值,用###表示字段值
|
||||
<br>出于安全考虑,如需扩展函数,请在根目录/data/config.php中添加配置:'EXTEND_PROCESS_IF'=>array('PHP函数名'=>'描述')
|
||||
</span>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<a href="javascript:;" class="glyphicon glyphicon-remove p-m-if-del" style="margin-top:8px;"></a>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
<div class="c-p-process-module" module="translate">
|
||||
<div class="form-group">
|
||||
|
@ -106,7 +218,7 @@
|
|||
<div class="c-p-process-module" module="tool">
|
||||
<div class="checkbox">
|
||||
<label><input type="checkbox" data-process="tool:tool_list" value="trim" />去除前后空格</label>
|
||||
<label><input type="checkbox" data-process="tool:tool_list" value="format" />清除文本格式(去除html元素的style、width、height等)</label>
|
||||
<label><input type="checkbox" data-process="tool:tool_list" value="format" />清除文本格式(去除html元素所有样式,如:id、class、style等)</label>
|
||||
<label><input type="checkbox" data-process="tool:tool_list" value="is_img" />内容是图片链接</label>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -133,11 +245,11 @@
|
|||
<select data-process="func:func_name" class="form-control">
|
||||
<option value="">--请选择--</option>
|
||||
{foreach $Think.config.allow_process_func as $k=>$v}
|
||||
<option value="{$k}">{$v}</option>
|
||||
<option value="{$k}">{$k}:{$v}</option>
|
||||
{/foreach}
|
||||
{if is_array($Think.config.EXTEND_PROCESS_FUNC)}
|
||||
{foreach $Think.config.EXTEND_PROCESS_FUNC as $k=>$v}
|
||||
<option value="{$k}">{$v}</option>
|
||||
<option value="{$k}">{$k}:{$v}</option>
|
||||
{/foreach}
|
||||
{/if}
|
||||
</select>
|
||||
|
@ -149,8 +261,8 @@
|
|||
一行一个值,使用###表示当前字段的值,请按函数传参,否则运行出错!<a href="javascript:;" onclick="$(this).siblings('span').show();">扩展函数</a>
|
||||
<span style="display:none;">
|
||||
<br>
|
||||
出于安全考虑,如需扩展函数,请在根目录/data/config.php中添加配置
|
||||
'EXTEND_PROCESS_FUNC'=>array('PHP函数名'=>'描述')
|
||||
出于安全考虑,如需扩展函数,请在根目录/data/config.php中添加配置:
|
||||
'EXTEND_PROCESS_FUNC'=>array('PHP函数名'=>'描述')
|
||||
</span>
|
||||
</p>
|
||||
</div>
|
||||
|
|
|
@ -10,6 +10,33 @@
|
|||
<option value="">默认内容页</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label">获取网址区域</label>
|
||||
<div class="input-group">
|
||||
<textarea name="relation_url[area]" class="form-control" rows="3" data-placeholder-json="请输入json规则,默认获取所有字符" data-placeholder-xpath="请输入xpath规则,默认获取整个页面" placeholder="默认整个页面,{$Think.lang.tips_match_only}"></textarea>
|
||||
<div class="input-group-addon iga-rt iga-rt1">
|
||||
<select name="relation_url[area_module]" data-rule-input="relation_url[area]" class="slt">
|
||||
<option value="">正则</option>
|
||||
<option value="xpath">xpath</option>
|
||||
<option value="json">json</option>
|
||||
</select>
|
||||
<ul data-rule-op="relation_url[area_module]" class="op">
|
||||
<li data-module="" style="display:block;">
|
||||
<a href="javascript:;" title="{$Think.lang.tips_sign_wildcard}" onclick="cpWildcard('[name=\'relation_url[area]\']')">{$Think.lang.sign_wildcard}</a>
|
||||
<a href="javascript:;" title="{$Think.lang.tips_sign_match_only}" onclick="cpMatch('[name=\'relation_url[area]\']',{only:1})">{:cp_sign('match')}</a>
|
||||
<a href="javascript:;" title="{$Think.lang.tips_sign_group_only}" class="blk" onclick="cpMatch('[name=\'relation_url[area]\']',{only:1,group:1})">捕获组</a>
|
||||
</li>
|
||||
<li data-module="xpath">xpath语法</li>
|
||||
<li data-module="json">格式 a.b.c<br>通配符 *</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<p class="help-block" data-rule-set="relation_url[area_module]">
|
||||
<span data-module=""><b>{:cp_sign('match')}</b>标签可获取匹配的数据,否则获取完全匹配的数据</span>
|
||||
<span data-module="xpath" style="display:none;">获取匹配节点的html代码</span>
|
||||
<span data-module="json" style="display:none;">获取匹配的json字符串</span>
|
||||
</p>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label">提取网址规则</label>
|
||||
<div class="input-group">
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
{/if}
|
||||
</ul>
|
||||
<div id="coll_tab_content" class="tab-content" style="margin-top:-1px">
|
||||
<div class="tab-pane fade in active" id="coll_pattern_coll">
|
||||
<div class="tab-pane in active" id="coll_pattern_coll">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
<div class="form-group">
|
||||
|
@ -32,14 +32,6 @@
|
|||
</select>
|
||||
<input type="text" class="form-control" name="config[charset_custom]" style="margin-top:10px;display:none;">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label">页面渲染</label>
|
||||
<div class="input-group">
|
||||
<label class="radio-inline"><input type="radio" name="config[page_render]" value="1"> 是</label>
|
||||
<label class="radio-inline"><input type="radio" name="config[page_render]" value="0"> 否</label>
|
||||
</div>
|
||||
<p class="help-block">需先配置<a href="{:url('Setting/page_render')}">页面渲染</a>,可自动加载ajax内容</p>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label">自动补全网址</label>
|
||||
<div class="input-group">
|
||||
|
@ -48,6 +40,14 @@
|
|||
</div>
|
||||
<p class="help-block">将所有页面源码中的相对地址转换成绝对地址(包含超链接、图片、JS链接等)</p>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label">网址不排重</label>
|
||||
<div class="input-group">
|
||||
<label class="radio-inline"><input type="radio" name="config[url_repeat]" value="1"> 是</label>
|
||||
<label class="radio-inline"><input type="radio" name="config[url_repeat]" value="0"> 否</label>
|
||||
</div>
|
||||
<p class="help-block">默认将已采集网址排重过滤,选择“是”允许重复采集</p>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label">倒序采集</label>
|
||||
<div class="input-group">
|
||||
|
@ -57,12 +57,12 @@
|
|||
<p class="help-block">以相反的顺序采集内容页网址</p>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label">网址不排重</label>
|
||||
<label class="control-label">页面渲染</label>
|
||||
<div class="input-group">
|
||||
<label class="radio-inline"><input type="radio" name="config[url_repeat]" value="1"> 是</label>
|
||||
<label class="radio-inline"><input type="radio" name="config[url_repeat]" value="0"> 否</label>
|
||||
<label class="radio-inline"><input type="radio" name="config[page_render]" value="1"> 是</label>
|
||||
<label class="radio-inline"><input type="radio" name="config[page_render]" value="0"> 否</label>
|
||||
</div>
|
||||
<p class="help-block">默认将已采集网址排重过滤,选择“是”允许重复采集</p>
|
||||
<p class="help-block">需先配置<a href="{:url('Setting/page_render')}">页面渲染</a>,可自动加载ajax内容</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -134,7 +134,7 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="coll_pattern_source">
|
||||
<div class="tab-pane" id="coll_pattern_source">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
<div class="form-group">
|
||||
|
@ -162,7 +162,7 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="coll_pattern_link">
|
||||
<div class="tab-pane" id="coll_pattern_link">
|
||||
<div class="panel panel-default" id="panel_coll_pattern_level_url">
|
||||
<div class="panel-heading">
|
||||
<h4 class="panel-title">
|
||||
|
@ -394,7 +394,7 @@
|
|||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="tab-pane fade" id="coll_pattern_field">
|
||||
<div class="tab-pane" id="coll_pattern_field">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
<div class="h-title">
|
||||
|
@ -461,6 +461,7 @@
|
|||
<a href="javascript:;" class="glyphicon glyphicon-plus add-paging-field" title="添加"></a>
|
||||
</label>
|
||||
<div id="c_p_paging_fields"></div>
|
||||
<p class="help-block">只有选中的字段才会在分页中获取到内容</p>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label">获取分页区域</label>
|
||||
|
|
|
@ -174,6 +174,9 @@ $('#win_test_cont_url button.test-sub').bind('click',function(){
|
|||
}
|
||||
html+='</ul>';
|
||||
}else if(testOp=='get_fields'){
|
||||
if(data.msg){
|
||||
toastr.success(data.msg);
|
||||
}
|
||||
if(data.data.length>1){
|
||||
//循环数据
|
||||
html+='<div class="table-responsive"><table class="table table-bordered table-hover table-test-loop"><thead><tr><td></td>';
|
||||
|
|
|
@ -0,0 +1,156 @@
|
|||
{extend name="common:main" /}
|
||||
{block name="cssjs"}
|
||||
<script type="text/javascript" src="__PUBLIC__/static/js/admin/develop.js?{$Think.config.html_v}"></script>
|
||||
{/block}
|
||||
{block name="content"}
|
||||
<div class="box box-default">
|
||||
<div class="box-body">
|
||||
<form id="form_app" method="post" ajax-submit="true" action="{:url('Admin/Develop/app')}">
|
||||
{if !empty($appData)}
|
||||
<input type="hidden" name="edit" value="1" />
|
||||
<input type="hidden" name="app" value="{$appData['app']}" />
|
||||
{/if}
|
||||
|
||||
{if $newest_version}
|
||||
<div class="alert alert-warning" role="alert">
|
||||
检测到新版本{$newest_version},<a href="javascript:;" id="newest_version">点击升级</a>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<div class="form-group">
|
||||
<label>app标识</label>
|
||||
{if !empty($appData)}
|
||||
<input type="text" value="{$appData['app']}" class="form-control" disabled="disabled">
|
||||
{else /}
|
||||
<input type="text" name="app" class="form-control">
|
||||
{/if}
|
||||
<p class="help-block">标识可由小写字母、下划线、数字组成,长度3个字符以上且以字母开头,建议加入自己的版权以区别他人的应用</p>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>PHP框架</label>
|
||||
{if $appFrameworkPath}
|
||||
<input type="hidden" name="framework" value="{$appData['config']['framework']}" />
|
||||
<input type="hidden" name="framework_version[{$appData['config']['framework']}]" value="{$appData['config']['framework_version']}" />
|
||||
<input type="text" value="{$appData['config']['framework']}{$appData['config']['framework_version']}" class="form-control" disabled="disabled">
|
||||
<p class="help-block">如需修改框架,请先删除:{$appFrameworkPath}</p>
|
||||
{else /}
|
||||
<select name="framework" class="form-control">
|
||||
<option value="">自定义</option>
|
||||
{foreach $frameworks as $fmw=>$vers}
|
||||
<option value="{$fmw}">{$fmw}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
{foreach $frameworks as $fmw=>$vers}
|
||||
<div class="input-group" style="margin-top:5px;display:none;" id="framework_vers_{$fmw}">
|
||||
{foreach $vers as $ver}
|
||||
<label class="radio-inline"><input type="radio" name="framework_version[{$fmw}]" value="{$ver}"> {$ver}</label>
|
||||
{/foreach}
|
||||
</div>
|
||||
{/foreach}
|
||||
<div class="help-block">
|
||||
使用php框架开发该应用
|
||||
{if !empty($appData['config']['framework'])&&empty($appFrameworkPath)}
|
||||
<button id="install_framework" type="button" class="btn btn-xs btn-warning">安装框架{$appData['config']['framework']}{$appData['config']['framework_version']}</button> 注意安装框架将会初始化应用,如应用中存在项目文件请先备份以防丢失!
|
||||
<div id="install_framework_error"></div>
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>名称</label>
|
||||
<input type="text" name="name" class="form-control">
|
||||
<p class="help-block">应用的中文名称</p>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>版本号</label>
|
||||
<input type="text" name="version" class="form-control">
|
||||
<p class="help-block">应用版本号标准格式:x.x或x.x.x(x为数字最多两位数)版本号高于旧版本时会提示升级</p>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>描述</label>
|
||||
<textarea name="desc" class="form-control"></textarea>
|
||||
<p class="help-block">可以使用<p><br><b><i><a>标签</p>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>作者</label>
|
||||
<input type="text" name="author" class="form-control" placeholder="选填">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>平台网址</label>
|
||||
<input type="text" name="website" class="form-control" placeholder="选填">
|
||||
<p class="help-block">第三方平台网址,必须包含前缀http://或https://</p>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>PHP版本</label>
|
||||
<input type="text" name="phpv" class="form-control" placeholder="选填">
|
||||
<p class="help-block">运行该应用要求最低PHP版本,留空则无要求</p>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>协议</label>
|
||||
<textarea name="agreement" class="form-control" placeholder="选填"></textarea>
|
||||
<p class="help-block">安装时提示协议</p>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<table class="table table-hover c-p-request-headers">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="col-xs-2" style="padding-left:0;">程序操作</th>
|
||||
<th class="col-xs-10">相对于应用的链接(开头不加/)</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>安装</td>
|
||||
<td>
|
||||
<input type="text" name="install" value="" class="form-control" placeholder="必填:安装应用接口,没有填1">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>卸载</td>
|
||||
<td>
|
||||
<input type="text" name="uninstall" value="" class="form-control" placeholder="必填:卸载应用接口,没有填1">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>升级</td>
|
||||
<td>
|
||||
<input type="text" name="upgrade" value="" class="form-control" placeholder="必填:升级应用接口,没有填1">
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="h-title">
|
||||
<label class="control-label">扩展</label>
|
||||
<a href="javascript:;" id="add_pack" class="glyphicon glyphicon-plus" title="添加"></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover" id="pack_list" style="margin-bottom:0;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="col-xs-2">名称</th>
|
||||
<th class="col-xs-2">类型</th>
|
||||
<th class="col-xs-2">链接</th>
|
||||
<th class="col-xs-2">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button type="submit" class="btn btn-primary btn-block">{$Think.lang.save}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
developClass.packTypes={$packTypes|json_encode};
|
||||
developClass.app({$appData|json_encode});
|
||||
</script>
|
||||
{/block}
|
|
@ -0,0 +1,42 @@
|
|||
<form id="win_form_pack" method="post" action="{:url('Develop/appAddPack')}">
|
||||
<input type="hidden" name="objid" value="{$objid}" />
|
||||
<div class="form-group">
|
||||
<label>名称</label>
|
||||
<input type="text" name="pack[name]" class="form-control" autocomplete="off" />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>类型</label>
|
||||
<select name="pack[type]" class="form-control">
|
||||
<option value="">请选择</option>
|
||||
{foreach $packTypes as $k=>$v}
|
||||
<option value="{$k}">{$v}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
<p class="help-block type-nav" style="display:none;">显示在应用的管理界面中</p>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>新窗口</label>
|
||||
<div class="input-group">
|
||||
<label class="radio-inline"><input type="radio" name="pack[target]" value="1">是</label>
|
||||
<label class="radio-inline"><input type="radio" name="pack[target]" value="0">否</label>
|
||||
</div>
|
||||
<p class="help-block">是否在新窗口打开连接</p>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>链接</label>
|
||||
<input type="text" name="pack[nav_link]" class="form-control" autocomplete="off" placeholder="默认补全为应用绝对链接" />
|
||||
<div class="help-block">
|
||||
可使用参数:{app}当前应用的根网址,{apps}所有应用的根网址<br>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group form-group-sm">
|
||||
<button type="submit" class="btn btn-primary btn-block">确定</button>
|
||||
</div>
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
developClass.init_app_pack();
|
||||
|
||||
{if condition="!empty($pack)"}
|
||||
developClass.load_app_pack({$pack|json_encode});
|
||||
{/if}
|
||||
</script>
|
|
@ -50,8 +50,8 @@
|
|||
</div>
|
||||
{if condition="!$emailStatus['success']"}
|
||||
<div class="alert alert-success">
|
||||
手动修改:在数据库{:config('database.prefix')}user表中,将username为“{$username}”的password值改为“{:pwd_encrypt('skycaiji123')}”
|
||||
即密码为“skycaiji123”,再登录后台修改密码
|
||||
手动修改:在数据库{:config('database.prefix')}user表中,将username为“{$username}”的password值改为“{$newPwdEncrypt}”
|
||||
即密码为“{$newPwd}”,再登录后台修改密码
|
||||
</div>
|
||||
{/if}
|
||||
{elseif condition="$step eq 3"/}
|
||||
|
|
|
@ -6,14 +6,18 @@
|
|||
<a href="{:url('Admin/index/index')}">蓝天采集器</a>
|
||||
</div>
|
||||
<div class="login-box-body">
|
||||
<p class="login-box-msg"><a href="http://www.skycaiji.com">SkyCaiji</a> V{:constant('SKYCAIJI_VERSION')} 后台管理</p>
|
||||
<p class="login-box-msg"><a href="https://www.skycaiji.com">SkyCaiji</a> V{:constant('SKYCAIJI_VERSION')} 后台管理</p>
|
||||
|
||||
<form action="{:url('Admin/index/login')}" ajax-submit="true" method="post">
|
||||
{:html_usertoken()}
|
||||
<input type="hidden" name="sublogin" value="1" />
|
||||
{if condition="input('?serverinfo')"}
|
||||
<input type="hidden" name="serverinfo" value="1" />
|
||||
{if condition="input('?_serverinfo')"}
|
||||
<input type="hidden" name="_serverinfo" value="1" />
|
||||
{/if}
|
||||
{if condition="input('?_referer')"}
|
||||
<input type="hidden" name="_referer" value="{:input('_referer')}" />
|
||||
{/if}
|
||||
|
||||
<div class="form-group has-feedback">
|
||||
<input type="text" name="username" class="form-control" placeholder="{$Think.lang.user_username}">
|
||||
<span class="glyphicon glyphicon-user form-control-feedback"></span>
|
||||
|
|
|
@ -0,0 +1,102 @@
|
|||
{extend name="common:main" /}
|
||||
{block name="cssjs"}
|
||||
<script src="__PUBLIC__/static/js/admin/store.js?{$Think.config.html_v}"></script>
|
||||
<script src="__PUBLIC__/static/js/admin/app.js?{$Think.config.html_v}"></script>
|
||||
{/block}
|
||||
{block name="content"}
|
||||
<div class="nav-tabs-custom">
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane active">
|
||||
<div class="table-responsive">
|
||||
<table id="app_list" class="table table-striped datatable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>应用</th>
|
||||
<th>作者</th>
|
||||
<th>
|
||||
操作
|
||||
<span class="sep">|</span>
|
||||
<div class="checkbox-inline">
|
||||
<input type="checkbox" id="auto_check" {:empty($GLOBALS['config']['store_auto_check_app'])?'':'checked="checked"'} value="1" title="刷新页面时自动检测" style="margin-left:-17px;" />
|
||||
<a href="javascript:;" id="btn_check" style="color:#333;">检测更新</a>
|
||||
</div>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach name="dbApps" item="item" key="app"}
|
||||
<tr data-app="{$app}">
|
||||
<td>
|
||||
<div style="display:inline;" data-toggle="popover" data-content="{$item['config']['desc']|htmlspecialchars}" data-html="true" data-trigger="hover" data-placement="right">
|
||||
{$item['config']['name']} {$item['config']['version']} <span style="color:#aaa;">({$app})</span>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
{$item['config']['author']}
|
||||
</td>
|
||||
<td>
|
||||
<a href="{:url('App/manage?app='.$app)}" class="manager">管理</a>
|
||||
<span class="sep">|</span>
|
||||
{if $item['newest_version']}
|
||||
<a href="javascript:;" class="upgrade" title="最新版本:{$item['newest_version']}"><b>升级</b></a>
|
||||
<span class="sep">|</span>
|
||||
{/if}
|
||||
{if empty($item['config']['enable'])}
|
||||
<a href="javascript:;" class="enable" data-enable="{$item['config']['enable']}">{$item['config']['enable']?'关闭':'<b>开启</b>'}</a>
|
||||
<span class="sep">|</span>
|
||||
{/if}
|
||||
<a href="javascript:;" class="uninstall">卸载</a>
|
||||
<span class="sep">|</span>
|
||||
{if !empty($provList[$item['provider_id']])}
|
||||
<a href="{$provList[$item['provider_id']]['url']}/client/app/detail?app={$app|urlencode}" data-is-store-url="1" class="store-detail" title="第三方平台">第三方</a>
|
||||
{else/}
|
||||
<a href="https://www.skycaiji.com/client/app/detail?app={$app|urlencode}" data-is-store-url="1" class="store-detail">平台</a>
|
||||
{/if}
|
||||
<div class="app-store-info"></div>
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
{if $pathApps}
|
||||
<tr><td colspan="4"><b style="color:#666;">未安装的应用</b></td></tr>
|
||||
{foreach name="pathApps" item="item" key="app"}
|
||||
<tr data-app="{$app}" data-agreement="{$item['config']['agreement']?'1':''}">
|
||||
<td>
|
||||
<div style="display:inline;" data-toggle="popover" data-content="{$item['config']['desc']|htmlspecialchars}" data-html="true" data-trigger="hover" data-placement="right">
|
||||
{$item['config']['name']} v{$item['config']['version']} <span style="color:#aaa;">({$app})</span>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
{$item['config']['author']}
|
||||
</td>
|
||||
<td>
|
||||
<a href="javascript:;" class="install">安装</a>
|
||||
<span class="sep">|</span>
|
||||
{if !empty($provList[$item['provider_id']])}
|
||||
<a href="{$provList[$item['provider_id']]['url']}/client/app/detail?app={$app|urlencode}" data-is-store-url="1" class="store-detail" title="第三方平台">第三方</a>
|
||||
{else/}
|
||||
<a href="https://www.skycaiji.com/client/app/detail?app={$app|urlencode}" data-is-store-url="1" class="store-detail">平台</a>
|
||||
{/if}
|
||||
<div class="app-store-info"></div>
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
{/if}
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
</tr>
|
||||
{if condition="!empty($pagenav)"}
|
||||
<tr>
|
||||
<td colspan="5">{$pagenav}</td>
|
||||
</tr>
|
||||
{/if}
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
appClass.init_list();
|
||||
</script>
|
||||
{/block}
|
|
@ -6,9 +6,9 @@
|
|||
<div class="box">
|
||||
<div class="box-body">
|
||||
{if condition="!empty($collectRules)"}
|
||||
<div class="page-header"><span class="glyphicon glyphicon-th-list"></span> <a href="{:url('Mystore/collect')}">采集规则</a><i class="ph-more"><a href="{:url('Mystore/collect')}">更多 ></a></i></div>
|
||||
<div class="page-header"><span class="glyphicon glyphicon-th-list"></span> <a href="{:url('Mystore/rule')}">采集规则</a><i class="ph-more"><a href="{:url('Mystore/rule')}">更多 ></a></i></div>
|
||||
{foreach name="collectRules" item="rule"}
|
||||
<div class="col-xs-6 col-sm-4"><a href="http://www.skycaiji.com/collect/rule/detail?id={$rule['store_id']}" class="store-detail">{$rule['name']}</a></div>
|
||||
<div class="col-xs-6 col-sm-4"><a href="https://www.skycaiji.com/collect/rule/detail?id={$rule['store_id']}" class="store-detail">{$rule['name']}</a></div>
|
||||
{/foreach}
|
||||
{/if}
|
||||
</div>
|
||||
|
|
|
@ -7,9 +7,12 @@
|
|||
{php}$orderClass=array($orderKey=>'_'.$sortBy);$orderSort=array($orderKey=>($sortBy=='asc'?'升序':'倒序'));{/php}
|
||||
<div class="nav-tabs-custom">
|
||||
<ul class="nav nav-tabs">
|
||||
<li><a href="{:url('Mystore/Collect')}">采集规则</a></li>
|
||||
<li><a href="{:url('Mystore/Rule')}">采集规则</a></li>
|
||||
<li class="active"><a href="{:url('Mystore/ReleaseApp')}">发布插件</a></li>
|
||||
<li class="nav-check-update"><a href="javascript:;" onclick="check_releaseapp_update()">检测更新</a></li>
|
||||
<li class="nav-check-update">
|
||||
<a href="javascript:;" onclick="check_releaseapp_update()">检测更新</a>
|
||||
<input type="checkbox" id="auto_check" {:empty($GLOBALS['config']['store_auto_check_plugin'])?'':'checked="checked"'} value="1" title="刷新页面时自动检测" />
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane active">
|
||||
|
@ -24,7 +27,7 @@
|
|||
<th>模块</th>
|
||||
<th class="sorting{$orderClass['addtime']}" data-order="addtime" title="添加时间{$orderSort['addtime']}">添加时间</th>
|
||||
<th class="sorting{$orderClass['uptime']}" data-order="uptime" title="更新时间{$orderSort['uptime']}">更新时间</th>
|
||||
<th>详细</th>
|
||||
<th>平台</th>
|
||||
<th>{$Think.lang.op}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
@ -32,12 +35,20 @@
|
|||
{foreach name="appList" item="app"}
|
||||
<tr data-app-id="{$app['id']}">
|
||||
<td class="chk"><input type="checkbox" name="ids[]" value="{$app['id']}" /></td>
|
||||
<td><a href="http://www.skycaiji.com/release/cms/detail?app={$app['app']}" class="store-detail">{$app['name']}</a></td>
|
||||
<td>{$app['name']}</td>
|
||||
<td>{$app['app']}</td>
|
||||
<td>{$app['module']}</td>
|
||||
<td>{:date('Y-m-d H:i',$app['addtime'])}</td>
|
||||
<td>{:date('Y-m-d H:i',$app['uptime'])}</td>
|
||||
<td class="store-info"><a href="http://www.skycaiji.com/release/cms/detail?app={$app['app']}" class="store-detail">详细</a></td>
|
||||
<td class="store-info">
|
||||
<a href="{$app['store_url']}" data-is-store-url="1" class="store-detail">
|
||||
{if empty($app['provider_id'])}
|
||||
官方
|
||||
{else /}
|
||||
第三方
|
||||
{/if}
|
||||
</a>
|
||||
</td>
|
||||
<td><a href="{:url('Develop/releaseCms?app='.$app['app'])}">开发</a> <a href="javascript:;" url="{:url('Mystore/releaseAppOp?op=delete&id='.$app['id'])}" class="delete">删除</a></td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
|
@ -52,7 +63,7 @@
|
|||
</tr>
|
||||
{if condition="!empty($pagenav)"}
|
||||
<tr>
|
||||
<td colspan="5">{$pagenav}</td>
|
||||
<td colspan="8">{$pagenav}</td>
|
||||
</tr>
|
||||
{/if}
|
||||
</tfoot>
|
||||
|
|
|
@ -7,9 +7,12 @@
|
|||
{php}$orderClass=array($orderKey=>'_'.$sortBy);$orderSort=array($orderKey=>($sortBy=='asc'?'升序':'倒序'));{/php}
|
||||
<div class="nav-tabs-custom">
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="active"><a href="{:url('Mystore/Collect')}">采集规则</a></li>
|
||||
<li class="active"><a href="{:url('Mystore/Rule')}">采集规则</a></li>
|
||||
<li><a href="{:url('Mystore/ReleaseApp')}">发布插件</a></li>
|
||||
<li class="nav-check-update"><a href="javascript:;" onclick="check_rules_update()">检测更新</a></li>
|
||||
<li class="nav-check-update">
|
||||
<a href="javascript:;" onclick="check_rules_update()">检测更新</a>
|
||||
<input type="checkbox" id="auto_check" {:empty($GLOBALS['config']['store_auto_check_rule'])?'':'checked="checked"'} value="1" title="刷新页面时自动检测" />
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane active">
|
||||
|
@ -20,9 +23,10 @@
|
|||
<tr>
|
||||
<th class="chk">{$Think.lang.select}</th>
|
||||
<th class="sorting{$orderClass['name']}" data-order="name" title="名称{$orderSort['name']}">名称</th>
|
||||
<th>采集模块</th>
|
||||
<th class="sorting{$orderClass['addtime']}" data-order="addtime" title="添加时间{$orderSort['addtime']}">添加时间</th>
|
||||
<th class="sorting{$orderClass['uptime']}" data-order="uptime" title="更新时间{$orderSort['uptime']}">更新时间</th>
|
||||
<th>详细</th>
|
||||
<th>平台</th>
|
||||
<th>{$Think.lang.op}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
@ -30,10 +34,19 @@
|
|||
{foreach name="ruleList" item="rule"}
|
||||
<tr data-rule-id="{$rule['id']}">
|
||||
<td class="chk"><input type="checkbox" name="ids[]" value="{$rule['id']}" /></td>
|
||||
<td><a href="http://www.skycaiji.com/collect/rule/detail?id={$rule['store_id']}" class="store-detail">{$rule['name']}</a></td>
|
||||
<td>{$rule['name']}</td>
|
||||
<td>{:lang('task_module_'.$rule['module'])}</td>
|
||||
<td>{:date('Y-m-d H:i',$rule['addtime'])}</td>
|
||||
<td>{:date('Y-m-d H:i',$rule['uptime'])}</td>
|
||||
<td class="store-info"><a href="http://www.skycaiji.com/collect/rule/detail?id={$rule['store_id']}" class="store-detail">详细</a></td>
|
||||
<td class="store-info">
|
||||
<a href="{$rule['store_url']}" data-is-store-url="1" class="store-detail">
|
||||
{if empty($rule['provider_id'])}
|
||||
官方
|
||||
{else /}
|
||||
第三方
|
||||
{/if}
|
||||
</a>
|
||||
</td>
|
||||
<td><a href="javascript:;" url="{:url('Mystore/ruleOp?op=delete&id='.$rule['id'])}" class="delete">删除</a></td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
|
@ -41,13 +54,13 @@
|
|||
<tfoot>
|
||||
<tr>
|
||||
<td class="chk"><label><input type="checkbox" id="chkall" onclick="checkall(this,'ids[]')" />全部</label></td>
|
||||
<td colspan="5">
|
||||
<td colspan="6">
|
||||
<button type="button" class="btn btn btn-danger" id="deleteall">{$Think.lang.delete}</button>
|
||||
</td>
|
||||
</tr>
|
||||
{if condition="!empty($pagenav)"}
|
||||
<tr>
|
||||
<td colspan="5">{$pagenav}</td>
|
||||
<td colspan="7">{$pagenav}</td>
|
||||
</tr>
|
||||
{/if}
|
||||
</tfoot>
|
||||
|
|
|
@ -0,0 +1,69 @@
|
|||
{extend name="common:main" /}
|
||||
{block name="cssjs"}
|
||||
<script type="text/javascript" src="__PUBLIC__/static/js/admin/provider.js?{$Think.config.html_v}"></script>
|
||||
{/block}
|
||||
{block name="content"}
|
||||
<div class="alert alert-warning alert-dismissible" style="padding-top:7px;padding-bottom:7px;line-height:20px;margin-bottom:10px;">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true" style="top:0px;">×</button>
|
||||
允许通过下列第三方平台下载规则、插件等,注意:任何第三方平台都可能存在安全隐患,请谨慎下载!
|
||||
</div>
|
||||
<div class="box box-default">
|
||||
<div class="box-body">
|
||||
<form id="form_list" method="post" ajax-submit="true" action="{:url('Provider/saveall')}">
|
||||
<table id="list_table" class="table table-hover datatable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="80">排序</th>
|
||||
<th>网址</th>
|
||||
<th>标题</th>
|
||||
<th>访问</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach name="list" item="item"}
|
||||
<tr data-id="{$item['id']}" data-url="{$item['url']}">
|
||||
<td class="sort"><input type="text" name="newsort[{$item['id']}]" class="form-control" value="{$item['sort']}" autocomplete="off" /></td>
|
||||
<td><a href="javascript:;" class="store">{$item['url']}</a></td>
|
||||
<td>{$item['title']}</td>
|
||||
<td><a href="javascript:;" class="enable" style="color:{$item['enable']?'green':'red'}">{$item['enable']?'允许':'拒绝'}</a></td>
|
||||
<td>
|
||||
<a href="javascript:;" class="comment">评价</a>
|
||||
<span class="sep">|</span>
|
||||
<a href="javascript:;" class="edit">编辑</a>
|
||||
<span class="sep">|</span>
|
||||
<a href="javascript:;" class="delete">删除</a>
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="3">
|
||||
<button type="submit" class="btn btn-default" id="btn_save">保存</button>
|
||||
<a href="javascript:;" class="btn btn-primary" id="btn_add">添加</a>
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</form>
|
||||
{$pagenav}
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<form id="form_search" method="post" action="{:url('Provider/list')}" class="form-inline">
|
||||
<div class="form-group form-group-sm">
|
||||
<label>网址</label>
|
||||
<input type="text" name="url" class="form-control" placeholder="模糊搜索" />
|
||||
</div>
|
||||
<div class="form-group form-group-sm">
|
||||
<label>标题</label>
|
||||
<input type="text" name="title" class="form-control" placeholder="模糊搜索" />
|
||||
</div>
|
||||
<button type="submit" class="btn btn-default btn-sm">搜索</button>
|
||||
</form>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
providerClass.list_init();
|
||||
</script>
|
||||
{/block}
|
|
@ -0,0 +1,37 @@
|
|||
<form id="win_form_provider" method="post" ajax-submit="true" role="form" action="{:url('Provider/save')}">
|
||||
{if !empty($proData)}
|
||||
<input type="hidden" name="id" value="{$proData['id']}" />
|
||||
{/if}
|
||||
<div class="form-group">
|
||||
<label>网址</label>
|
||||
<input type="text" class="form-control" name="url" value="">
|
||||
<p class="help-block">必须输入前缀http://或https://</p>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>标题</label>
|
||||
<input type="text" class="form-control" name="title" value="" placeholder="默认自动获取网页标题">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>访问</label>
|
||||
<div class="input-group">
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="enable" value="1"> 允许
|
||||
</label>
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="enable" value="0"> 拒绝
|
||||
</label>
|
||||
</div>
|
||||
<p class="help-block">允许从该网站中下载规则、插件等</p>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>排序</label>
|
||||
<input type="text" class="form-control" name="sort" value="0">
|
||||
<p class="help-block">数字越大越靠前</p>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">{$Think.lang.submit}</button>
|
||||
</form>
|
||||
{if !empty($proData)}
|
||||
<script type="text/javascript">
|
||||
providerClass.load({$proData|json_encode});
|
||||
</script>
|
||||
{/if}
|
|
@ -21,5 +21,5 @@
|
|||
{$cmsError}
|
||||
{/if}
|
||||
{else /}
|
||||
没有“{$cmsName}”相关的发布插件,在<a href="http://www.skycaiji.com/store/cms?q={$cmsName|rawurlencode}" onclick="windowStore('CMS发布插件',$(this).attr('href'));return false;">云平台</a>中查找
|
||||
没有“{$cmsName}”相关的发布插件,在<a href="https://www.skycaiji.com/store/cms?q={$cmsName|rawurlencode}" onclick="windowStore('CMS发布插件',$(this).attr('href'));return false;">云平台</a>中查找
|
||||
{/if}
|
|
@ -124,7 +124,7 @@
|
|||
{if condition="$releData['config']['db']['type'] eq 'oracle'"}
|
||||
<p class="help-block">Oracel表的自增主键需绑定序列号才能获取自增值,自增字段选择“自定义内容”输入“sequence@序列号”,例如“sequence@seq_123”</p>
|
||||
{/if}
|
||||
<p class="help-block">如需获取表的自增主键值,选择“自定义内容”输入“auto_id@表名”,例如“auto_id@table123”,注意:表是按顺序插入数据,前面的表不能获取后面表的自增主键值</p>
|
||||
<p class="help-block">如需获取表的自增主键值,选择“自定义内容”输入“auto_id@表名”,例如“auto_id@table1”,如果要拼接内容则在表名结尾加#,例如“123auto_id@table1#456”<br>注意:表是按顺序插入数据,前面的表不能获取后面表的自增主键值</p>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
|
|
|
@ -21,6 +21,15 @@
|
|||
</div>
|
||||
<p class="help-block">此设置为总控制开关,如设置“否”则任务中的自动采集设置不生效</p>
|
||||
</div>
|
||||
<div class="form-group" id="set_caiji_server">
|
||||
<label>采集运行模式</label>
|
||||
<div class="input-group">
|
||||
<label class="radio-inline"><input type="radio" name="server" value="">web服务器(默认)</label>
|
||||
<label class="radio-inline"><input type="radio" name="server" value="cli">cli命令行(推荐)</label>
|
||||
</div>
|
||||
<p class="help-block server-">使用web服务器运行采集,会受web服务器运行超时影响导致采集中断,需修改web服务器的超时时间</p>
|
||||
<p class="help-block server-cli" style="display:none;">使用php cli命令行模式运行采集,自动采集、后台采集可以稳定运行,需要web服务器拥有执行命令的权限</p>
|
||||
</div>
|
||||
<div class="form-group" id="set_caiji_run" style="display:none;">
|
||||
<label>{$Think.lang.set_caiji_run}</label>
|
||||
<select name="run" class="form-control">
|
||||
|
@ -30,19 +39,10 @@
|
|||
<p class="help-block run-backstage">将在PHP后台开启一个持续进程用来运行采集,会占用一些服务器资源</p>
|
||||
<p class="help-block run-visit" style="display:none;">
|
||||
需在您的网站底部模板中加入一条html代码:<br/>
|
||||
<em><b><script src="{:url('Admin/Index/caiji',null,false,true)}"></script></b></em>
|
||||
<em><b><script src="{:url('Admin/Index/caiji',null,false,true)}" async></script></b></em>
|
||||
<br/>添加后,用户访问页面时即可触发采集,该方法不会额外消耗服务器资源
|
||||
</p>
|
||||
</div>
|
||||
<div class="form-group" id="set_caiji_server" style="display:none;">
|
||||
<label>采集模式</label>
|
||||
<div class="input-group">
|
||||
<label class="radio-inline"><input type="radio" name="server" value="">web服务器(默认)</label>
|
||||
<label class="radio-inline"><input type="radio" name="server" value="cli">cli命令行(推荐)</label>
|
||||
</div>
|
||||
<p class="help-block server-">使用web服务器运行采集,会受web服务器运行超时影响导致采集中断,需修改web服务器的超时时间</p>
|
||||
<p class="help-block server-cli" style="display:none;">使用php cli命令行模式运行采集</p>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>{$Think.lang.set_caiji_num}</label>
|
||||
<input type="number" name="num" class="form-control" value="{$caijiConfig['num']}">
|
||||
|
@ -160,7 +160,7 @@ $('#form_set [name="download_img"]').bind('click',function(){
|
|||
|
||||
$('#form_set [name="auto"][value="{$caijiConfig["auto"]|intval}"]').trigger("click");
|
||||
$('#form_set [name="run"]').val("{$caijiConfig['run']?$caijiConfig['run']:'backstage'}").trigger("change");
|
||||
//$('#form_set [name="server"][value="{$caijiConfig["server"]}"]').prop('checked',true).trigger("click");
|
||||
$('#form_set [name="server"][value="{$caijiConfig["server"]}"]').prop('checked',true).trigger("click");
|
||||
|
||||
$('#form_set [name="real_time"][value="{$caijiConfig["real_time"]|intval}"]').prop('checked',true);
|
||||
$('#form_set [name="download_img"][value="{$caijiConfig["download_img"]|intval}"]').trigger("click");
|
||||
|
|
|
@ -4,8 +4,7 @@
|
|||
<script src="__PUBLIC__/static/js/admin/store.js?{$Think.config.html_v}"></script>
|
||||
{/block}
|
||||
{block name="content"}
|
||||
<input type="hidden" id="clientinfo" value="{$clientinfo}" />
|
||||
<div class="iframe-loading"><div class="loading"> </div>页面加载中...</div>
|
||||
<iframe src="http://www.skycaiji.com/store" id="iframe_main" class="iframe-main" width="100%" height="100%" frameborder="0" scrolling="yes"></iframe>
|
||||
<iframe src="{$url}" data-provider-url="{$provData['url']}" data-is-store-url="1" id="iframe_main" class="iframe-main" width="100%" height="100%" frameborder="0" scrolling="yes"></iframe>
|
||||
<script type="text/javascript">storeClass.init_iframe();</script>
|
||||
{/block}
|
|
@ -35,7 +35,7 @@
|
|||
<span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu dropdown-menu-right dropdown-import-rule" aria-labelledby="btn_import_rule">
|
||||
<li><a href="javascript:;" onclick="windowModal('导入规则会覆盖该任务的采集器设置,且不可恢复','{:url("Mystore/collect?tpl=task")}');">已下载规则</a></li>
|
||||
<li><a href="javascript:;" onclick="windowModal('导入规则会覆盖该任务的采集器设置,且不可恢复','{:url("Mystore/rule?tpl=task&type=collect")}');">已下载规则</a></li>
|
||||
<li><a href="javascript:;" onclick="windowModal('导入规则会覆盖该任务的采集器设置,且不可恢复','{:url("Collector/list?module=pattern&tpl=task")}');">其它任务的规则</a></li>
|
||||
<li role="separator" class="divider"></li>
|
||||
<li style="padding-left:20px;padding-bottom:5px;"><input type="file" name="rule_file" /></li>
|
||||
|
|
|
@ -3,8 +3,6 @@
|
|||
{block name="content"}
|
||||
<div class="box">
|
||||
<div class="box-body">
|
||||
|
||||
|
||||
<form id="form_list" method="post" ajax-submit="true" action="{:url('Taskgroup/op')}">
|
||||
<input type="hidden" name="op" value="saveall" />
|
||||
<table id="list_table" class="table table-bordered table-hover datatable">
|
||||
|
|
|
@ -10,7 +10,8 @@
|
|||
<!-- Rename "main.default.js" to "main.js" and edit it if you need configure elFInder options or any things -->
|
||||
</head>
|
||||
<body>
|
||||
<script data-main="{$elfinderUrl}/main.default.js" src="//cdnjs.cloudflare.com/ajax/libs/require.js/2.3.5/require.min.js"></script>
|
||||
<script type="text/javascript">var elfinderPath="__PUBLIC__/elfinder/";</script>
|
||||
<script data-main="__PUBLIC__/elfinder/main.default.js" src="__PUBLIC__/elfinder/require.js"></script>
|
||||
<script>
|
||||
define('elFinderConfig', {
|
||||
// elFinder options (REQUIRED)
|
||||
|
|
|
@ -32,10 +32,7 @@ $(document).ready(function(){
|
|||
$('#btn_tree').bind('click',function(){
|
||||
var data=$('#txt_json').val();
|
||||
|
||||
if(htmlIsJson(data)){
|
||||
//是json字符串
|
||||
jsonTree.load(data);
|
||||
}else if((/^\w+\:\/\//).test(data)){
|
||||
if((/^\w+\:\/\//).test(data)){
|
||||
//是网址
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
|
@ -47,11 +44,26 @@ $(document).ready(function(){
|
|||
jsonTree.load(data);
|
||||
}
|
||||
});
|
||||
}else if(htmlIsJson(data)){
|
||||
//是json字符串
|
||||
jsonTree.load(data);
|
||||
}else{
|
||||
toastr.error('请输入网址或json字符串!');
|
||||
//匹配jsonp格式
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
dataType: 'json',
|
||||
url:ulink('Tool/json_tree'),
|
||||
data: {'html':data},
|
||||
success: function (data) {
|
||||
if(data.data&&data.data.json){
|
||||
jsonTree.load(data.data.json);
|
||||
}else{
|
||||
toastr.error('请输入网址或json字符串!');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
{/block}
|
|
@ -3,9 +3,9 @@
|
|||
|--------------------------------------------------------------------------
|
||||
| SkyCaiji (蓝天采集器)
|
||||
|--------------------------------------------------------------------------
|
||||
| Copyright (c) 2018 http://www.skycaiji.com All rights reserved.
|
||||
| Copyright (c) 2018 https://www.skycaiji.com All rights reserved.
|
||||
|--------------------------------------------------------------------------
|
||||
| 使用协议 http://www.skycaiji.com/licenses
|
||||
| 使用协议 https://www.skycaiji.com/licenses
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
|
|
@ -3,14 +3,14 @@
|
|||
|--------------------------------------------------------------------------
|
||||
| SkyCaiji (蓝天采集器)
|
||||
|--------------------------------------------------------------------------
|
||||
| Copyright (c) 2018 http://www.skycaiji.com All rights reserved.
|
||||
| Copyright (c) 2018 https://www.skycaiji.com All rights reserved.
|
||||
|--------------------------------------------------------------------------
|
||||
| 使用协议 http://www.skycaiji.com/licenses
|
||||
| 使用协议 https://www.skycaiji.com/licenses
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
||||
define('SKYCAIJI_VERSION', '2.1');
|
||||
define('SKYCAIJI_VERSION', '2.2');
|
||||
define('NOW_TIME', time());
|
||||
\think\Loader::addNamespace('plugin', realpath(ROOT_PATH.'plugin'));
|
||||
\think\Loader::addNamespace('util',realpath(APP_PATH.'extend/util'));
|
||||
|
@ -90,6 +90,7 @@ function breadcrumb($arr){
|
|||
/*多维数组array_map*/
|
||||
function array_array_map($callback, $arr1, array $_ = null){
|
||||
if(is_array($arr1)){
|
||||
$arr=array();
|
||||
foreach ($arr1 as $k=>$v){
|
||||
if(!is_array($v)){
|
||||
$arr[$k]=call_user_func($callback, $v);
|
||||
|
@ -161,10 +162,6 @@ function send_mail($emailConfig,$to, $name, $subject = '', $body = '', $attachme
|
|||
}
|
||||
return $mail->Send() ? true : $mail->ErrorInfo;
|
||||
}
|
||||
/*密码加密*/
|
||||
function pwd_encrypt($pwd){
|
||||
return md5(sha1($pwd));
|
||||
}
|
||||
|
||||
/*客户端信息*/
|
||||
function clientinfo(){
|
||||
|
@ -182,6 +179,7 @@ function get_html($url,$headers=null,$options=array(),$fromEncode='auto',$post_d
|
|||
$options['useragent']='Mozilla/5.0 (Windows NT 6.2; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70 Safari/537.36';
|
||||
}
|
||||
$options['timeout']=$options['timeout']>0?$options['timeout']:30;
|
||||
$options['verify']=false;
|
||||
|
||||
if(!preg_match('/^\w+\:\/\//', $url)){
|
||||
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
|--------------------------------------------------------------------------
|
||||
| SkyCaiji (蓝天采集器)
|
||||
|--------------------------------------------------------------------------
|
||||
| Copyright (c) 2018 http://www.skycaiji.com All rights reserved.
|
||||
| Copyright (c) 2018 https://www.skycaiji.com All rights reserved.
|
||||
|--------------------------------------------------------------------------
|
||||
| 使用协议 http://www.skycaiji.com/licenses
|
||||
| 使用协议 https://www.skycaiji.com/licenses
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
|--------------------------------------------------------------------------
|
||||
| SkyCaiji (蓝天采集器)
|
||||
|--------------------------------------------------------------------------
|
||||
| Copyright (c) 2018 http://www.skycaiji.com All rights reserved.
|
||||
| Copyright (c) 2018 https://www.skycaiji.com All rights reserved.
|
||||
|--------------------------------------------------------------------------
|
||||
| 使用协议 http://www.skycaiji.com/licenses
|
||||
| 使用协议 https://www.skycaiji.com/licenses
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
@ -35,7 +35,7 @@ class BaseController extends Controller {
|
|||
public function dispatchJump($success=true,$message='',$url='',$ajax=false,$else=null) {
|
||||
$success=$success?1:0;
|
||||
|
||||
if(input('serverinfo')&&(true === $ajax || request()->isAjax() || input('ajax')==1)){
|
||||
if(input('_serverinfo')&&(true === $ajax || request()->isAjax() || input('_ajax')==1)){
|
||||
|
||||
$data=is_array($else)?$else:array();
|
||||
$data['info']=$message;
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
<p class="msg_title">{:strip_tags($msg)}</p>
|
||||
<p class="msg_message"><span id="tmv" style="color:red;font-weight:bold;"></span>秒后跳转<a href="{$url}">页面</a></p>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var waitTm={$wait?$wait:'3'};
|
||||
function goHome(){
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<!-- 上述3个meta标签*必须*放在最前面,任何其他内容都*必须*跟随其后! -->
|
||||
<title>蓝天采集器 SkyCaiji</title>
|
||||
<meta name="generator" content="skycaiji" />
|
||||
<!-- Bootstrap core CSS -->
|
||||
<link rel="stylesheet" href="__PUBLIC__/bootstrap/css/bootstrap.min.css?{$Think.config.html_v}">
|
||||
|
||||
|
|
|
@ -245,10 +245,11 @@ return [
|
|||
/**********************************自定义配置*********************************************/
|
||||
'cli_cache_config'=>array('view_replace_str','root_path','app_path','plugin_path','root_url','root_website'),//cli模式下需要缓存的配置,否则会失效引起程序bug
|
||||
|
||||
'html_v'=>'20190301',//css和js版本
|
||||
'html_v'=>'20190601',//css和js版本
|
||||
|
||||
'root_path'=>realpath(ROOT_PATH),//根目录
|
||||
'app_path'=>realpath(APP_PATH),//APP目录
|
||||
'app_path'=>realpath(APP_PATH),//skycaijiApp目录
|
||||
'apps_path'=>realpath(ROOT_PATH.'app'),//应用程序目录
|
||||
'plugin_path'=>realpath(ROOT_PATH.'plugin'),//插件目录
|
||||
'root_url'=>rtrim(preg_replace('/\/index\.php.*/i','',Request::instance()->root()),'\/\\'),//网址根目录
|
||||
'root_website'=>(Request::instance()->isSsl()?'https':'http').'://'.trim(Request::instance()->host(),'\/\\').rtrim(preg_replace('/\/index\.php.*/i','',Request::instance()->root()),'\/\\'),//带域名网站根目录,去掉index.php,结尾不带/
|
||||
|
@ -258,13 +259,17 @@ return [
|
|||
'yzm_expire'=>1200, //邮箱验证码过期时间(秒)
|
||||
|
||||
'allow_process_func'=>array(
|
||||
'strtotime'=>'日期转时间戳:strtotime',
|
||||
'strtolower'=>'全部小写:strtolower',
|
||||
'strtoupper'=>'全部大写:strtoupper',
|
||||
'ucfirst'=>'首字母大写:ucfirst',
|
||||
'ucwords'=>'每个单词首字母大写:ucwords',
|
||||
'base64_encode'=>'编码:base64_encode',
|
||||
'md5'=>'加密:md5',
|
||||
'strtotime'=>'日期转时间戳',
|
||||
'strtolower'=>'全部小写',
|
||||
'strtoupper'=>'全部大写',
|
||||
'ucfirst'=>'首字母大写',
|
||||
'ucwords'=>'每个单词首字母大写',
|
||||
'base64_encode'=>'编码',
|
||||
'md5'=>'加密',
|
||||
),//数据处理允许的函数
|
||||
|
||||
'allow_process_if'=>array(
|
||||
'is_numeric'=>'是数字',
|
||||
),//数据处理>条件判断允许的函数
|
||||
/*******************************************************************************/
|
||||
];
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
|--------------------------------------------------------------------------
|
||||
| SkyCaiji (蓝天采集器)
|
||||
|--------------------------------------------------------------------------
|
||||
| Copyright (c) 2018 http://www.skycaiji.com All rights reserved.
|
||||
| Copyright (c) 2018 https://www.skycaiji.com All rights reserved.
|
||||
|--------------------------------------------------------------------------
|
||||
| 使用协议 http://www.skycaiji.com/licenses
|
||||
| 使用协议 https://www.skycaiji.com/licenses
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
|--------------------------------------------------------------------------
|
||||
| SkyCaiji (蓝天采集器)
|
||||
|--------------------------------------------------------------------------
|
||||
| Copyright (c) 2018 http://www.skycaiji.com All rights reserved.
|
||||
| Copyright (c) 2018 https://www.skycaiji.com All rights reserved.
|
||||
|--------------------------------------------------------------------------
|
||||
| 使用协议 http://www.skycaiji.com/licenses
|
||||
| 使用协议 https://www.skycaiji.com/licenses
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
|--------------------------------------------------------------------------
|
||||
| SkyCaiji (蓝天采集器)
|
||||
|--------------------------------------------------------------------------
|
||||
| Copyright (c) 2018 http://www.skycaiji.com All rights reserved.
|
||||
| Copyright (c) 2018 https://www.skycaiji.com All rights reserved.
|
||||
|--------------------------------------------------------------------------
|
||||
| 使用协议 http://www.skycaiji.com/licenses
|
||||
| 使用协议 https://www.skycaiji.com/licenses
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
|--------------------------------------------------------------------------
|
||||
| SkyCaiji (蓝天采集器)
|
||||
|--------------------------------------------------------------------------
|
||||
| Copyright (c) 2018 http://www.skycaiji.com All rights reserved.
|
||||
| Copyright (c) 2018 https://www.skycaiji.com All rights reserved.
|
||||
|--------------------------------------------------------------------------
|
||||
| 使用协议 http://www.skycaiji.com/licenses
|
||||
| 使用协议 https://www.skycaiji.com/licenses
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
|--------------------------------------------------------------------------
|
||||
| SkyCaiji (蓝天采集器)
|
||||
|--------------------------------------------------------------------------
|
||||
| Copyright (c) 2018 http://www.skycaiji.com All rights reserved.
|
||||
| Copyright (c) 2018 https://www.skycaiji.com All rights reserved.
|
||||
|--------------------------------------------------------------------------
|
||||
| 使用协议 http://www.skycaiji.com/licenses
|
||||
| 使用协议 https://www.skycaiji.com/licenses
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
<h2 style="font-size:26px;">欢迎使用SkyCaiji(蓝天数据采集发布系统)</h2>
|
||||
<p>SkyCaiji致力于网站数据自动化采集发布,使数据采集便捷化、智能化、云端化。</p>
|
||||
<p>程序可部署在云端服务器,您只需浏览器访问即可操作编写规则采集目标数据,自定义采集规则支持任意信息流精准匹配,发布模块可无缝对接各类cms建站程序及自行开发的程序,采集到的数据可实时同步到您的网站,程序内置云端规则中心,方便您分享及下载采集规则,程序完美适应电脑端和移动端,功能一致,使您随时随地办公。
|
||||
官方网站:<a href="http://www.skycaiji.com" title="蓝天采集器">www.skycaiji.com</a></p>
|
||||
官方网站:<a href="https://www.skycaiji.com" title="蓝天采集器">www.skycaiji.com</a></p>
|
||||
|
||||
<p>本页面可在<a href="{:url('Admin/Setting/site')}">站点设置</a>中关闭</p>
|
||||
</div>
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue