").appendTo(i),n=i.uniqueId().attr("id");return this._addClass(s,"ui-tooltip-content"),this._addClass(i,"ui-tooltip","ui-widget ui-widget-content"),i.appendTo(this._appendTo(e)),this.tooltips[n]={element:e,tooltip:i}},_find:function(t){var e=t.data("ui-tooltip-id");return e?this.tooltips[e]:null},_removeTooltip:function(t){t.remove(),delete this.tooltips[t.attr("id")]},_appendTo:function(t){var e=t.closest(".ui-front, dialog");return e.length||(e=this.document[0].body),e},_destroy:function(){var e=this;t.each(this.tooltips,function(i,s){var n=t.Event("blur"),o=s.element;n.target=n.currentTarget=o[0],e.close(n,!0),t("#"+i).remove(),o.data("ui-tooltip-title")&&(o.attr("title")||o.attr("title",o.data("ui-tooltip-title")),o.removeData("ui-tooltip-title"))}),this.liveRegion.remove()}}),t.uiBackCompat!==!1&&t.widget("ui.tooltip",t.ui.tooltip,{options:{tooltipClass:null},_tooltip:function(){var t=this._superApply(arguments);return this.options.tooltipClass&&t.tooltip.addClass(this.options.tooltipClass),t}}),t.ui.tooltip});
\ No newline at end of file
diff --git a/public/static/js/langs/zh-cn.js b/public/static/js/langs/zh-cn.js
index f8cb640..a1cc8eb 100644
--- a/public/static/js/langs/zh-cn.js
+++ b/public/static/js/langs/zh-cn.js
@@ -1 +1 @@
-var tpl_lang={"appname":"\u84dd\u5929\u91c7\u96c6\u5668","user_error_username":"\u7528\u6237\u540d\u5fc5\u987b\u75313-15\u4e2a\u5b57\u7b26\u7ec4\u6210\uff01","user_error_password":"\u5bc6\u7801\u5fc5\u987b\u75316-30\u4f4d\u5b57\u6bcd\u3001\u6570\u5b57\u6216\u7279\u6b8a\u5b57\u7b26\u7ec4\u6210\uff01","user_error_repassword":"\u786e\u8ba4\u5bc6\u7801\u548c\u5bc6\u7801\u4e0d\u4e00\u81f4\uff01","user_error_email":"\u90ae\u7bb1\u683c\u5f0f\u9519\u8bef\uff01","admincp":"\u540e\u53f0","sign_wildcard":"(*)","sign_match":"[\u5185\u5bb9{:id}]","tips_sign_wildcard":"\u901a\u914d\u7b26\u53ef\u5339\u914d\u4efb\u610f\u5b57\u7b26","tips_sign_match":"\u5339\u914d\u4efb\u610f\u5b57\u7b26\u5e76\u4fdd\u5b58\u4e3a\u6807\u7b7e\u4ee5\u4f9b\u8c03\u7528\uff0c\u7b49\u540c\u4e8e\u6355\u83b7\u7ec4\uff1a(?<nr\u6807\u8bc6>.*?)","tips_sign_match_global":"\u5339\u914d\u4efb\u610f\u5b57\u7b26\u5e76\u4fdd\u5b58\u4e3a\u6807\u7b7e\u4ee5\u4f9b\u5168\u5c40\u8c03\u7528\uff0c\u7b49\u540c\u4e8e\u6355\u83b7\u7ec4\uff1a(?<nr\u6807\u8bc6>.*?)","tips_sign_group":"\u6355\u83b7\u7ec4\uff1a(?<nr\u6807\u8bc6>[\\s\\S]*?)\uff0c\u5339\u914d\u6b63\u5219\u5e76\u4fdd\u5b58\u4e3a[\u5185\u5bb9]\u6807\u7b7e\u4ee5\u4f9b\u8c03\u7528","tips_sign_group_global":"\u6355\u83b7\u7ec4\uff1a(?<nr\u6807\u8bc6>[\\s\\S]*?)\uff0c\u5339\u914d\u6b63\u5219\u5e76\u4fdd\u5b58\u4e3a[\u5185\u5bb9]\u6807\u7b7e\u4ee5\u4f9b\u5168\u5c40\u8c03\u7528","tips_regular":"\u53ef\u4f7f\u7528\u6b63\u5219\u8868\u8fbe\u5f0f","setting":"\u8bbe\u7f6e","setting_site":"\u7ad9\u70b9\u8bbe\u7f6e","set_site_verifycode":"\u5f00\u542f\u56fe\u7247\u9a8c\u8bc1\u7801","setting_caiji":"\u91c7\u96c6\u8bbe\u7f6e","set_caiji_auto":"\u5f00\u542f\u81ea\u52a8\u91c7\u96c6","set_caiji_run":"\u81ea\u52a8\u91c7\u96c6\u8fd0\u884c\u65b9\u5f0f","set_caiji_interval":"\u91c7\u96c6\u8fd0\u884c\u95f4\u9694","set_caiji_num":"\u6700\u5927\u91c7\u96c6\u6570\u91cf","set_caiji_timeout":"\u6700\u5927\u6267\u884c\u65f6\u95f4","setting_email":"\u90ae\u4ef6\u53d1\u9001\u8bbe\u7f6e","set_email_sender":"\u53d1\u4ef6\u4eba\u540d\u79f0","set_email_email":"\u53d1\u4ef6\u4eba\u90ae\u7bb1\u8d26\u53f7","set_email_pwd":"\u53d1\u4ef6\u4eba\u90ae\u7bb1\u5bc6\u7801","set_email_smtp":"SMTP\u670d\u52a1\u5668","set_email_port":"SMTP\u7aef\u53e3","set_email_port_tips":"TLS\u4e00\u822c\u4e3a25\uff0cSSL\u4e00\u822c\u4e3a465\uff0c\u54a8\u8be2\u90ae\u7bb1\u670d\u52a1\u5546\u83b7\u53d6","set_email_type":"SMTP\u7aef\u53e3\u7c7b\u578b","set_email_test_subject":"\u6d4b\u8bd5\u53d1\u9001\u90ae\u4ef6","set_email_test_body":"\u606d\u559c\uff0c\u53d1\u9001\u90ae\u4ef6\u6210\u529f\uff01","setting_store":"\u4e91\u7aef\u8bbe\u7f6e","store_authkey_error":"\u901a\u4fe1\u5bc6\u94a5\u53ea\u80fd\u7531\u5b57\u6bcd\u548c\u6570\u5b57\u7ec4\u6210\u4e14\u957f\u5ea6\u57286-100\u4f4d\u4e4b\u95f4","down_img_m_":"\u672c\u5730\u5b58\u50a8","down_img_m_loc":"\u672c\u5730\u5b58\u50a8","down_img_m_func":"\u4f7f\u7528\u51fd\u6570","down_img_name_":"\u6309\u65f6\u95f4\u751f\u6210\uff08\u65b9\u4fbf\u65e5\u671f\u5f52\u7c7b\uff09","down_img_name_time":"\u6309\u65f6\u95f4\u751f\u6210\uff08\u65b9\u4fbf\u65e5\u671f\u5f52\u7c7b\uff09","down_img_name_url":"\u6309\u7f51\u5740\u751f\u6210\uff08\u9632\u6b62\u91cd\u590d\u4e0b\u8f7d\uff09","down_img_name_custom":"\u81ea\u5b9a\u4e49","down_img_name_custom_name_":"\u56fe\u7247\u7f51\u5740MD5\u7801","config_error_none_email":"\u6ca1\u6709\u90ae\u7bb1\u670d\u52a1\u5668\u914d\u7f6e\uff0c\u8bf7\u5728\u540e\u53f0\u8bbe\u7f6e\uff01","user":"\u7528\u6237","user_list":"\u7528\u6237\u5217\u8868","user_add":"\u6dfb\u52a0\u7528\u6237","user_edit":"\u7f16\u8f91\u7528\u6237","user_username":"\u7528\u6237\u540d","user_password":"\u5bc6\u7801","user_repassword":"\u786e\u8ba4\u5bc6\u7801","user_newpwd_tips":"\u5982\u9700\u4fee\u6539\u5bc6\u7801\uff0c\u8bf7\u5728\u6b64\u8f93\u5165\u65b0\u5bc6\u7801\uff0c\u5426\u5219\u7559\u7a7a","user_email":"\u90ae\u7bb1","user_email_tips":"\u7528\u4e8e\u627e\u56de\u8d26\u53f7\u5bc6\u7801","user_groupid":"\u7528\u6237\u7ec4","user_error_has_username":"\u7528\u6237\u540d\u5df2\u7ecf\u5b58\u5728\uff01","user_error_edit_not_allow":"\u53ea\u6709\u521b\u59cb\u4eba\u624d\u80fd\u7f16\u8f91\u4ed6\u4eba\u7684\u8d26\u53f7\uff01","user_error_delete_not_allow":"\u53ea\u6709\u521b\u59cb\u4eba\u624d\u80fd\u5220\u9664\u8d26\u53f7\uff01","user_error_groupid":"\u4e0d\u662f\u5141\u8bb8\u7684\u7528\u6237\u7ec4\uff01","user_error_del_founder":"\u4e0d\u80fd\u5220\u9664\u521b\u59cb\u4eba\u8d26\u53f7\uff01","user_error_null_uid":"UID\u4e0d\u80fd\u4e3a\u7a7a","user_error_empty_user":"\u7528\u6237\u4e0d\u5b58\u5728","user_error_login":"\u7528\u6237\u540d\u6216\u5bc6\u7801\u4e0d\u6b63\u786e\uff01","user_error_sublogin":"\u767b\u5f55\u63d0\u4ea4\u5931\u8d25","user_error_is_not_admin":"\u62b1\u6b49\uff0c\u8bf7\u767b\u5f55\u7ba1\u7406\u5458\u8d26\u53f7\uff01","user_login_in":"\u767b\u5f55\u4e2d...","user_auto_login":"\u6b63\u5728\u81ea\u52a8\u767b\u5f55...","usertoken_error":"\u7528\u6237token\u9519\u8bef\uff0c\u8bf7\u5237\u65b0\u9875\u9762\u6216\u91cd\u65b0\u767b\u5f55\uff01","task":"\u4efb\u52a1","task_add":"\u6dfb\u52a0\u4efb\u52a1","task_edit":"\u7f16\u8f91\u4efb\u52a1","task_list":"\u4efb\u52a1\u5217\u8868","task_change_list":"\u5217\u8868\u6a21\u5f0f","task_change_folder":"\u5206\u7ec4\u6a21\u5f0f","task_name":"\u4efb\u52a1\u540d\u79f0","task_tg":"\u4efb\u52a1\u5206\u7ec4","task_sort":"\u6392\u5e8f","task_sort_help":"\u6570\u5b57\u8d8a\u5927\u8d8a\u9760\u524d","task_module":"\u91c7\u96c6\u6a21\u5757","task_module_":"\u65e0","task_module_pattern":"\u89c4\u5219\u91c7\u96c6","task_module_keyword":"\u5173\u952e\u8bcd\u91c7\u96c6","task_module_weixin":"\u5fae\u4fe1\u91c7\u96c6","task_auto":"\u81ea\u52a8\u91c7\u96c6","task_auto_":"\u5426","task_auto_0":"\u5426","task_auto_1":"\u5faa\u73af","task_auto_2":"\u5b9a\u65f6","task_addtime":"\u6dfb\u52a0\u65f6\u95f4","task_caijitime":"\u91c7\u96c6\u65f6\u95f4","task_collected":"\u91c7\u96c6\u91cf","task_edit_collector":"\u4e0b\u4e00\u6b65\uff1a\u7f16\u8f91\u91c7\u96c6\u5668","task_root":"\u6839\u76ee\u5f55","task_loading":"\u6b63\u5728\u8f7d\u5165\u6570\u636e","task_none_data":"\u65e0\u6570\u636e","task_set_task":"\u4efb\u52a1\u8bbe\u7f6e","task_set_collector":"\u91c7\u96c6\u5668\u8bbe\u7f6e","task_set_release":"\u53d1\u5e03\u8bbe\u7f6e","task_error_null_id":"\u8bf7\u8f93\u5165\u4efb\u52a1id","task_error_empty_task":"\u4e0d\u5b58\u5728\u4efb\u52a1","task_error_null_tgid":"\u8bf7\u8f93\u5165\u5206\u7ec4id","task_error_empty_tg":"\u4e0d\u5b58\u5728\u5206\u7ec4","task_error_null_name":"\u8bf7\u8f93\u5165\u540d\u79f0\uff01","task_error_has_name":"\u540d\u79f0\u5df2\u7ecf\u5b58\u5728\uff01","task_error_null_module":"\u672a\u8bbe\u7f6e\u91c7\u96c6\u6a21\u5757","taskgroup_add":"\u6dfb\u52a0\u5206\u7ec4","taskgroup_edit":"\u7f16\u8f91\u5206\u7ec4","taskgroup":"\u4efb\u52a1\u5206\u7ec4","taskgroup_list":"\u5206\u7ec4\u5217\u8868","taskgroup_name":"\u5206\u7ec4\u540d\u79f0","taskgroup_sort":"\u6392\u5e8f","taskgroup_sort_help":"\u6570\u5b57\u8d8a\u5927\u8d8a\u9760\u524d","taskgroup_parent_id":"\u7236\u5206\u7ec4","tg_add_sub":"\u6dfb\u52a0\u5b50\u5206\u7ec4","tg_move":"\u79fb\u52a8\u5206\u7ec4","tg_exist_sub":"\u5b58\u5728\u5b50\u5206\u7ec4\uff01","tg_none":"\u5206\u7ec4\u4e0d\u5b58\u5728\uff01","tg_is_parent":"\u5b58\u5728\u5b50\u5206\u7ec4\uff0c\u8bf7\u5148\u6e05\u7a7a\u5b50\u5206\u7ec4\uff0c\u624d\u80fd\u79fb\u52a8\u5206\u7ec4\uff01","tg_deleteall_has_sub":"\u6709\u5b50\u5206\u7ec4\u7684\u4e0d\u80fd\u5220\u9664\uff0c\u9700\u5148\u6e05\u7a7a\u5b50\u5206\u7ec4\uff01","tg_no_checked":"\u6ca1\u6709\u9009\u4e2d\u7684\u8bb0\u5f55\uff01","tg_error_null_name":"\u8bf7\u8f93\u5165\u540d\u79f0\uff01","tg_error_has_name":"\u540d\u79f0\u5df2\u7ecf\u5b58\u5728\uff01","coll_set":"\u91c7\u96c6\u5668\u8bbe\u7f6e","coll_edit_task":"\u4e0a\u4e00\u6b65\uff1a\u7f16\u8f91\u4efb\u52a1","coll_name":"\u91c7\u96c6\u89c4\u5219\u540d\u79f0","coll_error_invalid_module":"\u65e0\u6548\u7684\u91c7\u96c6\u6a21\u5757","coll_error_empty_coll":"\u91c7\u96c6\u5668\u8bbe\u7f6e\u4e0d\u5b58\u5728","coll_error_empty_effective":"\u9875\u9762\u811a\u672c\u4e0d\u53ef\u7528\uff0c\u4fdd\u5b58\u5931\u8d25\uff01","field_module_rule":"\u89c4\u5219\u5339\u914d","field_module_auto":"\u81ea\u52a8\u83b7\u53d6","field_module_xpath":"XPath\u5339\u914d","field_module_words":"\u56fa\u5b9a\u6587\u5b57","field_module_num":"\u968f\u673a\u6570\u5b57","field_module_time":"\u65f6\u95f4","field_module_list":"\u5217\u8868\u62bd\u53d6","field_module_json":"JSON\u63d0\u53d6","field_module_merge":"\u5b57\u6bb5\u7ec4\u5408","field_module_extract":"\u5b57\u6bb5\u63d0\u53d6","field_module_sign":"\u5185\u5bb9\u6807\u7b7e","process_module_html":"html\u6807\u7b7e\u8fc7\u6ee4","process_module_insert":"\u63d2\u5165\u5185\u5bb9","process_module_replace":"\u5185\u5bb9\u66ff\u6362","process_module_filter":"\u5173\u952e\u8bcd\u8fc7\u6ee4","process_module_if":"\u6761\u4ef6\u5224\u65ad","process_module_translate":"\u7ffb\u8bd1","process_module_tool":"\u5de5\u5177\u7bb1","process_module_batch":"\u6279\u91cf\u66ff\u6362","process_module_substr":"\u622a\u53d6\u5b57\u7b26\u4e32","process_module_func":"\u4f7f\u7528\u51fd\u6570","process_module_api":"\u8c03\u7528\u63a5\u53e3","p_m_if_1":"\u6ee1\u8db3\u6761\u4ef6\u91c7\u96c6","p_m_if_2":"\u6ee1\u8db3\u6761\u4ef6\u4e0d\u91c7\u96c6","p_m_if_3":"\u4e0d\u6ee1\u8db3\u6761\u4ef6\u91c7\u96c6","p_m_if_4":"\u4e0d\u6ee1\u8db3\u6761\u4ef6\u4e0d\u91c7\u96c6","p_m_if_c_has":"\u5305\u542b","p_m_if_c_nhas":"\u4e0d\u5305\u542b","p_m_if_c_eq":"\u7b49\u4e8e","p_m_if_c_neq":"\u4e0d\u7b49\u4e8e","p_m_if_c_heq":"\u6052\u7b49\u4e8e","p_m_if_c_nheq":"\u4e0d\u6052\u7b49\u4e8e","p_m_if_c_gt":"\u5927\u4e8e","p_m_if_c_egt":"\u5927\u4e8e\u7b49\u4e8e","p_m_if_c_lt":"\u5c0f\u4e8e","p_m_if_c_elt":"\u5c0f\u4e8e\u7b49\u4e8e","p_m_if_c_time_eq":"\u65f6\u95f4\u7b49\u4e8e","p_m_if_c_time_egt":"\u65f6\u95f4\u5927\u4e8e\u7b49\u4e8e","p_m_if_c_time_elt":"\u65f6\u95f4\u5c0f\u4e8e\u7b49\u4e8e","p_m_if_c_regexp":"\u6b63\u5219\u8868\u8fbe\u5f0f","p_m_if_c_func":"\u4f7f\u7528\u51fd\u6570","page_front_url":"\u524d\u7f6e\u9875","page_source_url":"\u8d77\u59cb\u9875","page_level_url":"\u591a\u7ea7\u9875","page_url":"\u5185\u5bb9\u9875","page_relation_url":"\u5173\u8054\u9875","rele_set":"\u53d1\u5e03\u8bbe\u7f6e","rele_error_detect_null":"\u6ca1\u6709\u68c0\u6d4b\u5230\u672c\u5730CMS\u7a0b\u5e8f\uff0c\u60a8\u53ef\u4ee5\u624b\u52a8\u7ed1\u5b9a\u6570\u636e","rele_error_empty_rele":"\u53d1\u5e03\u8bbe\u7f6e\u4e0d\u5b58\u5728","rele_error_null_module":"\u8bf7\u9009\u62e9\u53d1\u5e03\u65b9\u5f0f","rele_error_db":"\u6570\u636e\u5e93\u9519\u8bef\uff1a","rele_error_no_table":"\u8be5\u6570\u636e\u5e93\u6ca1\u6709\u8868","rele_success_db_ok":"\u6570\u636e\u5e93\u8fde\u63a5\u6210\u529f","rele_module":"\u53d1\u5e03\u65b9\u5f0f","rele_module_cms":"\u672c\u5730CMS\u7a0b\u5e8f","rele_module_db":"\u6570\u636e\u5e93","rele_module_api":"\u751f\u6210API","rele_module_toapi":"\u8c03\u7528\u63a5\u53e3","rele_module_file":"\u6587\u4ef6\u5b58\u50a8","rele_module_diy":"\u81ea\u5b9a\u4e49\u63d2\u4ef6","rele_btn_detect":"\u5f00\u59cb\u68c0\u6d4b","rele_cms_path":"CMS\u8def\u5f84","rele_db_type":"\u6570\u636e\u5e93\u7c7b\u578b","rele_db_host":"\u6570\u636e\u5e93\u4e3b\u673a","rele_db_name":"\u6570\u636e\u5e93\u540d\u79f0","rele_db_charset":"\u6570\u636e\u5e93\u7f16\u7801","rele_db_port":"\u6570\u636e\u5e93\u7aef\u53e3","rele_db_user":"\u6570\u636e\u5e93\u7528\u6237","rele_db_pwd":"\u6570\u636e\u5e93\u5bc6\u7801","error_unknown_database":"\u672a\u77e5\u7684\u6570\u636e\u5e93","error_null_input":"\u8bf7\u8f93\u5165{:str}","error_open_basedir":"\u60a8\u7684\u7f51\u7ad9\u5f00\u542f\u4e86\u76ee\u5f55\u8bbf\u95ee\u9650\u5236(open_basedir)\uff0c\u8bf7\u68c0\u67e5\u662f\u5426\u56e0\u8be5\u95ee\u9898\u5bfc\u81f4\u76ee\u5f55\u65e0\u6cd5\u8bfb\u5199\uff01","collected":"\u5df2\u91c7\u96c6\u6570\u636e","collected_list":"\u5df2\u91c7\u96c6\u6570\u636e\u5217\u8868","COLLECTED_RELE_":"\u65e0","collected_rele_cms":"CMS","collected_rele_db":"\u6570\u636e\u5e93","collected_rele_file":"\u6587\u4ef6","collected_rele_toapi":"\u63a5\u53e3","collected_rele_api":"API","collected_rele_diy":"\u63d2\u4ef6","verifycode":"\u9a8c\u8bc1\u7801","verifycode_error":"\u9a8c\u8bc1\u7801\u9519\u8bef\uff01","find_password":"\u627e\u56de\u5bc6\u7801","find_pwd_username":"\u8bf7\u8f93\u5165\u90ae\u7bb1\/\u7528\u6237\u540d","find_pwd_yzm":"\u8bf7\u8f93\u5165\u6fc0\u6d3b\u7801","find_pwd_resend":"\u91cd\u65b0\u53d1\u9001","find_pwd_next_step":"\u4e0b\u4e00\u6b65","find_pwd_pwd":"\u8bf7\u8f93\u5165\u65b0\u5bc6\u7801","find_pwd_repwd":"\u786e\u8ba4\u65b0\u5bc6\u7801","find_pwd_sended":"\u5df2\u5411\u90ae\u7bb1{:email}\u53d1\u9001\u4e86\u6fc0\u6d3b\u7801\uff01","find_pwd_email_failed":"\u53d1\u9001\u90ae\u4ef6\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u540e\u53f0\u53d1\u9001\u90ae\u4ef6\u914d\u7f6e\uff01","find_pwd_email_wait":"\u9700\u7b49\u5f85{:seconds}\u79d2\u624d\u80fd\u518d\u6b21\u53d1\u9001","find_pwd_email_subject":"\u627e\u56de\u5bc6\u7801 - \u84dd\u5929\u91c7\u96c6\u5668","find_pwd_email_body":"\u60a8\u7684\u6fc0\u6d3b\u7801\u4e3a\uff1a{:yzm}\uff0c\u6709\u6548\u65f6\u95f4{:minutes}\u5206\u949f","find_pwd_error_username":"\u8bf7\u8f93\u5165\u90ae\u7bb1\/\u7528\u6237\u540d","find_pwd_error_step":"\u6b65\u9aa4\u9519\u8bef\uff0c\u8bf7\u91cd\u65b0\u64cd\u4f5c\uff01","find_pwd_error_post":"\u8868\u5355\u63d0\u4ea4\u5931\u8d25","find_pwd_error_none_email":"\u90ae\u7bb1\u4e0d\u5b58\u5728\uff01","find_pwd_error_multiple_emails":"\u5b58\u5728\u591a\u4e2a\u7528\u6237\u4f7f\u7528\u6b64\u90ae\u7bb1\uff0c\u8bf7\u8f93\u5165\u7528\u6237\u540d\uff01","find_pwd_error_none_user":"\u7528\u6237\u4e0d\u5b58\u5728\uff01","find_pwd_success":"\u5bc6\u7801\u4fee\u6539\u6210\u529f","yzm_error_please_send":"\u8bf7\u53d1\u9001\u6fc0\u6d3b\u7801","yzm_error_please_input":"\u8bf7\u8f93\u5165\u6fc0\u6d3b\u7801","yzm_error_timeout":"\u6fc0\u6d3b\u7801\u5df2\u8fc7\u671f\uff01\u8bf7\u91cd\u65b0\u53d1\u9001","yzm_error_yzm":"\u6fc0\u6d3b\u7801\u9519\u8bef","admincp_style":"\u754c\u9762","admincp_sidebar_mini":"\u83dc\u5355\u6700\u5c0f\u5316","admincp_skins":"\u8bbe\u7f6e\u76ae\u80a4","skin_blue":"\u84dd","skin_black":"\u9ed1","skin_purple":"\u7d2b","skin_green":"\u7eff","skin_red":"\u7ea2","skin_yellow":"\u9ec4","skin_blue_light":"\u84dd\u4eae","skin_black_light":"\u9ed1\u4eae","skin_purple_light":"\u7d2b\u4eae","skin_green_light":"\u7eff\u4eae","skin_red_light":"\u7ea2\u4eae","skin_yellow_light":"\u9ec4\u4eae","store":"\u4e91\u5e73\u53f0","rule_collect":"\u91c7\u96c6\u89c4\u5219","empty_data":"\u6570\u636e\u4e0d\u5b58\u5728","invalid_op":"\u65e0\u6548\u7684\u64cd\u4f5c\uff01","submit":"\u63d0\u4ea4","search":"\u641c\u7d22","op_success":"\u64cd\u4f5c\u6210\u529f","op_failed":"\u64cd\u4f5c\u5931\u8d25","sort":"\u6392\u5e8f","select":"\u9009\u62e9","select_all":"\u5168\u9009","select_first":"\u8bf7\u9009\u62e9","save":"\u4fdd\u5b58","op":"\u64cd\u4f5c","delete":"\u5220\u9664","deleted":"\u5df2\u5220\u9664","edit":"\u7f16\u8f91","test":"\u6d4b\u8bd5","confirm_delete":"\u786e\u5b9a\u5220\u9664\uff1f","delete_success":"\u5220\u9664\u6210\u529f","none":"\u65e0","caiji":"\u91c7\u96c6","more":"\u66f4\u591a","yes":"\u662f","no":"\u5426","all":"\u5168\u90e8","login":"\u767b\u5f55","logout":"\u9000\u51fa","login_auto":"\u4e0b\u6b21\u81ea\u52a8\u767b\u5f55","separator":"\uff1a","redirecting":"\u8df3\u8f6c\u4e2d...","close":"\u5173\u95ed","tips_match":"\u793a\u4f8b\uff1a<div id="a">[\u5185\u5bb91]<\/div>(*)<div id="b">[\u5185\u5bb92]<\/div>","tips_matchn":"\u793a\u4f8b\uff1a[\u5185\u5bb91] [\u5185\u5bb92]","tips_match_only":"\u793a\u4f8b\uff1a<div id="content">[\u5185\u5bb9]<\/div>","tips_match_area":"\u793a\u4f8b\uff1a<div id="a">[\u5185\u5bb9123]<\/div>(*)<div id="b">[\u5185\u5bb9abc]<\/div>","tips_matchn_area":"\u793a\u4f8b\uff1a[\u5185\u5bb9123] [\u5185\u5bb9abc]","tips_match_url":"\u793a\u4f8b\uff1a<a href="http:\/\/demo.com\/[\u5185\u5bb9123]\/[\u5185\u5bb9abc]">(*)<\/a>","tips_matchn_url":"\u793a\u4f8b\uff1ahttp:\/\/www.demo.com\/[\u5185\u5bb9123]-[\u5185\u5bb9abc].html","release_upgrade":"\u63d2\u4ef6\u7248\u672c\u8fc7\u4f4e\uff0c\u8bf7\u5347\u7ea7\u63d2\u4ef6
\u5347\u7ea7\u6559\u7a0b<\/a>"};
\ No newline at end of file
+var tpl_lang={"appname":"\u84dd\u5929\u91c7\u96c6\u5668","user_error_username":"\u7528\u6237\u540d\u5fc5\u987b\u75313-15\u4e2a\u5b57\u7b26\u7ec4\u6210\uff01","user_error_password":"\u5bc6\u7801\u5fc5\u987b\u75316-30\u4f4d\u5b57\u6bcd\u3001\u6570\u5b57\u6216\u7279\u6b8a\u5b57\u7b26\u7ec4\u6210\uff01","user_error_repassword":"\u786e\u8ba4\u5bc6\u7801\u548c\u5bc6\u7801\u4e0d\u4e00\u81f4\uff01","user_error_email":"\u90ae\u7bb1\u683c\u5f0f\u9519\u8bef\uff01","admincp":"\u540e\u53f0","sign_wildcard":"(*)","sign_match":"[\u5185\u5bb9{:id}]","tips_sign_wildcard":"\u901a\u914d\u7b26\u53ef\u5339\u914d\u4efb\u610f\u5b57\u7b26","tips_sign_match":"\u5339\u914d\u4efb\u610f\u5b57\u7b26\u5e76\u4fdd\u5b58\u4e3a\u6807\u7b7e\u4ee5\u4f9b\u8c03\u7528\uff0c\u7b49\u540c\u4e8e\u6355\u83b7\u7ec4\uff1a(?<nr\u6807\u8bc6>.*?)","tips_sign_match_global":"\u5339\u914d\u4efb\u610f\u5b57\u7b26\u5e76\u4fdd\u5b58\u4e3a\u6807\u7b7e\u4ee5\u4f9b\u5168\u5c40\u8c03\u7528\uff0c\u7b49\u540c\u4e8e\u6355\u83b7\u7ec4\uff1a(?<nr\u6807\u8bc6>.*?)","tips_sign_group":"\u6355\u83b7\u7ec4\uff1a(?<nr\u6807\u8bc6>[\\s\\S]*?)\uff0c\u5339\u914d\u6b63\u5219\u5e76\u4fdd\u5b58\u4e3a[\u5185\u5bb9]\u6807\u7b7e\u4ee5\u4f9b\u8c03\u7528","tips_sign_group_global":"\u6355\u83b7\u7ec4\uff1a(?<nr\u6807\u8bc6>[\\s\\S]*?)\uff0c\u5339\u914d\u6b63\u5219\u5e76\u4fdd\u5b58\u4e3a[\u5185\u5bb9]\u6807\u7b7e\u4ee5\u4f9b\u5168\u5c40\u8c03\u7528","tips_regular":"\u53ef\u4f7f\u7528\u6b63\u5219\u8868\u8fbe\u5f0f","setting":"\u8bbe\u7f6e","setting_site":"\u7ad9\u70b9\u8bbe\u7f6e","set_site_verifycode":"\u5f00\u542f\u56fe\u7247\u9a8c\u8bc1\u7801","setting_caiji":"\u91c7\u96c6\u8bbe\u7f6e","set_caiji_auto":"\u5f00\u542f\u81ea\u52a8\u91c7\u96c6","set_caiji_run":"\u81ea\u52a8\u91c7\u96c6\u8fd0\u884c\u65b9\u5f0f","set_caiji_interval":"\u91c7\u96c6\u8fd0\u884c\u95f4\u9694","set_caiji_num":"\u6700\u5927\u91c7\u96c6\u6570\u91cf","set_caiji_timeout":"\u6700\u5927\u6267\u884c\u65f6\u95f4","setting_email":"\u90ae\u4ef6\u53d1\u9001\u8bbe\u7f6e","set_email_sender":"\u53d1\u4ef6\u4eba\u540d\u79f0","set_email_email":"\u53d1\u4ef6\u4eba\u90ae\u7bb1\u8d26\u53f7","set_email_pwd":"\u53d1\u4ef6\u4eba\u90ae\u7bb1\u5bc6\u7801","set_email_smtp":"SMTP\u670d\u52a1\u5668","set_email_port":"SMTP\u7aef\u53e3","set_email_port_tips":"TLS\u4e00\u822c\u4e3a25\uff0cSSL\u4e00\u822c\u4e3a465\uff0c\u54a8\u8be2\u90ae\u7bb1\u670d\u52a1\u5546\u83b7\u53d6","set_email_type":"SMTP\u7aef\u53e3\u7c7b\u578b","set_email_test_subject":"\u6d4b\u8bd5\u53d1\u9001\u90ae\u4ef6","set_email_test_body":"\u606d\u559c\uff0c\u53d1\u9001\u90ae\u4ef6\u6210\u529f\uff01","setting_store":"\u4e91\u7aef\u8bbe\u7f6e","store_authkey_error":"\u901a\u4fe1\u5bc6\u94a5\u53ea\u80fd\u7531\u5b57\u6bcd\u548c\u6570\u5b57\u7ec4\u6210\u4e14\u957f\u5ea6\u57286-100\u4f4d\u4e4b\u95f4","down_file_name_":"\u6309\u65f6\u95f4\u751f\u6210\uff08\u65b9\u4fbf\u65e5\u671f\u5f52\u7c7b\uff09","down_file_name_time":"\u6309\u65f6\u95f4\u751f\u6210\uff08\u65b9\u4fbf\u65e5\u671f\u5f52\u7c7b\uff09","down_file_name_url":"\u6309\u7f51\u5740\u751f\u6210\uff08\u9632\u6b62\u91cd\u590d\u4e0b\u8f7d\uff09","down_file_name_custom":"\u81ea\u5b9a\u4e49","down_file_name_custom_name_":"\u6587\u4ef6\u7f51\u5740MD5\u7801","down_img_name_custom_name_":"\u56fe\u7247\u7f51\u5740MD5\u7801","config_error_none_email":"\u6ca1\u6709\u90ae\u7bb1\u670d\u52a1\u5668\u914d\u7f6e\uff0c\u8bf7\u5728\u540e\u53f0\u8bbe\u7f6e\uff01","user":"\u7528\u6237","user_list":"\u7528\u6237\u5217\u8868","user_add":"\u6dfb\u52a0\u7528\u6237","user_edit":"\u7f16\u8f91\u7528\u6237","user_username":"\u7528\u6237\u540d","user_password":"\u5bc6\u7801","user_repassword":"\u786e\u8ba4\u5bc6\u7801","user_newpwd_tips":"\u5982\u9700\u4fee\u6539\u5bc6\u7801\uff0c\u8bf7\u5728\u6b64\u8f93\u5165\u65b0\u5bc6\u7801\uff0c\u5426\u5219\u7559\u7a7a","user_email":"\u90ae\u7bb1","user_email_tips":"\u7528\u4e8e\u627e\u56de\u8d26\u53f7\u5bc6\u7801","user_groupid":"\u7528\u6237\u7ec4","user_error_has_username":"\u7528\u6237\u540d\u5df2\u7ecf\u5b58\u5728\uff01","user_error_edit_not_allow":"\u53ea\u6709\u521b\u59cb\u4eba\u624d\u80fd\u7f16\u8f91\u4ed6\u4eba\u7684\u8d26\u53f7\uff01","user_error_delete_not_allow":"\u53ea\u6709\u521b\u59cb\u4eba\u624d\u80fd\u5220\u9664\u8d26\u53f7\uff01","user_error_groupid":"\u4e0d\u662f\u5141\u8bb8\u7684\u7528\u6237\u7ec4\uff01","user_error_del_founder":"\u4e0d\u80fd\u5220\u9664\u521b\u59cb\u4eba\u8d26\u53f7\uff01","user_error_null_uid":"UID\u4e0d\u80fd\u4e3a\u7a7a","user_error_empty_user":"\u7528\u6237\u4e0d\u5b58\u5728","user_error_login":"\u7528\u6237\u540d\u6216\u5bc6\u7801\u4e0d\u6b63\u786e\uff01","user_error_sublogin":"\u767b\u5f55\u63d0\u4ea4\u5931\u8d25","user_error_is_not_admin":"\u62b1\u6b49\uff0c\u8bf7\u767b\u5f55\u7ba1\u7406\u5458\u8d26\u53f7\uff01","user_login_in":"\u767b\u5f55\u4e2d...","user_auto_login":"\u6b63\u5728\u81ea\u52a8\u767b\u5f55...","usertoken_error":"\u7528\u6237token\u9519\u8bef\uff0c\u8bf7\u5237\u65b0\u9875\u9762\u6216\u91cd\u65b0\u767b\u5f55\uff01","task":"\u4efb\u52a1","task_add":"\u6dfb\u52a0\u4efb\u52a1","task_edit":"\u7f16\u8f91\u4efb\u52a1","task_list":"\u4efb\u52a1\u5217\u8868","task_change_list":"\u5217\u8868\u6a21\u5f0f","task_change_folder":"\u5206\u7ec4\u6a21\u5f0f","task_name":"\u4efb\u52a1\u540d\u79f0","task_tg":"\u4efb\u52a1\u5206\u7ec4","task_sort":"\u6392\u5e8f","task_sort_help":"\u6570\u5b57\u8d8a\u5927\u8d8a\u9760\u524d","task_module":"\u91c7\u96c6\u6a21\u5757","task_module_":"\u65e0","task_module_pattern":"\u89c4\u5219\u91c7\u96c6","task_module_keyword":"\u5173\u952e\u8bcd\u91c7\u96c6","task_module_weixin":"\u5fae\u4fe1\u91c7\u96c6","task_auto":"\u81ea\u52a8\u91c7\u96c6","task_auto_":"\u5426","task_auto_0":"\u5426","task_auto_1":"\u5faa\u73af","task_auto_2":"\u5b9a\u65f6","task_addtime":"\u6dfb\u52a0\u65f6\u95f4","task_caijitime":"\u91c7\u96c6\u65f6\u95f4","task_collected":"\u91c7\u96c6\u91cf","task_edit_collector":"\u4e0b\u4e00\u6b65\uff1a\u7f16\u8f91\u91c7\u96c6\u5668","task_root":"\u6839\u76ee\u5f55","task_loading":"\u6b63\u5728\u8f7d\u5165\u6570\u636e","task_none_data":"\u65e0\u6570\u636e","task_set_task":"\u4efb\u52a1\u8bbe\u7f6e","task_set_collector":"\u91c7\u96c6\u5668\u8bbe\u7f6e","task_set_release":"\u53d1\u5e03\u8bbe\u7f6e","task_error_null_id":"\u8bf7\u8f93\u5165\u4efb\u52a1id","task_error_empty_task":"\u4e0d\u5b58\u5728\u4efb\u52a1","task_error_null_tgid":"\u8bf7\u8f93\u5165\u5206\u7ec4id","task_error_empty_tg":"\u4e0d\u5b58\u5728\u5206\u7ec4","task_error_null_name":"\u8bf7\u8f93\u5165\u540d\u79f0\uff01","task_error_has_name":"\u540d\u79f0\u5df2\u7ecf\u5b58\u5728\uff01","task_error_null_module":"\u672a\u8bbe\u7f6e\u91c7\u96c6\u6a21\u5757","taskgroup_add":"\u6dfb\u52a0\u5206\u7ec4","taskgroup_edit":"\u7f16\u8f91\u5206\u7ec4","taskgroup":"\u4efb\u52a1\u5206\u7ec4","taskgroup_list":"\u5206\u7ec4\u5217\u8868","taskgroup_name":"\u5206\u7ec4\u540d\u79f0","taskgroup_sort":"\u6392\u5e8f","taskgroup_sort_help":"\u6570\u5b57\u8d8a\u5927\u8d8a\u9760\u524d","taskgroup_parent_id":"\u7236\u5206\u7ec4","tg_add_sub":"\u6dfb\u52a0\u5b50\u5206\u7ec4","tg_move":"\u79fb\u52a8\u5206\u7ec4","tg_exist_sub":"\u5b58\u5728\u5b50\u5206\u7ec4\uff01","tg_none":"\u5206\u7ec4\u4e0d\u5b58\u5728\uff01","tg_is_parent":"\u5b58\u5728\u5b50\u5206\u7ec4\uff0c\u8bf7\u5148\u6e05\u7a7a\u5b50\u5206\u7ec4\uff0c\u624d\u80fd\u79fb\u52a8\u5206\u7ec4\uff01","tg_deleteall_has_sub":"\u6709\u5b50\u5206\u7ec4\u7684\u4e0d\u80fd\u5220\u9664\uff0c\u9700\u5148\u6e05\u7a7a\u5b50\u5206\u7ec4\uff01","tg_no_checked":"\u6ca1\u6709\u9009\u4e2d\u7684\u8bb0\u5f55\uff01","tg_error_null_name":"\u8bf7\u8f93\u5165\u540d\u79f0\uff01","tg_error_has_name":"\u540d\u79f0\u5df2\u7ecf\u5b58\u5728\uff01","coll_set":"\u91c7\u96c6\u5668\u8bbe\u7f6e","coll_edit_task":"\u4e0a\u4e00\u6b65\uff1a\u7f16\u8f91\u4efb\u52a1","coll_name":"\u91c7\u96c6\u89c4\u5219\u540d\u79f0","coll_error_invalid_module":"\u65e0\u6548\u7684\u91c7\u96c6\u6a21\u5757","coll_error_empty_coll":"\u91c7\u96c6\u5668\u8bbe\u7f6e\u4e0d\u5b58\u5728","coll_error_empty_effective":"\u9875\u9762\u811a\u672c\u4e0d\u53ef\u7528\uff0c\u4fdd\u5b58\u5931\u8d25\uff01","field_module_rule":"\u89c4\u5219\u5339\u914d","field_module_auto":"\u81ea\u52a8\u83b7\u53d6","field_module_xpath":"XPath\u5339\u914d","field_module_words":"\u56fa\u5b9a\u6587\u5b57","field_module_num":"\u968f\u673a\u6570\u5b57","field_module_time":"\u65f6\u95f4","field_module_list":"\u5217\u8868\u62bd\u53d6","field_module_json":"JSON\u63d0\u53d6","field_module_merge":"\u5b57\u6bb5\u7ec4\u5408","field_module_extract":"\u5b57\u6bb5\u63d0\u53d6","field_module_sign":"\u5185\u5bb9\u6807\u7b7e","process_module_html":"html\u6807\u7b7e\u8fc7\u6ee4","process_module_insert":"\u63d2\u5165\u5185\u5bb9","process_module_replace":"\u5185\u5bb9\u66ff\u6362","process_module_filter":"\u5173\u952e\u8bcd\u8fc7\u6ee4","process_module_if":"\u6761\u4ef6\u5224\u65ad","process_module_download":"\u672c\u5730\u5316","process_module_translate":"\u7ffb\u8bd1","process_module_tool":"\u5de5\u5177\u7bb1","process_module_batch":"\u6279\u91cf\u66ff\u6362","process_module_substr":"\u622a\u53d6\u5b57\u7b26\u4e32","process_module_func":"\u4f7f\u7528\u51fd\u6570","process_module_api":"\u8c03\u7528\u63a5\u53e3","p_m_if_1":"\u6ee1\u8db3\u6761\u4ef6\u91c7\u96c6","p_m_if_2":"\u6ee1\u8db3\u6761\u4ef6\u4e0d\u91c7\u96c6","p_m_if_3":"\u4e0d\u6ee1\u8db3\u6761\u4ef6\u91c7\u96c6","p_m_if_4":"\u4e0d\u6ee1\u8db3\u6761\u4ef6\u4e0d\u91c7\u96c6","p_m_if_c_has":"\u5305\u542b","p_m_if_c_nhas":"\u4e0d\u5305\u542b","p_m_if_c_eq":"\u7b49\u4e8e","p_m_if_c_neq":"\u4e0d\u7b49\u4e8e","p_m_if_c_heq":"\u6052\u7b49\u4e8e","p_m_if_c_nheq":"\u4e0d\u6052\u7b49\u4e8e","p_m_if_c_gt":"\u5927\u4e8e","p_m_if_c_egt":"\u5927\u4e8e\u7b49\u4e8e","p_m_if_c_lt":"\u5c0f\u4e8e","p_m_if_c_elt":"\u5c0f\u4e8e\u7b49\u4e8e","p_m_if_c_time_eq":"\u65f6\u95f4\u7b49\u4e8e","p_m_if_c_time_egt":"\u65f6\u95f4\u5927\u4e8e\u7b49\u4e8e","p_m_if_c_time_elt":"\u65f6\u95f4\u5c0f\u4e8e\u7b49\u4e8e","p_m_if_c_regexp":"\u6b63\u5219\u8868\u8fbe\u5f0f","p_m_if_c_func":"\u4f7f\u7528\u51fd\u6570","page_front_url":"\u524d\u7f6e\u9875","page_source_url":"\u8d77\u59cb\u9875","page_level_url":"\u591a\u7ea7\u9875","page_url":"\u5185\u5bb9\u9875","page_relation_url":"\u5173\u8054\u9875","rele_set":"\u53d1\u5e03\u8bbe\u7f6e","rele_error_detect_null":"\u6ca1\u6709\u68c0\u6d4b\u5230\u672c\u5730CMS\u7a0b\u5e8f\uff0c\u60a8\u53ef\u4ee5\u624b\u52a8\u7ed1\u5b9a\u6570\u636e","rele_error_empty_rele":"\u53d1\u5e03\u8bbe\u7f6e\u4e0d\u5b58\u5728","rele_error_null_module":"\u8bf7\u9009\u62e9\u53d1\u5e03\u65b9\u5f0f","rele_error_db":"\u6570\u636e\u5e93\u9519\u8bef\uff1a","rele_error_no_table":"\u8be5\u6570\u636e\u5e93\u6ca1\u6709\u8868","rele_success_db_ok":"\u6570\u636e\u5e93\u8fde\u63a5\u6210\u529f","rele_module":"\u53d1\u5e03\u65b9\u5f0f","rele_module_cms":"\u672c\u5730CMS\u7a0b\u5e8f","rele_module_db":"\u6570\u636e\u5e93","rele_module_api":"\u751f\u6210API","rele_module_toapi":"\u8c03\u7528\u63a5\u53e3","rele_module_file":"\u6587\u4ef6\u5b58\u50a8","rele_module_diy":"\u81ea\u5b9a\u4e49\u63d2\u4ef6","rele_btn_detect":"\u5f00\u59cb\u68c0\u6d4b","rele_cms_path":"CMS\u8def\u5f84","rele_db_type":"\u6570\u636e\u5e93\u7c7b\u578b","rele_db_host":"\u6570\u636e\u5e93\u4e3b\u673a","rele_db_name":"\u6570\u636e\u5e93\u540d\u79f0","rele_db_charset":"\u6570\u636e\u5e93\u7f16\u7801","rele_db_port":"\u6570\u636e\u5e93\u7aef\u53e3","rele_db_user":"\u6570\u636e\u5e93\u7528\u6237","rele_db_pwd":"\u6570\u636e\u5e93\u5bc6\u7801","error_unknown_database":"\u672a\u77e5\u7684\u6570\u636e\u5e93","error_null_input":"\u8bf7\u8f93\u5165{:str}","error_open_basedir":"\u60a8\u7684\u7f51\u7ad9\u5f00\u542f\u4e86\u76ee\u5f55\u8bbf\u95ee\u9650\u5236(open_basedir)\uff0c\u8bf7\u68c0\u67e5\u662f\u5426\u56e0\u8be5\u95ee\u9898\u5bfc\u81f4\u76ee\u5f55\u65e0\u6cd5\u8bfb\u5199\uff01","collected":"\u5df2\u91c7\u96c6\u6570\u636e","collected_list":"\u5df2\u91c7\u96c6\u6570\u636e\u5217\u8868","COLLECTED_RELE_":"\u65e0","collected_rele_cms":"CMS","collected_rele_db":"\u6570\u636e\u5e93","collected_rele_file":"\u6587\u4ef6","collected_rele_toapi":"\u63a5\u53e3","collected_rele_api":"API","collected_rele_diy":"\u63d2\u4ef6","verifycode":"\u9a8c\u8bc1\u7801","verifycode_error":"\u9a8c\u8bc1\u7801\u9519\u8bef\uff01","find_password":"\u627e\u56de\u5bc6\u7801","find_pwd_username":"\u8bf7\u8f93\u5165\u90ae\u7bb1\/\u7528\u6237\u540d","find_pwd_yzm":"\u8bf7\u8f93\u5165\u6fc0\u6d3b\u7801","find_pwd_resend":"\u91cd\u65b0\u53d1\u9001","find_pwd_next_step":"\u4e0b\u4e00\u6b65","find_pwd_pwd":"\u8bf7\u8f93\u5165\u65b0\u5bc6\u7801","find_pwd_repwd":"\u786e\u8ba4\u65b0\u5bc6\u7801","find_pwd_sended":"\u5df2\u5411\u90ae\u7bb1{:email}\u53d1\u9001\u4e86\u6fc0\u6d3b\u7801\uff01","find_pwd_email_failed":"\u53d1\u9001\u90ae\u4ef6\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u540e\u53f0\u53d1\u9001\u90ae\u4ef6\u914d\u7f6e\uff01","find_pwd_email_wait":"\u9700\u7b49\u5f85{:seconds}\u79d2\u624d\u80fd\u518d\u6b21\u53d1\u9001","find_pwd_email_subject":"\u627e\u56de\u5bc6\u7801 - \u84dd\u5929\u91c7\u96c6\u5668","find_pwd_email_body":"\u60a8\u7684\u6fc0\u6d3b\u7801\u4e3a\uff1a{:yzm}\uff0c\u6709\u6548\u65f6\u95f4{:minutes}\u5206\u949f","find_pwd_error_username":"\u8bf7\u8f93\u5165\u90ae\u7bb1\/\u7528\u6237\u540d","find_pwd_error_step":"\u6b65\u9aa4\u9519\u8bef\uff0c\u8bf7\u91cd\u65b0\u64cd\u4f5c\uff01","find_pwd_error_post":"\u8868\u5355\u63d0\u4ea4\u5931\u8d25","find_pwd_error_none_email":"\u90ae\u7bb1\u4e0d\u5b58\u5728\uff01","find_pwd_error_multiple_emails":"\u5b58\u5728\u591a\u4e2a\u7528\u6237\u4f7f\u7528\u6b64\u90ae\u7bb1\uff0c\u8bf7\u8f93\u5165\u7528\u6237\u540d\uff01","find_pwd_error_none_user":"\u7528\u6237\u4e0d\u5b58\u5728\uff01","find_pwd_success":"\u5bc6\u7801\u4fee\u6539\u6210\u529f","yzm_error_please_send":"\u8bf7\u53d1\u9001\u6fc0\u6d3b\u7801","yzm_error_please_input":"\u8bf7\u8f93\u5165\u6fc0\u6d3b\u7801","yzm_error_timeout":"\u6fc0\u6d3b\u7801\u5df2\u8fc7\u671f\uff01\u8bf7\u91cd\u65b0\u53d1\u9001","yzm_error_yzm":"\u6fc0\u6d3b\u7801\u9519\u8bef","admincp_style":"\u754c\u9762","admincp_sidebar_mini":"\u83dc\u5355\u6700\u5c0f\u5316","admincp_skins":"\u8bbe\u7f6e\u76ae\u80a4","skin_blue":"\u84dd","skin_black":"\u9ed1","skin_purple":"\u7d2b","skin_green":"\u7eff","skin_red":"\u7ea2","skin_yellow":"\u9ec4","skin_blue_light":"\u84dd\u4eae","skin_black_light":"\u9ed1\u4eae","skin_purple_light":"\u7d2b\u4eae","skin_green_light":"\u7eff\u4eae","skin_red_light":"\u7ea2\u4eae","skin_yellow_light":"\u9ec4\u4eae","store":"\u4e91\u5e73\u53f0","rule_collect":"\u91c7\u96c6\u89c4\u5219","empty_data":"\u6570\u636e\u4e0d\u5b58\u5728","invalid_op":"\u65e0\u6548\u7684\u64cd\u4f5c\uff01","submit":"\u63d0\u4ea4","search":"\u641c\u7d22","op_success":"\u64cd\u4f5c\u6210\u529f","op_failed":"\u64cd\u4f5c\u5931\u8d25","sort":"\u6392\u5e8f","select":"\u9009\u62e9","select_all":"\u5168\u9009","select_first":"\u8bf7\u9009\u62e9","save":"\u4fdd\u5b58","op":"\u64cd\u4f5c","delete":"\u5220\u9664","deleted":"\u5df2\u5220\u9664","edit":"\u7f16\u8f91","test":"\u6d4b\u8bd5","confirm_delete":"\u786e\u5b9a\u5220\u9664\uff1f","delete_success":"\u5220\u9664\u6210\u529f","none":"\u65e0","caiji":"\u91c7\u96c6","more":"\u66f4\u591a","yes":"\u662f","no":"\u5426","all":"\u5168\u90e8","login":"\u767b\u5f55","logout":"\u9000\u51fa","login_auto":"\u4e0b\u6b21\u81ea\u52a8\u767b\u5f55","separator":"\uff1a","redirecting":"\u8df3\u8f6c\u4e2d...","close":"\u5173\u95ed","tips_match":"\u793a\u4f8b\uff1a<div id="a">[\u5185\u5bb91]<\/div>(*)<div id="b">[\u5185\u5bb92]<\/div>","tips_matchn":"\u793a\u4f8b\uff1a[\u5185\u5bb91] [\u5185\u5bb92]","tips_match_only":"\u793a\u4f8b\uff1a<div id="content">[\u5185\u5bb9]<\/div>","tips_match_area":"\u793a\u4f8b\uff1a<div id="a">[\u5185\u5bb9123]<\/div>(*)<div id="b">[\u5185\u5bb9abc]<\/div>","tips_matchn_area":"\u793a\u4f8b\uff1a[\u5185\u5bb9123] [\u5185\u5bb9abc]","tips_match_url":"\u793a\u4f8b\uff1a<a href="http:\/\/demo.com\/[\u5185\u5bb9123]\/[\u5185\u5bb9abc]">(*)<\/a>","tips_matchn_url":"\u793a\u4f8b\uff1ahttp:\/\/www.demo.com\/[\u5185\u5bb9123]-[\u5185\u5bb9abc].html","release_upgrade":"\u63d2\u4ef6\u7248\u672c\u8fc7\u4f4e\uff0c\u8bf7\u5347\u7ea7\u63d2\u4ef6 \u5347\u7ea7\u6559\u7a0b<\/a>"};
\ No newline at end of file
diff --git a/vendor/skycaiji/app/admin/common.php b/vendor/skycaiji/app/admin/common.php
index 4ef77f4..430ba36 100644
--- a/vendor/skycaiji/app/admin/common.php
+++ b/vendor/skycaiji/app/admin/common.php
@@ -41,3 +41,27 @@ function trim_input_array($arrName){
$data=\util\Funcs::array_array_map('trim', $data);
return $data;
}
+
+
+function trim_input_process($formName,$data=null){
+ if(!empty($formName)){
+ $data=input($formName,array(),null);
+ }
+ init_array($data);
+ static $passModules=array('substr','insert','replace');
+ foreach ($data as $k=>$v){
+ init_array($v);
+ if(isset($v['title'])){
+ $v['title']=trim($v['title']);
+ }
+ if(isset($v['module'])){
+ $v['module']=trim($v['module']);
+ }
+ if(!in_array($v['module'], $passModules)){
+
+ $v=\util\Funcs::array_array_map('trim',$v);
+ }
+ $data[$k]=$v;
+ }
+ return $data;
+}
\ No newline at end of file
diff --git a/vendor/skycaiji/app/admin/controller/Backstage.php b/vendor/skycaiji/app/admin/controller/Backstage.php
index 8cff0a4..482fb54 100644
--- a/vendor/skycaiji/app/admin/controller/Backstage.php
+++ b/vendor/skycaiji/app/admin/controller/Backstage.php
@@ -183,8 +183,6 @@ class Backstage extends BaseController{
$cacheTimeout=time()-(3600*24);
CacheModel::getInstance('cont_url')->db()->where('dateline','<',$cacheTimeout)->delete();
- CacheModel::getInstance('temp')->db()->where('dateline','<',$cacheTimeout)->delete();
-
$mconfig=model('Config');
diff --git a/vendor/skycaiji/app/admin/controller/CollectController.php b/vendor/skycaiji/app/admin/controller/CollectController.php
index 0469344..e55bf0b 100644
--- a/vendor/skycaiji/app/admin/controller/CollectController.php
+++ b/vendor/skycaiji/app/admin/controller/CollectController.php
@@ -181,7 +181,6 @@ class CollectController extends \skycaiji\admin\controller\BaseController{
return $this->_collect_echo_end($isBatch, lang('task_error_empty_task'));
}
- $taskData=$taskData->toArray();
$taskTips='任务:'.$taskData['name'].' » ';
if(empty($taskData['module'])){
@@ -203,7 +202,6 @@ class CollectController extends \skycaiji\admin\controller\BaseController{
}
$collData=$collData->toArray();
$releData=$releData->toArray();
- $taskData['config']=unserialize($taskData['config']?:'');
$mtask->loadConfig($taskData);
$taskData['caijitime']=intval($taskData['caijitime']);
diff --git a/vendor/skycaiji/app/admin/controller/Cpattern.php b/vendor/skycaiji/app/admin/controller/Cpattern.php
index 975d324..4b8e633 100644
--- a/vendor/skycaiji/app/admin/controller/Cpattern.php
+++ b/vendor/skycaiji/app/admin/controller/Cpattern.php
@@ -259,15 +259,59 @@ class Cpattern extends BaseController {
$this->assign('type',$type);
$op=input('op');
+ $taskId=input('task_id/d',0);
- $transApiLangs=null;
- if(!is_empty(g_sc_c('translate'))&&!is_empty(g_sc_c('translate','open'))){
-
- $transApiLangs=\util\Translator::get_api_langs(g_sc_c('translate','api'));
- $transApiLangs=$transApiLangs?$transApiLangs:null;
+ $downImgUrl='';
+ $downFileUrl='';
+ if(is_empty(g_sc_c('download_img','download_img'))){
+ $downImgUrl=url('setting/download_img');
}
+ if(is_empty(g_sc_c('download_file','download_file'))){
+ $downFileUrl=url('setting/download_file');
+ }
+
+ $transUrl='';
+ if(is_empty(g_sc_c('translate','open'))){
+ $transUrl=url('setting/translate');
+ }
+
+ $transApiLangs=\util\Translator::get_api_langs(g_sc_c('translate','api'));
+ init_array($transApiLangs);
$this->assign('transApiLangs',$transApiLangs);
+
+ if($taskId>0){
+ $taskData=model('Task')->getById($taskId);
+ model('Task')->loadConfig($taskData);
+
+ if(is_empty(g_sc_c('download_img','download_img'))){
+ if(!empty($taskData['config']['download_img'])){
+ $downImgUrl=url('task/save?id='.$taskId);
+ }
+ }else{
+ $downImgUrl='';
+ }
+ if(is_empty(g_sc_c('download_file','download_file'))){
+ if(!empty($taskData['config']['download_file'])){
+ $downFileUrl=url('task/save?id='.$taskId);
+ }
+ }else{
+ $downFileUrl='';
+ }
+
+ if(is_empty(g_sc_c('translate','open'))){
+ if(!empty($taskData['config']['translate'])){
+ $transUrl=url('task/save?id='.$taskId);
+ }
+ }else{
+ $transUrl='';
+ }
+ }
+
+ $this->assign('downImgUrl',$downImgUrl);
+ $this->assign('downFileUrl',$downFileUrl);
+ $this->assign('transUrl',$transUrl);
+
if(empty($type)){
if(empty($op)){
@@ -281,7 +325,7 @@ class Cpattern extends BaseController {
return $this->fetch();
}elseif($op=='sub'){
- $process=trim_input_array('process');
+ $process=trim_input_process('process/a');
if(empty($process)){
$process='';
}else{
@@ -296,7 +340,7 @@ class Cpattern extends BaseController {
return $this->fetch();
}elseif($op=='load'){
- $process=trim_input_array('process');
+ $process=trim_input_process('process/a');
$this->assign('process',$process);
return $this->fetch('process_load');
}
@@ -309,7 +353,7 @@ class Cpattern extends BaseController {
if(request()->isPost()){
- $process=trim_input_array('process');
+ $process=trim_input_process('process/a');
if(is_array($process)){
$process=reset($process);
@@ -387,6 +431,7 @@ class Cpattern extends BaseController {
$front_url['use_cookie']=intval($front_url['use_cookie']);
$front_url['use_cookie_img']=intval($front_url['use_cookie_img']);
+ $front_url['use_cookie_file']=intval($front_url['use_cookie_file']);
$front_url=controller('admin/Cpattern','event')->page_set_config('front_url',$front_url);
diff --git a/vendor/skycaiji/app/admin/controller/CpatternTest.php b/vendor/skycaiji/app/admin/controller/CpatternTest.php
index 69c04ff..da11fd3 100644
--- a/vendor/skycaiji/app/admin/controller/CpatternTest.php
+++ b/vendor/skycaiji/app/admin/controller/CpatternTest.php
@@ -76,7 +76,8 @@ class CpatternTest extends BaseController {
if(!empty($this->eCpattern->config['front_urls'])){
$keyUseCookie=\util\Param::key_gsc_use_cookie();
- $keyUseCookieImg=\util\Param::key_gsc_use_cookie(true);
+ $keyUseCookieImg=\util\Param::key_gsc_use_cookie('img');
+ $keyUseCookieFile=\util\Param::key_gsc_use_cookie('file');
$cacheFrontData=cache($cacheFrontKey);
if($clearCache||empty($cacheFrontData)||($cacheFrontData['update_time']!=$collData['uptime'])){
@@ -88,7 +89,8 @@ class CpatternTest extends BaseController {
'page_content_matches'=>$this->eCpattern->page_content_matches,
'cur_front_urls'=>$this->eCpattern->cur_front_urls,
$keyUseCookie=>\util\Param::get_gsc_use_cookie(),
- $keyUseCookieImg=>\util\Param::get_gsc_use_cookie(true),
+ $keyUseCookieImg=>\util\Param::get_gsc_use_cookie('img'),
+ $keyUseCookieFile=>\util\Param::get_gsc_use_cookie('file'),
'update_time'=>$collData['uptime']
);
cache($cacheFrontKey,$cacheFrontData,1200);
@@ -110,10 +112,13 @@ class CpatternTest extends BaseController {
}
if($cacheFrontData[$keyUseCookie]){
- \util\Param::set_gsc_use_cookie(false,$cacheFrontData[$keyUseCookie]);
+ \util\Param::set_gsc_use_cookie('',$cacheFrontData[$keyUseCookie]);
}
if($cacheFrontData[$keyUseCookieImg]){
- \util\Param::set_gsc_use_cookie(true,$cacheFrontData[$keyUseCookieImg]);
+ \util\Param::set_gsc_use_cookie('img',$cacheFrontData[$keyUseCookieImg]);
+ }
+ if($cacheFrontData[$keyUseCookieFile]){
+ \util\Param::set_gsc_use_cookie('file',$cacheFrontData[$keyUseCookieFile]);
}
}
}
@@ -962,7 +967,6 @@ class CpatternTest extends BaseController {
$msg='通过数据处理筛除了'.$num.'条数据';
}
}
-
foreach ($val_list as $v_k=>$vals){
foreach ($vals as $k=>$v){
$vals[$k]=$v['value'];
@@ -1260,20 +1264,12 @@ class CpatternTest extends BaseController {
if($type=='rule'){
- $rule=$this->eCpattern->convert_sign_match($field['rule']);
- $rule=$this->eCpattern->correct_reg_pattern($rule);
-
- $rule_merge=$this->eCpattern->set_merge_default($rule, $field['rule_merge']);
- if(empty($rule_merge)){
-
- $rule_merge=cp_sign('match');
- }
-
- $val=$this->eCpattern->get_rule_module_rule_data(array(
- 'rule' => $rule,
- 'rule_merge' => $rule_merge,
+ $val=$this->eCpattern->rule_module_rule_data_get(array(
+ 'rule' => $field['rule'],
+ 'rule_merge' => $field['rule_merge'],
'rule_multi' => $field['rule_multi'],
- 'rule_multi_str' => $field['rule_multi_str']
+ 'rule_multi_str' => $field['rule_multi_str'],
+ 'rule_flags'=>$this->eCpattern->config['reg_regexp_flags'],
), $content,array(),true);
}elseif($type=='xpath'){
@@ -1289,7 +1285,6 @@ class CpatternTest extends BaseController {
'json_arr' => $field['json_arr'],
'json_arr_implode' => $field['json_arr_implode'],
), $content);
- $val = trim($val);
}
$this->success($val);
}else{
diff --git a/vendor/skycaiji/app/admin/controller/Develop.php b/vendor/skycaiji/app/admin/controller/Develop.php
index 87d8c60..c60595c 100644
--- a/vendor/skycaiji/app/admin/controller/Develop.php
+++ b/vendor/skycaiji/app/admin/controller/Develop.php
@@ -1058,7 +1058,7 @@ EOF;
'插件编辑器',
$setTitle,
$setNav
- );
+ );
$this->assign('config',array('type'=>$type,'module'=>$module,'app'=>$app));
$this->assign('type',$type);
@@ -1116,11 +1116,56 @@ EOF;
if(empty($filename)){
$this->error('插件文件错误');
}
- file_put_contents($filename, $appcode);
+ write_dir_file($filename, $appcode);
$uri=sprintf('develop/editor?type=%s&module=%s&app=%s',$type,$module,$app);
$this->success('操作成功',$uri);
}else{
$this->error('提交错误');
}
}
+ public function plugin_skycaijiAction(){
+ $op=input('op');
+ $scjPlugin = new \ReflectionClass('\\plugin\\skycaiji');
+ $scjMethods=$scjPlugin->getMethods(\ReflectionMethod::IS_PUBLIC);
+ if(empty($op)){
+
+ $scjMethods1=array();
+ foreach ($scjMethods as $scjMethod){
+ $methodName=$scjMethod->name;
+ if(empty($methodName)||strpos($methodName,'__')===0){
+
+ continue;
+ }
+ $methodCmt=$scjMethod->getDocComment();
+ if($methodCmt){
+ $methodCmt=preg_replace('/^[\/\*\s]+/m', '', $methodCmt);
+ $methodCmt=trim($methodCmt);
+ $methodCmt=htmlspecialchars($methodCmt,ENT_QUOTES);
+ $methodCmt=preg_replace('/[\r\n]+/', '
', $methodCmt);
+ }
+ $scjMethods1[$methodName]=$methodCmt;
+ }
+ $scjMethods=$scjMethods1;
+ $this->success('','',$scjMethods);
+ }elseif($op=='method'){
+ $method=input('method','');
+ $code=file(config('plugin_path').'/skycaiji.php');
+ $methodCmt='';
+ $methodCode='';
+ foreach ($scjMethods as $scjMethod){
+ if($scjMethod->name==$method){
+ $methodCmt=$scjMethod->getDocComment();
+ $methodStart=$scjMethod->getStartLine();
+ $methodEnd=$scjMethod->getEndLine();
+ $methodCode=array_slice($code, $methodStart-1, $methodEnd-$methodStart+1);
+ $methodCode=is_array($methodCode)?implode('',$methodCode):'';
+ break;
+ }
+ }
+
+ $this->assign('methodCmt',$methodCmt);
+ $this->assign('methodCode',$methodCode);
+ return $this->fetch('plugin_skycaiji_method');
+ }
+ }
}
\ No newline at end of file
diff --git a/vendor/skycaiji/app/admin/controller/Index.php b/vendor/skycaiji/app/admin/controller/Index.php
index 2f21d0e..afe82ef 100644
--- a/vendor/skycaiji/app/admin/controller/Index.php
+++ b/vendor/skycaiji/app/admin/controller/Index.php
@@ -419,19 +419,50 @@ class Index extends CollectController{
if(g_sc_c('caiji','run')!='visit'){
$this->error('不是访问触发方式');
}
+ $taskIds=input('task_ids','');
+
+ $cacheKey='collect_visit_time'.($taskIds?('_'.$taskIds):'');
+ $cacheKey=md5($cacheKey);
+ $url='admin/index/caiji'.($taskIds?('?task_ids='.rawurlencode($taskIds)):'');
+
$mcache=CacheModel::getInstance();
- $collectVisitTime=$mcache->getCache('collect_visit_time','data');
+ $collectVisitTime=$mcache->getCache($cacheKey,'data');
$nowTime=time();
if($collectVisitTime&&$nowTime-$collectVisitTime<=15){
- $this->success('正在运行','admin/index/caiji',null,10);
+ $this->success('正在运行',$url,null,10);
}
+ $mcache->setCache($cacheKey,$nowTime);
$mcache->setCache('collect_visit_time',$nowTime);
- \skycaiji\admin\model\Collector::collect_run_auto();
- $this->success('正在采集...','admin/index/caiji',null,10);
+ $autoIds=array();
+ if($taskIds){
+ $taskIds=explode(',',$taskIds);
+ init_array($taskIds);
+ $taskIds=array_map('intval',$taskIds);
+
+ $autoIds=model('Task')->where(array(
+ 'id'=>array('in',$taskIds),
+ 'auto'=>array('>',0),
+ 'module'=>'pattern',
+ ))->order('caijitime asc')->column('id');
+ foreach ($taskIds as $k=>$v){
+ if(in_array($v, $autoIds)){
+
+ unset($taskIds[$k]);
+ }
+ }
+ if($taskIds){
+ $taskIds='
id:'.implode(',', $taskIds).'不是自动采集任务';
+ }
+ }
+ $taskIds=$taskIds?:'';
+
+ \skycaiji\admin\model\Collector::collect_run_auto('',$autoIds);
+
+ $this->success('正在采集...'.$taskIds,$url,null,10);
}
/*运行自动采集*/
public function auto_collectAction(){
@@ -445,7 +476,18 @@ class Index extends CollectController{
}
$this->collect_create_or_run(function(){
- $taskIds=model('Task')->where("auto>0 and module='pattern'")->order('caijitime asc')->column('id');
+ $cond=array();
+ $taskIds=input('task_ids','');
+ if($taskIds){
+
+ $taskIds=explode(',', $taskIds);
+ init_array($taskIds);
+ $taskIds=array_map('intval',$taskIds);
+ $cond['id']=array('in',$taskIds);
+ }
+ $cond['auto']=array('>',0);
+ $cond['module']='pattern';
+ $taskIds=model('Task')->where($cond)->order('caijitime asc')->column('id');
if(empty($taskIds)){
$this->echo_msg_exit('没有可自动采集的任务 设置');
}
diff --git a/vendor/skycaiji/app/admin/controller/Setting.php b/vendor/skycaiji/app/admin/controller/Setting.php
index c712f5f..a1e3521 100644
--- a/vendor/skycaiji/app/admin/controller/Setting.php
+++ b/vendor/skycaiji/app/admin/controller/Setting.php
@@ -193,18 +193,15 @@ class Setting extends BaseController {
$config['img_func']=input('img_func','');
$config['img_func_param']=input('img_func_param','');
+ $config['img_watermark']=input('img_watermark/d',0);
+ $config['img_wm_logo']=input('img_wm_logo','');
+ $config['img_wm_right']=input('img_wm_right/d',0);
+ $config['img_wm_bottom']=input('img_wm_bottom/d',0);
+ $config['img_wm_opacity']=input('img_wm_opacity/d',0);
+ $config['img_wm_opacity']=min(100,max(0,$config['img_wm_opacity']));
- if(!empty($config['more_suffix'])){
- if(preg_match_all('/\b[a-zA-Z]\w+\b/i', $config['more_suffix'],$msuffix)){
-
- $msuffix=$msuffix[0];
- $msuffix=implode(',', $msuffix);
- $config['more_suffix']=strtolower($msuffix);
- }else{
- $config['more_suffix']='';
- }
- }
+ $config['more_suffix']=\skycaiji\admin\model\Config::process_suffix($config['more_suffix']);
if(!empty($config['img_path'])){
@@ -257,6 +254,14 @@ class Setting extends BaseController {
$this->error('请输入系统编码自定义内容');
}
+
+ $upResult=$mconfig->upload_img_watermark_logo('img_wm_logo_upload');
+ if(!$upResult['success']){
+ $this->error($upResult['msg']);
+ }elseif($upResult['file_name']){
+ $config['img_wm_logo']=$upResult['file_name'];
+ }
+
$mconfig->setConfig('download_img',$config);
$this->success(lang('op_success'),'setting/download_img');
@@ -265,7 +270,7 @@ class Setting extends BaseController {
'图片本地化设置',
'图片本地化设置',
breadcrumb(array(array('url'=>url('setting/caiji'),'title'=>lang('setting_caiji')),array('url'=>url('setting/download_img'),'title'=>'图片本地化')))
- );
+ );
$imgConfig=$mconfig->getConfig('download_img','data');
init_array($imgConfig);
if(empty($imgConfig)){
@@ -295,10 +300,122 @@ class Setting extends BaseController {
}
}
+ $imgWmError='';
+ $LocSystem=new \skycaiji\install\event\LocSystem();
+ $LocSystem=$LocSystem->environmentPhp();
+ if(empty($LocSystem['gd']['loaded'])){
+
+ $imgWmError='php未启用gd模块';
+ }
+
+ $this->assign('imgWmError',$imgWmError);
$this->assign('imgConfig',$imgConfig);
return $this->fetch('download_img');
}
}
+ /*文件本地化设置*/
+ public function download_fileAction(){
+ $mconfig=model('Config');
+ if(request()->isPost()){
+ $config=array();
+
+ $config['download_file']=input('download_file/d',0);
+ $config['file_interval']=input('file_interval/d',0);
+
+ $config['file_timeout']=input('file_timeout/d',0);
+ $config['retry']=input('retry/d',0);
+ $config['wait']=input('wait/d',0);
+ $config['file_path']=trim(input('file_path',''));
+ $config['file_url']=input('file_url','','trim');
+ $config['file_name']=input('file_name','');
+ $config['name_custom_path']=input('name_custom_path','');
+ $config['name_custom_name']=input('name_custom_name','');
+ $config['charset']=input('charset','');
+ $config['charset_custom']=input('charset_custom','');
+ $config['file_max']=input('file_max/d',0);
+
+ $config['file_func']=input('file_func','');
+ $config['file_func_param']=input('file_func_param','');
+
+
+
+ if(!empty($config['file_path'])){
+
+ $checkFilePath=$mconfig->check_file_path($config['file_path']);
+ if(!$checkFilePath['success']){
+ $this->error($checkFilePath['msg']);
+ }
+ }
+
+ if(!empty($config['file_url'])){
+
+ $checkFileUrl=$mconfig->check_file_url($config['file_url']);
+ if(!$checkFileUrl['success']){
+ $this->error($checkFileUrl['msg']);
+ }
+ }
+
+
+ $checkNamePath=$mconfig->check_file_name_path($config['name_custom_path']);
+ if($config['file_name']=='custom'){
+
+ if(empty($config['name_custom_path'])){
+ $this->error('请输入文件名称自定义路径');
+ }
+ if(!$checkNamePath['success']){
+ $this->error($checkNamePath['msg']);
+ }
+ }else{
+
+ if(!$checkNamePath['success']){
+ $config['name_custom_path']='';
+ }
+ }
+
+ $checkNameName=$mconfig->check_file_name_name($config['name_custom_name']);
+ if($config['file_name']=='custom'){
+
+ if(!empty($config['name_custom_name'])&&!$checkNameName['success']){
+ $this->error($checkNameName['msg']);
+ }
+ }else{
+
+ if(!$checkNameName['success']){
+ $config['name_custom_name']='';
+ }
+ }
+
+ if($config['charset']=='custom'&&empty($config['charset_custom'])){
+ $this->error('请输入系统编码自定义内容');
+ }
+
+ $mconfig->setConfig('download_file',$config);
+
+ $this->success(lang('op_success'),'setting/download_file');
+ }else{
+ $this->set_html_tags(
+ '文件本地化设置',
+ '文件本地化设置',
+ breadcrumb(array(array('url'=>url('setting/caiji'),'title'=>lang('setting_caiji')),array('url'=>url('setting/download_file'),'title'=>'文件本地化')))
+ );
+ $fileConfig=$mconfig->getConfig('download_file','data');
+ init_array($fileConfig);
+
+ if(empty($fileConfig)){
+
+ $fileConfig['file_timeout']=0;
+ $fileConfig['file_max']=0;
+ $fileConfig['file_interval']=0;
+ $fileConfig['wait']=0;
+ $fileConfig['retry']=0;
+ }
+
+ $this->assign('fileConfig',$fileConfig);
+ return $this->fetch('download_file');
+ }
+ }
+
+
/*代理设置*/
public function proxyAction(){
$mconfig=model('Config');
diff --git a/vendor/skycaiji/app/admin/controller/Task.php b/vendor/skycaiji/app/admin/controller/Task.php
index 3f898c6..a3e5bed 100644
--- a/vendor/skycaiji/app/admin/controller/Task.php
+++ b/vendor/skycaiji/app/admin/controller/Task.php
@@ -272,6 +272,7 @@ class Task extends CollectController {
}
$isAdd=true;
if(!empty($taskData)){
+ $taskData['config']=$mtask->compatible_config($taskData['config']);
$isAdd=false;
}
if(request()->isPost()){
@@ -333,13 +334,7 @@ class Task extends CollectController {
}
}
- /*导入规则*/
- $ruleId=input('rule_id');
- if(!empty($taskData)&&!empty($ruleId)){
- $this->_import_rule($taskData, $ruleId);
- }
-
- model('TaskTimer')->addTimer($tid,$taskTimerData);
+ $this->_save_common($taskData, $taskTimerData);
$this->success(lang('op_success'),input('referer','','trim')?input('referer','','trim'):('task/save?id='.$tid));
}else{
@@ -357,13 +352,8 @@ class Task extends CollectController {
if($mtask->strict(false)->where(array('id'=>intval($taskData['id'])))->update($newData)>=0){
$taskData=$mtask->getById($taskData['id']);
- /*导入规则*/
- $ruleId=input('rule_id');
- if(!empty($taskData)&&!empty($ruleId)){
- $this->_import_rule($taskData, $ruleId);
- }
- model('TaskTimer')->addTimer($taskData['id'],$taskTimerData);
+ $this->_save_common($taskData, $taskTimerData);
$this->success(lang('op_success'),'task/save?id='.$taskData['id']);
}else{
@@ -380,10 +370,6 @@ class Task extends CollectController {
breadcrumb(array(array('url'=>url('task/list'),'title'=>lang('task_list')),array('url'=>url('task/save'),'title'=>lang('task_add'))))
);
}else{
- $taskData=$taskData->getData();
- $taskData=is_array($taskData)?$taskData:array();
- $taskData['config']=unserialize($taskData['config']?:'');
- $taskData['config']=is_array($taskData['config'])?$taskData['config']:array();
if(input('?show_config')){
$taskData['_show_config']=1;
@@ -391,7 +377,7 @@ class Task extends CollectController {
$this->set_html_tags(
'任务:'.$taskData['name'],
- lang('task_edit').':'.$taskData['name'],
+ lang('task_edit').':'.$taskData['name'].'(id:'.$taskData['id'].')',
breadcrumb(array(array('url'=>url('task/list'),'title'=>lang('task_list')),array('url'=>url('task/save?id='.$taskData['id']),'title'=>$taskData['name'])))
);
@@ -412,11 +398,15 @@ class Task extends CollectController {
$taskData['_task_timer']=$timerData;
$timerInfo=$mtimer->timer_info($timerData);
$timerInfo=$timerInfo?('
定时:'.$timerInfo):'';
+
$this->assign('taskData',$taskData);
$this->assign('timerInfo',$timerInfo);
$this->assign('fieldList',$fieldList);
}
+ $proxyGroupId=g_sc_c('proxy','group_id');
+ $proxyGroupId=intval($proxyGroupId);
+
$imgFuncParam=g_sc_c('download_img','img_func_param');
if($imgFuncParam){
$imgFuncParam=str_replace("\r", '\r', $imgFuncParam);
@@ -425,26 +415,53 @@ class Task extends CollectController {
}else{
$imgFuncParam='';
}
- $proxyGroupId=g_sc_c('proxy','group_id');
- $proxyGroupId=intval($proxyGroupId);
+
+ $fileFuncParam=g_sc_c('download_file','file_func_param');
+ if($fileFuncParam){
+ $fileFuncParam=str_replace("\r", '\r', $fileFuncParam);
+ $fileFuncParam=str_replace("\n", '\n', $fileFuncParam);
+ $fileFuncParam=htmlspecialchars($fileFuncParam,ENT_QUOTES);
+ }else{
+ $fileFuncParam='';
+ }
+
$gConfig=array(
'num'=>intval(g_sc_c('caiji','num')),
- 'interval'=>intval(g_sc_c('caiji','interval')),
- 'interval_html'=>intval(g_sc_c('caiji','interval_html')),
+ 'num_interval'=>intval(g_sc_c('caiji','interval')),
+ 'num_interval_html'=>intval(g_sc_c('caiji','interval_html')),
'same_url'=>g_sc_c('caiji','same_url')>0?'允许':'过滤',
'same_title'=>g_sc_c('caiji','same_title')>0?'允许':'过滤',
'real_time'=>g_sc_c('caiji','real_time')>0?'是':'否',
+ 'translate'=>g_sc_c('translate','open')>0?'1':'',
'proxy'=>g_sc_c('proxy','open')>0?'1':'',
'proxy_group_id'=>$proxyGroupId<=0?'全部':model('ProxyGroup')->getNameById($proxyGroupId),
+
'download_img'=>g_sc_c('download_img','download_img')>0?'1':'',
'img_path'=>g_sc_c('download_img','img_path')?g_sc_c('download_img','img_path'):(config('root_path').DS.'data'.DS.'images'),
'img_url'=>g_sc_c('download_img','img_url')?g_sc_c('download_img','img_url'):(config('root_website').'/data/images'),
'img_name'=>g_sc_c('download_img','img_name'),
'name_custom_path'=>g_sc_c('download_img','name_custom_path')?g_sc_c('download_img','name_custom_path'):'无',
'name_custom_name'=>lang('down_img_name_custom_name_'.g_sc_c('download_img','name_custom_name')),
- 'interval_img'=>intval(g_sc_c('download_img','interval_img')),
+ 'num_interval_img'=>intval(g_sc_c('download_img','interval_img')),
+
+ 'img_watermark'=>g_sc_c('download_img','img_watermark')>0?'1':'',
+ 'img_wm_logo'=>g_sc_c('download_img','img_wm_logo'),
+ 'img_wm_right'=>g_sc_c('download_img','img_wm_right')?g_sc_c('download_img','img_wm_right'):'0',
+ 'img_wm_bottom'=>g_sc_c('download_img','img_wm_bottom')?g_sc_c('download_img','img_wm_bottom'):'0',
+ 'img_wm_opacity'=>g_sc_c('download_img','img_wm_opacity')?g_sc_c('download_img','img_wm_opacity'):'不透明',
+
'img_func'=>g_sc_c('download_img','img_func'),
- 'img_func_param'=>$imgFuncParam
+ 'img_func_param'=>$imgFuncParam,
+
+ 'download_file'=>g_sc_c('download_file','download_file')>0?'1':'',
+ 'file_path'=>g_sc_c('download_file','file_path')?g_sc_c('download_file','file_path'):(config('root_path').DS.'data'.DS.'files'),
+ 'file_url'=>g_sc_c('download_file','file_url')?g_sc_c('download_file','file_url'):(config('root_website').'/data/files'),
+ 'file_name'=>g_sc_c('download_file','file_name'),
+ 'file_custom_path'=>g_sc_c('download_file','file_custom_path')?g_sc_c('download_file','file_custom_path'):'无',
+ 'file_custom_name'=>lang('down_file_name_custom_name_'.g_sc_c('download_file','file_custom_name')),
+ 'file_interval'=>intval(g_sc_c('download_file','file_interval')),
+ 'file_func'=>g_sc_c('download_file','file_func'),
+ 'file_func_param'=>$fileFuncParam,
);
$this->assign('gConfig',$gConfig);
$this->assign('tgSelect',$tgSelect);
@@ -469,18 +486,32 @@ class Task extends CollectController {
$this->error();
}
}
-
+
+ private function _save_common($taskData,$taskTimerData){
+
+ $ruleId=input('rule_id');
+ if(!empty($taskData)&&!empty($ruleId)){
+ $this->_import_rule($taskData, $ruleId);
+ }
+
+ model('TaskTimer')->addTimer($taskData['id'],$taskTimerData);
+
+
+ $upResult=model('Config')->upload_img_watermark_logo('img_wm_logo_upload','task'.$taskData['id']);
+ if($upResult['success']&&$upResult['file_name']){
+ $taskData['config']['img_wm_logo']=$upResult['file_name'];
+ model('Task')->strict(false)->where(array('id'=>intval($taskData['id'])))->update(array('config'=>serialize($taskData['config'])));
+ }
+ }
private function _save_config($config=array()){
- $config=is_array($config)?$config:array();
- $config['num']=intval($config['num']);
- $config['interval']=intval($config['interval']);
- $config['interval_html']=intval($config['interval_html']);
+
+ $config=is_array($config)?$config:array();
+ $config['num']=empty($config['num'])?'':$config['num'];
$config['img_path']=trim($config['img_path']);
$config['img_url']=trim($config['img_url']);
- $config['interval_img']=intval($config['interval_img']);
$config['proxy_group_id']=trim($config['proxy_group_id']);
-
+
$mconfig=model('Config');
if(!empty($config['img_path'])){
@@ -501,12 +532,15 @@ class Task extends CollectController {
$checkNamePath=$mconfig->check_img_name_path($config['name_custom_path']);
if($config['img_name']=='custom'){
- if(empty($config['name_custom_path'])&&is_empty(g_sc_c('download_img','name_custom_path'))){
-
- $this->error('请输入图片名称自定义路径');
- }
- if(!$checkNamePath['success']){
- $this->error($checkNamePath['msg']);
+ if(empty($config['name_custom_path'])){
+ if(is_empty(g_sc_c('download_img','name_custom_path'))){
+
+ $this->error('请输入图片名称自定义路径');
+ }
+ }else{
+ if(!$checkNamePath['success']){
+ $this->error($checkNamePath['msg']);
+ }
}
}else{
@@ -528,6 +562,67 @@ class Task extends CollectController {
}
}
+
+ $checkWmLogo=$mconfig->check_img_watermark_logo('img_wm_logo_upload');
+ if(!$checkWmLogo['success']){
+ $this->error($checkWmLogo['msg']);
+ }
+ if(!is_empty($config['img_wm_opacity'],true)){
+
+ $config['img_wm_opacity']=min(100,max(0,$config['img_wm_opacity']));
+ }
+
+ $config['file_path']=trim($config['file_path']);
+ $config['file_url']=trim($config['file_url']);
+
+ if(!empty($config['file_path'])){
+
+ $checkFilePath=$mconfig->check_file_path($config['file_path']);
+ if(!$checkFilePath['success']){
+ $this->error($checkFilePath['msg']);
+ }
+ }
+ if(!empty($config['file_url'])){
+
+ $checkFileUrl=$mconfig->check_file_url($config['file_url']);
+ if(!$checkFileUrl['success']){
+ $this->error($checkFileUrl['msg']);
+ }
+ }
+
+ $checkNamePath=$mconfig->check_file_name_path($config['file_custom_path']);
+ if($config['file_name']=='custom'){
+
+ if(empty($config['file_custom_path'])){
+ if(is_empty(g_sc_c('download_file','file_custom_path'))){
+
+ $this->error('请输入文件名称自定义路径');
+ }
+ }else{
+ if(!$checkNamePath['success']){
+ $this->error($checkNamePath['msg']);
+ }
+ }
+ }else{
+
+ if(!$checkNamePath['success']){
+ $config['file_custom_path']='';
+ }
+ }
+
+ $checkNameName=$mconfig->check_file_name_name($config['file_custom_name']);
+ if($config['file_name']=='custom'){
+
+ if(!empty($config['file_custom_name'])&&!$checkNameName['success']){
+ $this->error($checkNameName['msg']);
+ }
+ }else{
+
+ if(!$checkNameName['success']){
+ $config['file_custom_name']='';
+ }
+ }
+
return $config;
}
@@ -553,7 +648,7 @@ class Task extends CollectController {
$result=controller('admin/Mystore')->_upload_addon(true,'rule_file',false,true);
if(!$result['success']){
- $this->error($result['msg'],'');
+ $this->error($result['msg'],'task/save?id='.$taskData['id']);
}else{
$ruleData=$result['ruleData'];
}
diff --git a/vendor/skycaiji/app/admin/event/Cpattern.php b/vendor/skycaiji/app/admin/event/Cpattern.php
index cc371fc..ba00846 100644
--- a/vendor/skycaiji/app/admin/event/Cpattern.php
+++ b/vendor/skycaiji/app/admin/event/Cpattern.php
@@ -20,6 +20,7 @@ class Cpattern extends CpatternEvent{
$config['page_render']=intval($config['page_render']);
$config['url_repeat']=intval($config['url_repeat']);
$config['url_no_name']=intval($config['url_no_name']);
+ $config['url_encode']=intval($config['url_encode']);
if(!is_array($config['regexp_flags'])){
$config['regexp_flags']=array();
@@ -33,6 +34,8 @@ class Cpattern extends CpatternEvent{
\util\Funcs::filter_key_val_list($config['request_headers']['img_names'], $config['request_headers']['img_vals']);
+ \util\Funcs::filter_key_val_list($config['request_headers']['file_names'], $config['request_headers']['file_vals']);
+
if(is_array($config['front_urls'])){
@@ -90,7 +93,7 @@ class Cpattern extends CpatternEvent{
$config['field_process'][$k]=$this->set_process($config['field_process'][$k]);
}
}
- $config['common_process']=input('process/a',array(),'trim');
+ $config['common_process']=trim_input_process('process/a');
$config['common_process']=$this->set_process($config['common_process']);
@@ -153,12 +156,18 @@ class Cpattern extends CpatternEvent{
if(is_array($this->config_params['headers'])){
set_g_sc('task_img_headers',$this->config_params['headers']['img']);
+
+ set_g_sc('task_file_headers',$this->config_params['headers']['file']);
}
if(!is_array(g_sc('task_img_headers'))){
set_g_sc('task_img_headers',array());
}
- \util\Param::set_gsc_use_cookie(false,null);
- \util\Param::set_gsc_use_cookie(true,null);
+ if(!is_array(g_sc('task_file_headers'))){
+ set_g_sc('task_file_headers',array());
+ }
+ \util\Param::set_gsc_use_cookie('',null);
+ \util\Param::set_gsc_use_cookie('img',null);
+ \util\Param::set_gsc_use_cookie('file',null);
}
public function initConfig($config){
@@ -404,7 +413,7 @@ class Cpattern extends CpatternEvent{
$signs=array();
- $headers=array('page'=>array(),'page_headers'=>array(),'img'=>array());
+ $headers=array('page'=>array(),'page_headers'=>array(),'img'=>array(),'file'=>array());
if(!empty($config['request_headers']['useragent'])){
$headers['page']['useragent']=$config['request_headers']['useragent'];
}
@@ -432,13 +441,28 @@ class Cpattern extends CpatternEvent{
$headers['img']=$headers['page_headers'];
}
-
$imgHeaders=$this->arrays_to_key_val($config['request_headers']['img_names'], $config['request_headers']['img_vals']);
if(!empty($imgHeaders)&&is_array($imgHeaders)){
$headers['img']=\util\Funcs::array_key_merge($headers['img'],$imgHeaders);
unset($imgHeaders);
}
+
+ if(empty($config['request_headers']['file_use_page'])){
+
+ $headers['file']=empty($config['request_headers']['open'])?array():$headers['page_headers'];
+ }elseif($config['request_headers']['file_use_page']=='y'){
+
+ $headers['file']=$headers['page_headers'];
+ }
+
+ $fileHeaders=$this->arrays_to_key_val($config['request_headers']['file_names'], $config['request_headers']['file_vals']);
+ if(!empty($fileHeaders)&&is_array($fileHeaders)){
+ $headers['file']=\util\Funcs::array_key_merge($headers['file'],$fileHeaders);
+ unset($fileHeaders);
+ }
+
+
if(empty($config['request_headers']['open'])){
$headers['page']=null;
@@ -457,6 +481,11 @@ class Cpattern extends CpatternEvent{
$headers['img']=null;
}
+ if(empty($config['request_headers']['file'])){
+
+ $headers['file']=null;
+ }
+
if(!is_array($this->config_params)){
$this->config_params=array();
}
@@ -502,6 +531,9 @@ class Cpattern extends CpatternEvent{
if(g_sc_c('download_img','download_img')){
$opened_tools[]='图片本地化';
}
+ if(g_sc_c('download_file','download_file')){
+ $opened_tools[]='文件本地化';
+ }
if(g_sc_c('proxy','open')){
$opened_tools[]='代理';
}
@@ -697,8 +729,9 @@ class Cpattern extends CpatternEvent{
public function collFrontUrls($resetColl=false){
if($resetColl){
- \util\Param::set_gsc_use_cookie(false,null);
- \util\Param::set_gsc_use_cookie(true,null);
+ \util\Param::set_gsc_use_cookie('',null);
+ \util\Param::set_gsc_use_cookie('img',null);
+ \util\Param::set_gsc_use_cookie('file',null);
}elseif($this->front_collected){
return;
@@ -722,7 +755,7 @@ class Cpattern extends CpatternEvent{
$pageOpened=$this->page_opened_tips('front_url',$fuv['name']);
$this->echo_msg($pageOpened?array('采集前置页“%s”:%s',$fuv['name'],$pageOpened.$frontUrl):array('采集前置页“%s”:
%s',$fuv['name'],$frontUrl,$frontUrl),'black');
$htmlInfo=$this->get_page_html($frontUrl,'front_url',$fuv['name'],false,true);
- if($fuv['use_cookie']||$fuv['use_cookie_img']){
+ if($fuv['use_cookie']||$fuv['use_cookie_img']||$fuv['use_cookie_file']){
$mUseCookie=array();
if($htmlInfo['header']){
@@ -752,15 +785,21 @@ class Cpattern extends CpatternEvent{
if($fuv['use_cookie']){
$gUseCookie=\util\Param::get_gsc_use_cookie();
init_array($gUseCookie);
- \util\Param::set_gsc_use_cookie(false,array_merge($gUseCookie,$mUseCookie));
+ \util\Param::set_gsc_use_cookie('',array_merge($gUseCookie,$mUseCookie));
$this->echo_msg('获取前置页cookie并在全局抓取页面时使用','black');
}
if($fuv['use_cookie_img']){
- $gUseCookieImg=\util\Param::get_gsc_use_cookie(true);
+ $gUseCookieImg=\util\Param::get_gsc_use_cookie('img');
init_array($gUseCookieImg);
- \util\Param::set_gsc_use_cookie(true,array_merge($gUseCookieImg,$mUseCookie));
+ \util\Param::set_gsc_use_cookie('img',array_merge($gUseCookieImg,$mUseCookie));
$this->echo_msg('获取前置页cookie并在全局下载图片时使用','black');
}
+ if($fuv['use_cookie_file']){
+ $gUseCookieFile=\util\Param::get_gsc_use_cookie('file');
+ init_array($gUseCookieFile);
+ \util\Param::set_gsc_use_cookie('file',array_merge($gUseCookieFile,$mUseCookie));
+ $this->echo_msg('获取前置页cookie并在全局下载文件时使用','black');
+ }
}
}
}
@@ -995,7 +1034,7 @@ class Cpattern extends CpatternEvent{
$field_name=$field_params['name'];
if(!isset($this->field_val_list[$field_name])){
- $this->field_val_list[$field_name]=array('values'=>array(),'imgs'=>array());
+ $this->field_val_list[$field_name]=array('values'=>array(),'imgs'=>array(),'files'=>array());
}
if(!empty($field_params['source'])&&in_array($module, array('rule','xpath','json','auto','sign'))){
@@ -1066,7 +1105,8 @@ class Cpattern extends CpatternEvent{
foreach ($this->field_val_list[$field_params['extract']]['values'][$cur_url_md5] as $k=>$v){
$extract_field_val=array(
'value'=>$v,
- 'img'=>$this->field_val_list[$field_params['extract']]['imgs'][$cur_url_md5][$k],
+ 'img'=>$this->field_val_list[$field_params['extract']]['imgs'][$cur_url_md5][$k],
+ 'file'=>$this->field_val_list[$field_params['extract']]['files'][$cur_url_md5][$k],
);
$val[$k]=$this->field_module_extract($field_params, $extract_field_val, $url_info);
}
@@ -1074,7 +1114,8 @@ class Cpattern extends CpatternEvent{
$extract_field_val=array(
'value'=>$this->field_val_list[$field_params['extract']]['values'][$cur_url_md5],
- 'img'=>$this->field_val_list[$field_params['extract']]['imgs'][$cur_url_md5],
+ 'img'=>$this->field_val_list[$field_params['extract']]['imgs'][$cur_url_md5],
+ 'file'=>$this->field_val_list[$field_params['extract']]['files'][$cur_url_md5],
);
$val=$this->field_module_extract($field_params, $extract_field_val, $url_info);
}
@@ -1086,7 +1127,8 @@ class Cpattern extends CpatternEvent{
foreach ($this->field_val_list as $k=>$v){
$cur_field_val_list[$k]=array(
'value'=>$v['values'][$cur_url_md5],
- 'img'=>$v['imgs'][$cur_url_md5]
+ 'img'=>$v['imgs'][$cur_url_md5],
+ 'file'=>$v['files'][$cur_url_md5]
);
}
$val=$this->field_module_merge($field_params,$cur_field_val_list);
@@ -1100,7 +1142,8 @@ class Cpattern extends CpatternEvent{
foreach ($this->field_val_list as $k=>$v){
$cur_field_val_list[$k]=array(
'value'=>(is_array($v['values'][$cur_url_md5])?$v['values'][$cur_url_md5][$v_k]:$v['values'][$cur_url_md5]),
- 'img'=>((is_array($v['imgs'][$cur_url_md5])&&is_array($v['imgs'][$cur_url_md5][$v_k]))?$v['imgs'][$cur_url_md5][$v_k]:$v['imgs'][$cur_url_md5])
+ 'img'=>((is_array($v['imgs'][$cur_url_md5])&&is_array($v['imgs'][$cur_url_md5][$v_k]))?$v['imgs'][$cur_url_md5][$v_k]:$v['imgs'][$cur_url_md5]),
+ 'file'=>((is_array($v['files'][$cur_url_md5])&&is_array($v['files'][$cur_url_md5][$v_k]))?$v['files'][$cur_url_md5][$v_k]:$v['files'][$cur_url_md5])
);
}
$val[$v_k]=$this->field_module_merge($field_params,$cur_field_val_list);
@@ -1149,6 +1192,18 @@ class Cpattern extends CpatternEvent{
foreach ($vals as $v_k=>$val){
$loopIndex=$is_loop?$v_k:-1;
+ $this->field_url_complete=true;
+ $this->field_down_img=true;
+
+ if($is_loop){
+
+ if(!isset($this->field_val_list[$field_name]['values'][$cur_url_md5])){
+ $this->field_val_list[$field_name]['values'][$cur_url_md5]=array();
+ $this->field_val_list[$field_name]['imgs'][$cur_url_md5]=array();
+ $this->field_val_list[$field_name]['files'][$cur_url_md5]=array();
+ }
+ }
+
if(!empty($field_process)){
$val=$this->process_field($field_name,$val,$field_process,$cur_url_md5,$loopIndex,$cont_url_md5);
@@ -1165,6 +1220,7 @@ class Cpattern extends CpatternEvent{
unset($this->field_val_list[$f_k]['values'][$cur_url_md5]);
unset($this->field_val_list[$f_k]['imgs'][$cur_url_md5]);
+ unset($this->field_val_list[$f_k]['files'][$cur_url_md5]);
}
return;
}else{
@@ -1177,6 +1233,7 @@ class Cpattern extends CpatternEvent{
unset($this->field_val_list[$f_k]['values'][$cur_url_md5]);
unset($this->field_val_list[$f_k]['imgs'][$cur_url_md5]);
+ unset($this->field_val_list[$f_k]['files'][$cur_url_md5]);
}
return;
}else{
@@ -1191,6 +1248,10 @@ class Cpattern extends CpatternEvent{
unset($this->field_val_list[$f_k]['imgs'][$cur_url_md5][$v_k]);
}
+ if(is_array($this->field_val_list[$f_k]['files'][$cur_url_md5])){
+
+ unset($this->field_val_list[$f_k]['files'][$cur_url_md5][$v_k]);
+ }
}
continue;
}
@@ -1198,29 +1259,32 @@ class Cpattern extends CpatternEvent{
}
}
-
- $val=preg_replace_callback('/(\bhref\s*=\s*[\'\"])([^\'\"]*)([\'\"])/i',function($matche) use ($url_info){
-
- $matche[2]=\util\Tools::create_complete_url($matche[2], $url_info);
- return $matche[1].$matche[2].$matche[3];
- },$val);
- $val=preg_replace_callback('/(\bsrc\s*=\s*[\'\"])([^\'\"]*)([\'\"])/i',function($matche) use ($url_info){
- $matche[2]=\util\Tools::create_complete_url($matche[2], $url_info);
- return $matche[1].$matche[2].$matche[3];
- },$val);
+ if($this->field_url_complete){
+
+ $val=preg_replace_callback('/(\bhref\s*=\s*[\'\"])([^\'\"]*)([\'\"])/i',function($matche) use ($url_info){
+
+ $matche[2]=\util\Tools::create_complete_url($matche[2], $url_info);
+ return $matche[1].$matche[2].$matche[3];
+ },$val);
+ $val=preg_replace_callback('/(\bsrc\s*=\s*[\'\"])([^\'\"]*)([\'\"])/i',function($matche) use ($url_info){
+ $matche[2]=\util\Tools::create_complete_url($matche[2], $url_info);
+ return $matche[1].$matche[2].$matche[3];
+ },$val);
+ }
if($is_loop){
if(!isset($this->field_val_list[$field_name]['values'][$cur_url_md5])){
$this->field_val_list[$field_name]['values'][$cur_url_md5]=array();
$this->field_val_list[$field_name]['imgs'][$cur_url_md5]=array();
+ $this->field_val_list[$field_name]['files'][$cur_url_md5]=array();
}
$this->field_val_list[$field_name]['values'][$cur_url_md5][$v_k]=$val;
}else{
$this->field_val_list[$field_name]['values'][$cur_url_md5]=$val;
}
- if(!is_empty(g_sc_c('download_img','download_img'))&&!empty($val)){
+ if(!is_empty(g_sc_c('download_img','download_img'))&&!empty($val)&&$this->field_down_img){
$valImgs=array();
if(preg_match_all('/
]*\bsrc\s*=\s*[\'\"](\w+\:[^\'\"]+?)[\'\"]/i',$val,$imgUrls)){
@@ -1231,30 +1295,23 @@ class Cpattern extends CpatternEvent{
$valImgs=array_merge($valImgs,array($val));
}
-
- $noImgVal=preg_replace_callback('/\{\[img\]\}(http[s]{0,1}\:\/\/[^\s]+?)\{\[\/img\]\}/i',function($matche) use (&$valImgs){
- $valImgs[]=$matche[1];
- return $matche[1];
- },$val);
-
- if($noImgVal!=$val){
-
+ if(!empty($valImgs)){
+ $fieldImgs=array();
if($is_loop){
- $this->field_val_list[$field_name]['values'][$cur_url_md5][$v_k]=$noImgVal;
+
+ $fieldImgs=$this->field_val_list[$field_name]['imgs'][$cur_url_md5][$v_k];
}else{
- $this->field_val_list[$field_name]['values'][$cur_url_md5]=$noImgVal;
+
+ $fieldImgs=$this->field_val_list[$field_name]['imgs'][$cur_url_md5];
}
- }
-
- if(!empty($valImgs)){
- $valImgs=array_unique($valImgs);
- $valImgs=array_values($valImgs);
+ init_array($fieldImgs);
+ $fieldImgs=array_merge($fieldImgs,$valImgs);
+ $fieldImgs=array_unique($fieldImgs);
+ $fieldImgs=array_values($fieldImgs);
if($is_loop){
-
- $this->field_val_list[$field_name]['imgs'][$cur_url_md5][$v_k]=$valImgs;
+ $this->field_val_list[$field_name]['imgs'][$cur_url_md5][$v_k]=$fieldImgs;
}else{
-
- $this->field_val_list[$field_name]['imgs'][$cur_url_md5]=$valImgs;
+ $this->field_val_list[$field_name]['imgs'][$cur_url_md5]=$fieldImgs;
}
}
}
@@ -1510,7 +1567,26 @@ class Cpattern extends CpatternEvent{
$val_imgs=array_values($val_imgs);
}
}
- $val_list[$fieldName]=array('name'=>$fieldName,'value'=>$val_values,'img'=>$val_imgs);
+
+ $val_files=array();
+ if(!empty($fieldVal['files'])){
+ foreach ($fieldVal['files'] as $v){
+ if(!empty($v)){
+ if(is_array($v)){
+ $val_files=array_merge($val_files,$v);
+ }else{
+ $val_files[]=$v;
+ }
+ }
+ }
+ if(!empty($val_files)){
+ $val_files=array_unique($val_files);
+ $val_files=array_filter($val_files);
+ $val_files=array_values($val_files);
+ }
+ }
+
+ $val_list[$fieldName]=array('name'=>$fieldName,'value'=>$val_values,'img'=>$val_imgs,'file'=>$val_files);
}
}else{
@@ -1529,17 +1605,24 @@ class Cpattern extends CpatternEvent{
$val_values=$fieldVals['values'][$page_key][$loop_index];
$val_imgs=$fieldVals['imgs'][$page_key][$loop_index];
+ $val_files=$fieldVals['files'][$page_key][$loop_index];
}else{
$val_values=$fieldVals['values'][$page_key];
$val_imgs=$fieldVals['imgs'][$page_key];
+ $val_files=$fieldVals['files'][$page_key];
}
if(!empty($val_imgs)){
$val_imgs=array_unique($val_imgs);
$val_imgs=array_filter($val_imgs);
$val_imgs=array_values($val_imgs);
}
- $vals[$fieldName]=array('name'=>$fieldName,'value'=>$val_values,'img'=>$val_imgs);
+ if(!empty($val_files)){
+ $val_files=array_unique($val_files);
+ $val_files=array_filter($val_files);
+ $val_files=array_values($val_files);
+ }
+ $vals[$fieldName]=array('name'=>$fieldName,'value'=>$val_values,'img'=>$val_imgs,'file'=>$val_files);
}
$val_list[]=$vals;
}
@@ -1555,6 +1638,9 @@ class Cpattern extends CpatternEvent{
foreach ($processList as $k=>$v){
if('replace'==$v['module']){
$v['replace_from']=$this->correct_reg_pattern($v['replace_from']);
+ }elseif('download'==$v['module']){
+ $v['download_file_must']=$this->correct_reg_pattern($v['download_file_must']);
+ $v['download_file_ban']=$this->correct_reg_pattern($v['download_file_ban']);
}
$processList[$k]=$v;
}
diff --git a/vendor/skycaiji/app/admin/event/CpatternBase.php b/vendor/skycaiji/app/admin/event/CpatternBase.php
index f1661fe..42a680e 100644
--- a/vendor/skycaiji/app/admin/event/CpatternBase.php
+++ b/vendor/skycaiji/app/admin/event/CpatternBase.php
@@ -18,6 +18,7 @@ class CpatternBase extends CollectBase{
public function init($config){}
public function collect($num=10){}
+
/*正则规则匹配数据*/
public function rule_module_rule_data($configParams,$html,$parentMatches=array(),$whole=false,$returnMatch=false){
$val=null;
@@ -125,6 +126,22 @@ class CpatternBase extends CollectBase{
return $val;
}
}
+ public function rule_module_rule_data_get($configParams,$html,$parentMatches=array(),$whole=false,$returnMatch=false){
+
+ init_array($configParams);
+ $rule=$this->convert_sign_match($configParams['rule']);
+ $rule=$this->correct_reg_pattern($rule);
+
+ $ruleMerge=$this->set_merge_default($rule, $configParams['rule_merge']);
+ if(empty($ruleMerge)){
+
+ $ruleMerge=cp_sign('match');
+ }
+ $configParams['rule']=$rule;
+ $configParams['rule_merge']=$ruleMerge;
+
+ return $this->rule_module_rule_data($configParams,$html,$parentMatches,$whole,$returnMatch);
+ }
/*拼接替换标签*/
public function merge_match_signs($matches,$merge){
if(!is_array($matches)){
@@ -160,6 +177,7 @@ class CpatternBase extends CollectBase{
public function rule_module_xpath_data($configParams,$html){
$vals='';
if(!empty($configParams['xpath'])){
+ $html=$this->filter_html_tags($html,array('script'));
$dom=new \DOMDocument;
$libxml_previous_state = libxml_use_internal_errors(true);
@$dom->loadHTML('
'.$html);
@@ -297,7 +315,7 @@ class CpatternBase extends CollectBase{
}else{
if($key!='*'){
- $val=$val[$key];
+ $val=is_array($val)?$val[$key]:'';
}
}
$prevKey=$key;
@@ -456,8 +474,12 @@ class CpatternBase extends CollectBase{
}
/*修正规则中的正则表达式*/
public function correct_reg_pattern($str){
- $str=preg_replace('/\\\*([\'\/])/', "\\\\$1",$str);
- $str=$this->convert_sign_wildcard($str);
+ if(isset($str)){
+ $str=preg_replace('/\\\*([\'\/])/', "\\\\$1",$str);
+ $str=$this->convert_sign_wildcard($str);
+ }else{
+ $str='';
+ }
return $str;
}
/*转换(*)通配符*/
@@ -543,7 +565,7 @@ class CpatternBase extends CollectBase{
/*保存数据处理时过滤配置参数*/
public function set_process($processList){
if(is_array($processList)){
- $processList=\util\Funcs::array_array_map('trim',$processList);
+ $processList=trim_input_process(null,$processList);
foreach ($processList as $k=>$v){
init_array($v);
$v['module']=strtolower($v['module']);
@@ -573,6 +595,8 @@ class CpatternBase extends CollectBase{
}elseif('if'==$v['module']){
init_array($v['if_addon']);
\util\Funcs::filter_key_val_list5($v['if_cond'],$v['if_logic'],$v['if_val'],$v['if_addon']['func'],$v['if_addon']['turn']);
+ }elseif('download'==$v['module']){
+ $v['download_file_tag']=\skycaiji\admin\model\Config::process_tag_attr($v['download_file_tag']);
}
$processList[$k]=$v;
}
diff --git a/vendor/skycaiji/app/admin/event/CpatternColl.php b/vendor/skycaiji/app/admin/event/CpatternColl.php
index 26d412e..45e2f3d 100644
--- a/vendor/skycaiji/app/admin/event/CpatternColl.php
+++ b/vendor/skycaiji/app/admin/event/CpatternColl.php
@@ -40,22 +40,28 @@ class CpatternColl extends CpatternBase{
public $show_opened_tools=false;
protected $cache_page_htmls=array();
protected $cache_page_urls=array();
-
+ protected $field_url_complete=true;
+ protected $field_down_img=true;
/*对象销毁时处理*/
public function __destruct(){
+
+ $usedContUrls=array();
if(!empty($this->used_cont_urls)){
-
$usedContUrls=array_keys($this->used_cont_urls);
- if(!empty($usedContUrls)&&is_array($usedContUrls)){
- $total=count($usedContUrls);
- $limit=100;
- $batch=ceil($total/$limit);
- for($i=1;$i<=$batch;$i++){
-
- $list=array_slice($usedContUrls,($i-1)*$limit,$limit);
- if(!empty($list)){
- CacheModel::getInstance('cont_url')->deleteCache($list);
- }
+ init_array($usedContUrls);
+ }
+ if($this->cur_cont_url){
+ $usedContUrls[]=md5($this->cur_cont_url);
+ }
+ if(!empty($usedContUrls)){
+ $total=count($usedContUrls);
+ $limit=100;
+ $batch=ceil($total/$limit);
+ for($i=1;$i<=$batch;$i++){
+
+ $list=array_slice($usedContUrls,($i-1)*$limit,$limit);
+ if(!empty($list)){
+ CacheModel::getInstance('cont_url')->deleteCache($list);
}
}
}
@@ -246,6 +252,16 @@ class CpatternColl extends CpatternBase{
$doBan=true;
}
+ $urlCharset='';
+ if(!empty($this->config['url_encode'])){
+
+ $urlWebConfig=$this->get_page_config($pageType,$pageName,'url_web');
+ $urlCharset=$this->page_url_web_charset($urlWebConfig);
+ if(empty($urlCharset)||in_array($urlCharset,array('auto','utf-8','utf8'))){
+ $urlCharset='';
+ }
+ }
+
$urlMatchesMd5s=array();
@@ -291,6 +307,22 @@ class CpatternColl extends CpatternBase{
$doDelete=true;
}
+
+ if(!$doDelete&&!empty($this->config['url_encode'])){
+
+ $contUrl=preg_replace_callback('/[^\x21-\x7E]+/',function($mstr)use($urlCharset){
+
+ $mstr=$mstr[0];
+ if(!empty($urlCharset)){
+
+ $mstr=\util\Funcs::convert_charset($mstr,'utf-8',$urlCharset);
+ }
+ $mstr=rawurlencode($mstr);
+ return $mstr;
+ },$contUrl);
+ $cont_urls[$k]=$contUrl;
+ }
+
if(!$doDelete&&strpos($contUrl,' ')!==false){
$doDelete=true;
@@ -1170,7 +1202,6 @@ class CpatternColl extends CpatternBase{
}
-
/*获取页面代码*/
public function get_page_html($url,$pageType,$pageName,$isPagination=false,$returnInfo=false){
$pageName=$pageName?$pageName:'';
@@ -1184,7 +1215,7 @@ class CpatternColl extends CpatternBase{
if(!empty($pageSource)){
- $useCookie=\util\Param::get_gsc_use_cookie(false,true);
+ $useCookie=\util\Param::get_gsc_use_cookie('',true);
if($openUrlWeb){
$headers=$this->arrays_to_key_val($urlWebConfig['header_names'], $urlWebConfig['header_vals']);
@@ -1522,14 +1553,9 @@ class CpatternColl extends CpatternBase{
}
}else{
$options['curlopts']=$otherConfig['curlopts'];
-
init_array($options['curlopts']);
- $confMaxRedirs=g_sc_c('caiji','max_redirs');
- $confMaxRedirs=intval($confMaxRedirs);
- if($confMaxRedirs>0){
-
- $options['curlopts'][CURLOPT_MAXREDIRS]=$confMaxRedirs;
- }
+
+ $options['max_redirs']=g_sc_c('caiji','max_redirs');
$htmlInfo=get_html($url,$headers,$options,$charset,$postData,true);
}
init_array($htmlInfo);
diff --git a/vendor/skycaiji/app/admin/event/CpatternEvent.php b/vendor/skycaiji/app/admin/event/CpatternEvent.php
index aae0a2b..07966a5 100644
--- a/vendor/skycaiji/app/admin/event/CpatternEvent.php
+++ b/vendor/skycaiji/app/admin/event/CpatternEvent.php
@@ -378,6 +378,7 @@ class CpatternEvent extends CpatternColl{
return $fieldVal;
}
public function process_f_replace($fieldVal,$params){
+
return preg_replace('/'.$params['replace_from'].'/ui',$params['replace_to'], $fieldVal);
}
public function process_f_tool($fieldVal,$params){
@@ -391,11 +392,107 @@ class CpatternEvent extends CpatternColl{
$fieldVal=trim($fieldVal);
}
- if(in_array('is_img', $params['tool_list'])){
+ if(in_array('url_not_complete', $params['tool_list'])){
+
+ $this->field_url_complete=false;
+ }
+ return $fieldVal;
+ }
+ public function process_f_download($fieldVal,$params,$curUrlMd5,$loopIndex,$contUrlMd5,$fieldName=''){
+ if($params['download_op']=='is_img'){
+
+ if(!is_empty(g_sc_c('download_img','download_img'))&&!empty($fieldVal)){
+
+ $valImgs=array();
+ if(preg_match_all('/(?]+)(?![\'\"])/i',$fieldVal,$murls)){
+ $valImgs=$murls[1];
+ }
+ if(!empty($valImgs)){
+ $fieldImgs=array();
+ if(empty($this->first_loop_field)){
+
+ $fieldImgs=$this->field_val_list[$fieldName]['imgs'][$curUrlMd5];
+ }else{
+ $fieldImgs=$this->field_val_list[$fieldName]['imgs'][$curUrlMd5][$loopIndex];
+ }
+ init_array($fieldImgs);
+ $fieldImgs=array_merge($fieldImgs,$valImgs);
+ $fieldImgs=array_unique($fieldImgs);
+ $fieldImgs=array_values($fieldImgs);
+ if(empty($this->first_loop_field)){
+ $this->field_val_list[$fieldName]['imgs'][$curUrlMd5]=$fieldImgs;
+ }else{
+ $this->field_val_list[$fieldName]['imgs'][$curUrlMd5][$loopIndex]=$fieldImgs;
+ }
+ }
+ }
+ }elseif($params['download_op']=='no_img'){
+
+ $this->field_down_img=false;
- if(!is_empty(g_sc_c('download_img','download_img'))){
+ if(empty($this->first_loop_field)){
+ $this->field_val_list[$fieldName]['imgs'][$curUrlMd5]=array();
+ }else{
+ $this->field_val_list[$fieldName]['imgs'][$curUrlMd5][$loopIndex]=array();
+ }
+ }elseif($params['download_op']=='is_file'||$params['download_op']=='file'){
+
+ if(!is_empty(g_sc_c('download_file','download_file'))&&!empty($fieldVal)){
- $fieldVal=preg_replace('/(?]+)(?![\'\"])/i','{[img]}'."$1".'{[/img]}',$fieldVal);
+ $valFiles=array();
+ if($params['download_op']=='is_file'){
+
+ if(preg_match_all('/(?]+)(?![\'\"])/i',$fieldVal,$murls)){
+ $valFiles=$murls[1];
+ }
+ }else{
+
+ $tags=\skycaiji\admin\model\Config::process_tag_attr($params['download_file_tag'],true);
+ if(is_array($tags)&&!empty($tags[0])){
+
+ for($i=0;$i
]*\b'.$tags[2][$i].'\s*=\s*[\'\"](http[s]{0,1}\:[^\'\"]+?)[\'\"]/i';
+ if(preg_match_all($reg,$fieldVal,$fileUrls)){
+ $fileUrls=is_array($fileUrls[1])?$fileUrls[1]:array();
+ if(!empty($params['download_file_must'])){
+
+ foreach ($fileUrls as $k=>$v){
+ if(!preg_match('/'.$params['download_file_must'].'/ui', $v)){
+ unset($fileUrls[$k]);
+ }
+ }
+ }
+ if(!empty($params['download_file_ban'])){
+
+ foreach ($fileUrls as $k=>$v){
+ if(preg_match('/'.$params['download_file_ban'].'/ui', $v)){
+ unset($fileUrls[$k]);
+ }
+ }
+ }
+ $valFiles=array_merge($valFiles,$fileUrls);
+ }
+ }
+ }
+ }
+ if(!empty($valFiles)){
+ $fieldFiles=array();
+ if(empty($this->first_loop_field)){
+
+ $fieldFiles=$this->field_val_list[$fieldName]['files'][$curUrlMd5];
+ }else{
+ $fieldFiles=$this->field_val_list[$fieldName]['files'][$curUrlMd5][$loopIndex];
+ }
+ init_array($fieldFiles);
+ $fieldFiles=array_merge($fieldFiles,$valFiles);
+ $fieldFiles=array_unique($fieldFiles);
+ $fieldFiles=array_values($fieldFiles);
+ if(empty($this->first_loop_field)){
+ $this->field_val_list[$fieldName]['files'][$curUrlMd5]=$fieldFiles;
+ }else{
+ $this->field_val_list[$fieldName]['files'][$curUrlMd5][$loopIndex]=$fieldFiles;
+ }
+ }
}
}
return $fieldVal;
@@ -839,7 +936,32 @@ class CpatternEvent extends CpatternColl{
if(!empty($htmlInfo['ok'])){
$retryCur=0;
- $fieldVal=$this->rule_module_json_data(array('json'=>$params['api_json'],'json_arr'=>$params['api_json_arr'],'json_arr_implode'=>$params['api_json_implode']),$htmlInfo['html']);
+
+ if(empty($params['api_rule_module'])){
+
+ $fieldVal=$this->rule_module_json_data(array(
+ 'json' => $params['api_json'],
+ 'json_arr' => $params['api_json_arr'],
+ 'json_arr_implode' => $params['api_json_arr_implode']
+ ),$htmlInfo['html']);
+ }elseif('xpath'==$params['api_rule_module']){
+
+ $fieldVal=$this->rule_module_xpath_data(array(
+ 'xpath' => $params['api_xpath'],
+ 'xpath_attr' => $params['api_xpath_attr'],
+ 'xpath_multi' => $params['api_xpath_multi'],
+ 'xpath_multi_str' => $params['api_xpath_multi_str'],
+ ),$htmlInfo['html']);
+ }elseif('rule'==$params['api_rule_module']){
+
+ $fieldVal=$this->rule_module_rule_data_get(array(
+ 'rule' => $params['api_rule'],
+ 'rule_merge' => $params['api_rule_merge'],
+ 'rule_multi' => $params['api_rule_multi'],
+ 'rule_multi_str' => $params['api_rule_multi_str'],
+ 'rule_flags'=>'iu',
+ ),$htmlInfo['html'],array(),true);
+ }
}else{
$this->retry_first_echo($retryCur,'数据处理»调用接口失败',$url,$htmlInfo);
@@ -858,7 +980,7 @@ class CpatternEvent extends CpatternColl{
if(empty($process)){
return $fieldVal;
}
- static $conds=array('filter','if','func','api');
+ static $conds=array('filter','if','func','api','download');
foreach ($process as $params){
if(empty($this->first_loop_field)){
@@ -989,6 +1111,7 @@ class CpatternEvent extends CpatternColl{
}
}
+
private function _get_insert_fields($paramsStr,$curUrlMd5,$loopIndex){
$fieldRule='/\[\x{5b57}\x{6bb5}\:(.+?)\]/u';
$fields=array();
diff --git a/vendor/skycaiji/app/admin/event/Rcms.php b/vendor/skycaiji/app/admin/event/Rcms.php
index a373c58..573da80 100644
--- a/vendor/skycaiji/app/admin/event/Rcms.php
+++ b/vendor/skycaiji/app/admin/event/Rcms.php
@@ -71,7 +71,7 @@ class Rcms extends Release{
$addedNum=0;
foreach ($collFieldsList as $collFieldsKey=>$collFields){
- $this->init_download_img($this->task,$collFields['fields']);
+ $this->init_download_config($this->task,$collFields['fields']);
$return=$releCms->runExport($collFields['fields']);
if($return['id']>0){
$addedNum++;
diff --git a/vendor/skycaiji/app/admin/event/Rdb.php b/vendor/skycaiji/app/admin/event/Rdb.php
index 0b56b52..f7f08a1 100644
--- a/vendor/skycaiji/app/admin/event/Rdb.php
+++ b/vendor/skycaiji/app/admin/event/Rdb.php
@@ -111,7 +111,7 @@ class Rdb extends Release{
$contTitle=$collFields['title'];
$contUrl=$collFields['url'];
$collFields=$collFields['fields'];
- $this->init_download_img($this->task,$collFields);
+ $this->init_download_config($this->task,$collFields);
$dbTables=$this->config['db_tables'];
$errorMsg=false;
diff --git a/vendor/skycaiji/app/admin/event/Rdiy.php b/vendor/skycaiji/app/admin/event/Rdiy.php
index e7d813b..257bd4f 100644
--- a/vendor/skycaiji/app/admin/event/Rdiy.php
+++ b/vendor/skycaiji/app/admin/event/Rdiy.php
@@ -81,7 +81,7 @@ class Rdiy extends Release{
$releDiy->db()->startTrans();
$errorMsg=false;
$contUrl=$collFields['url'];
- $this->init_download_img($this->task,$collFields['fields']);
+ $this->init_download_config($this->task,$collFields['fields']);
try {
$return=$releDiy->runExport($contUrl,$collFields['fields']);
if(empty($return)){
diff --git a/vendor/skycaiji/app/admin/event/ReleaseBase.php b/vendor/skycaiji/app/admin/event/ReleaseBase.php
index 7f3581e..4fb33f9 100644
--- a/vendor/skycaiji/app/admin/event/ReleaseBase.php
+++ b/vendor/skycaiji/app/admin/event/ReleaseBase.php
@@ -55,12 +55,12 @@ class ReleaseBase extends CollectBase{
'target' => '',
'desc'=>'',
'error' => $returnData['error'],
- 'task_id' => $release ['task_id'],
+ 'task_id' => $release['task_id'],
'release' => $release['module'],
'addtime'=>time()
));
}
- $this->echo_msg(array('%s',$returnData['error']),'red',$echo);
+ $this->echo_msg(array('发布失败:%s',$returnData['error']),'red',$echo);
}
}
@@ -106,8 +106,37 @@ class ReleaseBase extends CollectBase{
}
}
}
+ if(!is_empty(g_sc_c('download_file','download_file'))){
+
+ if(!empty($collFieldVal['file'])){
+
+ if(!is_array($collFieldVal['file'])){
+
+ $collFieldVal['file']=array($collFieldVal['file']);
+ }
+ $total=count($collFieldVal['file']);
+ if($total>0){
+ $this->echo_msg(array('正在下载:%s » %s个文件',$collFieldVal['name'],$total),'black');
+ }
+ $curI=0;
+ foreach ($collFieldVal['file'] as $fileUrl){
+ $this->collect_stopped(g_sc('collect_task_id'));
+ $newFileUrl=$this->download_file($fileUrl);
+ if($newFileUrl!=$fileUrl){
+
+ $val=str_replace($fileUrl, $newFileUrl, $val);
+ }
+ $curI++;
+ if($curI<$total){
+
+ $this->collect_sleep(g_sc_c('download_file','file_interval'),true);
+ }
+ }
+ }
+ }
return $val;
}
+
/*下载图片*/
private $cache_img_list=array();
public function download_img($url){
@@ -115,12 +144,9 @@ class ReleaseBase extends CollectBase{
static $imgPaths=array();
static $imgUrls=array();
+ $originalUrl=$url;
+
$retryMax=intval(g_sc_c('download_img','retry'));
- $retryParams=null;
- if($retryMax>0){
-
- $retryParams=array(0=>$url);
- }
$img_path=g_sc_c('download_img','img_path');
$img_url=g_sc_c('download_img','img_url');
@@ -193,7 +219,7 @@ class ReleaseBase extends CollectBase{
static $imgSuffixes=null;
if(!isset($imgSuffixes)){
- $imgSuffixes=array('jpg','jpeg','gif','png','bmp');
+ $imgSuffixes=array('jpg','jpeg','gif','png','bmp','webp','wbmp');
$moreSuffix=g_sc_c('download_img','more_suffix');
if(!empty($moreSuffix)){
$moreSuffix=explode(',', $moreSuffix);
@@ -217,11 +243,7 @@ class ReleaseBase extends CollectBase{
}
}else{
- if(preg_match('/\.([a-zA-Z][\w\-]+)([\?\#]|$)/',$url,$prop)){
- $prop=strtolower($prop[1]);
- }else{
- $prop='';
- }
+ $prop=\util\Funcs::get_url_suffix($url);
}
if(!in_array($prop, $imgSuffixes)){
@@ -243,7 +265,7 @@ class ReleaseBase extends CollectBase{
$imgname=substr($key,0,2).'/'.substr($key,-2,2).'/'.$key.'.'.$prop;
$filename=$img_path.$imgname;
- $filename=$this->_convert_img_charset($filename);
+ $filename=$this->_convert_file_charset($filename,true);
$isExists=file_exists($filename);
if(!$isExists){
@@ -251,7 +273,7 @@ class ReleaseBase extends CollectBase{
$imgname=substr($key,0,2).'/'.substr($key,2).'.'.$prop;
$filename=$img_path.$imgname;
- $filename=$this->_convert_img_charset($filename);
+ $filename=$this->_convert_file_charset($filename,true);
$isExists=file_exists($filename);
}
}elseif('custom'==$imgname){
@@ -268,13 +290,13 @@ class ReleaseBase extends CollectBase{
$customName=model('Config')->convert_img_name_name($customName,$url);
$imgname=$customPath.'/'.$customName.'.'.$prop;
$filename=$img_path.$imgname;
- $filename=$this->_convert_img_charset($filename);
+ $filename=$this->_convert_file_charset($filename,true);
$isExists=file_exists($filename);
}else{
$imgname=date('Y-m-d',time()).'/'.$key.'.'.$prop;
$filename=$img_path.$imgname;
- $filename=$this->_convert_img_charset($filename);
+ $filename=$this->_convert_file_charset($filename,true);
$isExists=file_exists($filename);
}
$imgurl=$img_url.$imgname;
@@ -292,7 +314,7 @@ class ReleaseBase extends CollectBase{
try {
$headers=array();
- $useCookieImg=\util\Param::get_gsc_use_cookie(true,true);
+ $useCookieImg=\util\Param::get_gsc_use_cookie('img',true);
if(!is_empty(g_sc('task_img_headers'))){
$headers=g_sc('task_img_headers');
@@ -309,6 +331,8 @@ class ReleaseBase extends CollectBase{
if(!is_empty(g_sc_c('download_img','img_timeout'))){
$options['timeout']=g_sc_c('download_img','img_timeout');
+ }else{
+ $options['timeout']=300;
}
if(!is_empty(g_sc_c('download_img','img_max'))){
@@ -334,7 +358,6 @@ class ReleaseBase extends CollectBase{
$imgname.='.'.$mImgProp;
$imgurl.='.'.$mImgProp;
$filename.='.'.$mImgProp;
-
if(file_exists($filename)){
$isExists=true;
@@ -347,6 +370,59 @@ class ReleaseBase extends CollectBase{
if(!$isExists){
if(write_dir_file($filename,$imgCodeInfo['html'])){
$this->cache_img_list[$key]=$imgurl;
+ $imgCodeInfo=null;
+ if(!is_empty(g_sc_c('download_img','img_watermark'))){
+
+ $imgWmLogo=g_sc_c('download_img','img_wm_logo');
+ if($imgWmLogo){
+
+ $imgWmLogo=config('root_path').$imgWmLogo;
+ if(file_exists($imgWmLogo)){
+ $imgInfoWm=getimagesize($imgWmLogo);
+ $imgInfoImg=getimagesize($filename);
+ $imgPropWm=str_replace('image/','',strtolower($imgInfoWm['mime']?:''));
+ $imgPropImg=str_replace('image/','',strtolower($imgInfoImg['mime']?:''));
+ $imgPropWm=$imgPropWm=='jpg'?'jpeg':$imgPropWm;
+ $imgPropImg=$imgPropImg=='jpg'?'jpeg':$imgPropImg;
+ if($imgPropWm&&$imgPropImg){
+
+ $funcImage='image'.$imgPropImg;
+ if(function_exists('imagecreatefromstring')){
+ if(function_exists($funcImage)){
+
+ $icfWm=imagecreatefromstring(file_get_contents($imgWmLogo));
+ $icfImg=imagecreatefromstring(file_get_contents($filename));
+
+ $cWmRight=intval(g_sc_c('download_img','img_wm_right'));
+ $cWmBottom=intval(g_sc_c('download_img','img_wm_bottom'));
+ $cWmOpacity=intval(g_sc_c('download_img','img_wm_opacity'));
+ $cWmOpacity=min(100,max(0,$cWmOpacity));
+
+ $cWmRight=$imgInfoImg[0]-$imgInfoWm[0]-$cWmRight;
+ $cWmBottom=$imgInfoImg[1]-$imgInfoWm[1]-$cWmBottom;
+
+ if($cWmOpacity>0){
+ imagecopymerge($icfImg,$icfWm,$cWmRight,$cWmBottom,0,0,$imgInfoWm[0],$imgInfoWm[1],100-$cWmOpacity);
+ }else{
+
+ imagecopy($icfImg,$icfWm,$cWmRight,$cWmBottom,0,0,$imgInfoWm[0],$imgInfoWm[1]);
+ }
+ call_user_func($funcImage,$icfImg,$filename);
+ imagedestroy($icfWm);
+ imagedestroy($icfImg);
+ }else{
+ $this->echo_msg('添加水印失败,不存在函数:'.$funcImage);
+ }
+ }else{
+ $this->echo_msg('添加水印失败,不存在函数:imagecreatefromstring');
+ }
+ }
+ }else{
+ $this->echo_msg('不存在水印logo:'.$imgWmLogo);
+ }
+ }
+ }
+
$funcName=g_sc_c('download_img','img_func');
if(!empty($funcName)){
@@ -375,25 +451,7 @@ class ReleaseBase extends CollectBase{
}
}else{
- if(!empty($proxyDbIp)){
- $this->echo_msg(array('代理IP:%s',$proxyDbIp['ip']),'black',true,'','display:inline;margin-right:5px;');
- }
-
- $this->retry_first_echo($retryCur,'图片下载失败',$url,$imgCodeInfo);
-
-
- if(!empty($proxyDbIp)){
- if($imgCodeInfo['code']!=404){
-
- $mproxy->set_ip_failed($proxyDbIp);
- }
- }
-
- $this->collect_sleep(g_sc_c('download_img','wait'));
-
- if($this->retry_do_func($retryCur,$retryMax,'图片无效')){
- return $this->download_img($retryParams[0]);
- }
+ return $this->_down_retry($proxyDbIp, $originalUrl, $retryCur, $retryMax, $imgCodeInfo, true);
}
}catch (\Exception $ex){
@@ -406,15 +464,244 @@ class ReleaseBase extends CollectBase{
}
return empty($this->cache_img_list[$key])?$url:$this->cache_img_list[$key];
}
+ /*下载文件*/
+ private $cache_file_list=array();
+ public function download_file($url){
+ static $retryCur=0;
+ static $filePaths=array();
+ static $fileUrls=array();
+
+ $originalUrl=$url;
+
+ $retryMax=intval(g_sc_c('download_file','retry'));
+
+ $file_path=g_sc_c('download_file','file_path');
+ $file_url=g_sc_c('download_file','file_url');
+
+ if(!isset($filePaths[$file_path])){
+ if(empty($file_path)){
+
+ $filePaths[$file_path]=config('root_path').'/data/files/';
+ }else{
+
+ $filePaths[$file_path]=rtrim($file_path,'\/\\').'/';
+ }
+ }
+ $file_path=$filePaths[$file_path];
+
+ if(!isset($fileUrls[$file_url])){
+ if(empty($file_url)){
+
+ $fileUrls[$file_url]=config('root_website').'/data/files/';
+ }else{
+
+ $fileUrls[$file_url]=rtrim($file_url,'\/\\').'/';
+ }
+ }
+ $file_url=$fileUrls[$file_url];
+
+ if(empty($url)){
+ return '';
+ }
+
+ $mproxy=model('ProxyIp');
+ $options=array();
+ $proxyDbIp=null;
+ if(!is_empty(g_sc_c('proxy','open'))){
+
+ $proxyDbIp=$mproxy->get_usable_ip();
+ $proxyIp=$mproxy->to_proxy_ip($proxyDbIp);
+ if(empty($proxyIp)){
+
+ $this->echo_msg(array('没有可用的代理IP,跳过下载文件',$url));
+ return $url;
+ }else{
+
+ $options['proxy']=$proxyIp;
+ }
+ }
+
+
+ if(!is_empty(g_sc_c('caiji','robots'))){
+
+ if(!$this->abide_by_robots($url,$options)){
+ $this->echo_msg(array('robots拒绝访问的网址:%s',$url));
+ return $url;
+ }
+ }
+
+ $key=md5($url);
+ if(!isset($this->cache_file_list[$key])){
+ $headers=array();
+ $useCookieFile=\util\Param::get_gsc_use_cookie('file',true);
+ if(!is_empty(g_sc('task_file_headers'))){
+
+ $headers=g_sc('task_file_headers');
+ if(!is_array($headers)){
+ $headers=array();
+ }
+ }
+ if(!empty($useCookieFile)){
+
+ unset($headers['cookie']);
+ $headers['cookie']=$useCookieFile;
+ }
+
+ if(!is_empty(g_sc_c('download_file','file_timeout'))){
+
+ $options['timeout']=g_sc_c('download_file','file_timeout');
+ }else{
+ $options['timeout']=1800;
+ }
+ if(!is_empty(g_sc_c('download_file','file_max'))){
+
+ $options['max_bytes']=intval(g_sc_c('download_file','file_max'))*1024*1024;
+ }
+
+ $prop=\util\Funcs::get_url_suffix($url);
+
+ static $urlProps=array('htm','html','php','asp','jsp');
+ if(in_array($prop, $urlProps)||empty($prop)){
+
+ $options['return_info']=true;
+ $options['return_head']=true;
+ $fileCodeInfo=get_html($url,$headers,$options,'utf-8',null,true);
+ if(!empty($fileCodeInfo['ok'])){
+ unset($options['max_bytes']);
+ if($fileCodeInfo['info']['url']){
+
+
+ $url=$fileCodeInfo['info']['url'];
+ $prop=\util\Funcs::get_url_suffix($url);
+ }
+ }else{
+ return $this->_down_retry($proxyDbIp, $originalUrl, $retryCur, $retryMax, $fileCodeInfo, false);
+ }
+ }
+
+ if($prop){
+ $prop='.'.$prop;
+ }
+
+ $filefull='';
+ $fileurl='';
+ $isExists=false;
+ $filename=g_sc_c('download_file','file_name');
+
+ if('url'==$filename){
+
+
+
+ $filename=substr($key,0,2).'/'.substr($key,2).$prop;
+ $filefull=$file_path.$filename;
+ $filefull=$this->_convert_file_charset($filefull);
+ $isExists=file_exists($filefull);
+ }elseif('custom'==$filename){
+
+ $customPath=g_sc_c('download_file','name_custom_path');
+ if(!is_null(g_sc_c('download_file','_name_custom_path'))){
+ $customPath=g_sc_c('download_file','_name_custom_path');
+ }
+ $customName=g_sc_c('download_file','name_custom_name');
+ if(!is_null(g_sc_c('download_file','_name_custom_name'))){
+ $customName=g_sc_c('download_file','_name_custom_name');
+ }
+ $customPath=model('Config')->convert_file_name_path($customPath,$url);
+ $customName=model('Config')->convert_file_name_name($customName,$url);
+ $filename=$customPath.'/'.$customName.$prop;
+ $filefull=$file_path.$filename;
+ $filefull=$this->_convert_file_charset($filefull);
+ $isExists=file_exists($filefull);
+ }else{
+
+ $filename=date('Y-m-d',time()).'/'.$key.$prop;
+ $filefull=$file_path.$filename;
+ $filefull=$this->_convert_file_charset($filefull);
+ $isExists=file_exists($filefull);
+ }
+ $fileurl=$file_url.$filename;
+
+ if(!$isExists){
+
+ try {
+ unset($options['return_head']);
+ $options['return_info']=true;
+ $fileCodeInfo=get_html($url,$headers,$options,'utf-8',null,true);
+ if(!empty($fileCodeInfo['ok'])){
+
+ $retryCur=0;
+ if(!empty($fileCodeInfo['html'])){
+
+ $mFileProp=\util\Funcs::get_url_suffix($fileCodeInfo['info']['url']);
+ if($mFileProp){
+
+ $mFileProp='.'.$mFileProp;
+ if($prop!=$mFileProp){
+
+ $filename.=$mFileProp;
+ $fileurl.=$mFileProp;
+ $filefull.=$mFileProp;
+
+ if(file_exists($filefull)){
+
+ $isExists=true;
+ $this->cache_file_list[$key]=$fileurl;
+ }
+ }
+ }
+ if(!$isExists){
+ if(write_dir_file($filefull,$fileCodeInfo['html'])){
+ $this->cache_file_list[$key]=$fileurl;
+
+ $funcName=g_sc_c('download_file','file_func');
+ if(!empty($funcName)){
+
+ $paramVals=array(
+ '[文件:文件名]'=>$filefull,
+ '[文件:路径]'=>$file_path,
+ '[文件:名称]'=>$filename,
+ '[文件:链接]'=>$fileurl,
+ '[文件:网址]'=>$url
+ );
+ $return=model('FuncApp')->execute_func('downloadFile',$funcName,$filefull,g_sc_c('download_file','file_func_param'),$paramVals);
+ if($return['success']){
+
+ if($return['data']&&preg_match('/^\w+\:\/\//',$return['data'])){
+
+ $this->cache_file_list[$key]=$return['data'];
+ }
+ }elseif($return['msg']){
+
+ $this->echo_msg(array('%s',$return['msg']));
+ }
+ }
+ }
+ }
+ }
+ }else{
+
+ return $this->_down_retry($proxyDbIp, $originalUrl, $retryCur, $retryMax, $fileCodeInfo, false);
+ }
+ }catch (\Exception $ex){
+
+ }
+ }else{
+
+ $this->cache_file_list[$key]=$fileurl;
+ }
+ }
+ return empty($this->cache_file_list[$key])?$url:$this->cache_file_list[$key];
+ }
- private function _convert_img_charset($filename){
+ private function _convert_file_charset($filename,$isImg=false){
static $charset=null;
+ $type=$isImg?'download_img':'download_file';
if(!isset($charset)){
- $charset=g_sc_c('download_img','charset');
+ $charset=g_sc_c($type,'charset');
$charset=empty($charset)?'':strtolower($charset);
if($charset=='custom'){
- $charset=g_sc_c('download_img','charset_custom');
+ $charset=g_sc_c($type,'charset_custom');
$charset=empty($charset)?'':strtolower($charset);
}
if($charset=='utf-8'){
@@ -427,6 +714,43 @@ class ReleaseBase extends CollectBase{
}
return $filename;
}
+
+ private function _down_retry($proxyDbIp,$url,&$retryCur,$retryMax,$htmlInfo,$isImg){
+ $type=$isImg?'图片':'文件';
+
+ if(empty($htmlInfo['code'])&&!empty($htmlInfo['msg'])){
+
+ $this->echo_msg($htmlInfo['msg'].':'.$url,'black');
+ return $url;
+ }
+
+
+ if(!empty($proxyDbIp)){
+ $this->echo_msg(array('代理IP:%s',$proxyDbIp['ip']),'black',true,'','display:inline;margin-right:5px;');
+ }
+
+
+ $this->retry_first_echo($retryCur,$type.'下载失败',$url,$htmlInfo);
+
+
+ if(!empty($proxyDbIp)){
+ if($htmlInfo['code']!=404){
+
+ model('ProxyIp')->set_ip_failed($proxyDbIp);
+ }
+ }
+
+ $this->collect_sleep(g_sc_c(($isImg?'download_img':'download_file'),'wait'));
+
+ if($this->retry_do_func($retryCur,$retryMax,$type.'无效')){
+ if($isImg){
+ return $this->download_img($url);
+ }else{
+ return $this->download_file($url);
+ }
+ }
+ }
+
/*获取采集器字段*/
public function get_coll_fields($taskId,$taskModule){
static $fieldsList=array();
@@ -487,21 +811,17 @@ class ReleaseBase extends CollectBase{
return write_dir_file($filename,$data);
}
- /*初始化下载图片*/
- public function init_download_img($taskData,$collFields){
+ /*初始化下载配置*/
+ public function init_download_config($taskData,$collFields){
+ init_array($taskData);
+ init_array($collFields);
if(!is_empty(g_sc_c('download_img','download_img'))&&g_sc_c('download_img','img_name')=='custom'){
- if(empty($taskData)){
- $taskData=array();
- }
- if(empty($collFields)){
- $collFields=array();
- }
$name_custom_path=g_sc_c('download_img','name_custom_path');
$check=model('Config')->check_img_name_path($name_custom_path);
if($check['success']){
- $name_custom_path=$this->_convert_img_params($name_custom_path, $taskData, $collFields);
+ $name_custom_path=$this->_convert_download_params($name_custom_path, $taskData, $collFields);
}else{
$name_custom_path='temp';
}
@@ -512,7 +832,7 @@ class ReleaseBase extends CollectBase{
$name_custom_name=g_sc_c('download_img','name_custom_name');
$check=model('Config')->check_img_name_name($name_custom_name);
if($check['success']){
- $name_custom_name=$this->_convert_img_params($name_custom_name, $taskData, $collFields);
+ $name_custom_name=$this->_convert_download_params($name_custom_name, $taskData, $collFields);
}else{
$name_custom_name='';
}
@@ -523,9 +843,38 @@ class ReleaseBase extends CollectBase{
set_g_sc(['c','download_img','_name_custom_path'],null);
set_g_sc(['c','download_img','_name_custom_name'],null);
}
+
+ if(!is_empty(g_sc_c('download_file','download_file'))&&g_sc_c('download_file','file_name')=='custom'){
+
+
+ $name_custom_path=g_sc_c('download_file','name_custom_path');
+ $check=model('Config')->check_file_name_path($name_custom_path);
+ if($check['success']){
+ $name_custom_path=$this->_convert_download_params($name_custom_path, $taskData, $collFields);
+ }else{
+ $name_custom_path='temp';
+ }
+
+ set_g_sc(['c','download_file','_name_custom_path'],$name_custom_path);
+
+
+ $name_custom_name=g_sc_c('download_file','name_custom_name');
+ $check=model('Config')->check_file_name_name($name_custom_name);
+ if($check['success']){
+ $name_custom_name=$this->_convert_download_params($name_custom_name, $taskData, $collFields);
+ }else{
+ $name_custom_name='';
+ }
+
+ set_g_sc(['c','download_file','_name_custom_name'],$name_custom_name);
+ }else{
+
+ set_g_sc(['c','download_file','_name_custom_path'],null);
+ set_g_sc(['c','download_file','_name_custom_name'],null);
+ }
}
- private function _convert_img_params($str,$taskData,$collFields){
+ private function _convert_download_params($str,$taskData,$collFields){
if(empty($taskData)){
$taskData=array();
}
diff --git a/vendor/skycaiji/app/admin/event/Rfile.php b/vendor/skycaiji/app/admin/event/Rfile.php
index 6ddb5eb..5fb9704 100644
--- a/vendor/skycaiji/app/admin/event/Rfile.php
+++ b/vendor/skycaiji/app/admin/event/Rfile.php
@@ -83,7 +83,7 @@ class Rfile extends Release {
foreach ($collFieldsList as $collFieldsKey=>$collFields){
- $this->init_download_img($this->task,$collFields['fields']);
+ $this->init_download_config($this->task,$collFields['fields']);
$this->hide_coll_fields($hideFields, $collFields);
$addedNum++;
$curRow=$rowNum+$addedNum;
@@ -121,7 +121,7 @@ class Rfile extends Release {
foreach ($collFieldsList as $collFieldsKey=>$collFields){
- $this->init_download_img($this->task,$collFields['fields']);
+ $this->init_download_config($this->task,$collFields['fields']);
$this->hide_coll_fields($hideFields, $collFields);
$addedNum++;
$fieldVals=array();
diff --git a/vendor/skycaiji/app/admin/event/Rtoapi.php b/vendor/skycaiji/app/admin/event/Rtoapi.php
index b4a7e09..feba2a3 100644
--- a/vendor/skycaiji/app/admin/event/Rtoapi.php
+++ b/vendor/skycaiji/app/admin/event/Rtoapi.php
@@ -128,6 +128,8 @@ class Rtoapi extends Release{
$headerVals[$v]=$this->config['toapi']['header_val'][$k];
}
}
+ $apiConfig['response']=$this->config['toapi']['response'];
+
}
return $this->_export($collFieldsList,$options,$apiUrl,$apiConfig,$paramVals,$headerVals);
}
@@ -155,12 +157,15 @@ class Rtoapi extends Release{
}else{
$apiUrl=$this->url_list[$apiUrlMd5];
}
+
$apiResponse=is_array($apiConfig['response'])?$apiConfig['response']:array();
- $apiResponse['id']=$apiResponse['id']?:'id';
- $apiResponse['target']=$apiResponse['target']?:'target';
- $apiResponse['desc']=$apiResponse['desc']?:'desc';
- $apiResponse['error']=$apiResponse['error']?:'error';
+ if(empty($apiResponse['module'])){
+ $apiResponse['id']=$apiResponse['id']?:'id';
+ $apiResponse['target']=$apiResponse['target']?:'target';
+ $apiResponse['desc']=$apiResponse['desc']?:'desc';
+ $apiResponse['error']=$apiResponse['error']?:'error';
+ }
$apiCharset=$apiConfig['charset'];
if(empty($apiCharset)){
@@ -175,12 +180,16 @@ class Rtoapi extends Release{
$retryWait=intval($this->config['toapi']['wait']);
$retryMax=intval($this->config['toapi']['retry']);
+ static $cpatternBase=null;
+ if(!isset($cpatternBase)){
+ $cpatternBase=controller('CpatternBase','event');
+ }
foreach ($collFieldsList as $collFieldsKey=>$collFields){
$contTitle=$collFields['title'];
$contUrl=$collFields['url'];
$collFields=$collFields['fields'];
- $this->init_download_img($this->task,$collFields);
+ $this->init_download_config($this->task,$collFields);
$postData=$this->_replace_fields($paramVals,$collFields);
$url=$this->_replace_fields($apiUrl,$collFields);
@@ -203,18 +212,48 @@ class Rtoapi extends Release{
init_array($htmlInfo);
$html=$htmlInfo['html']?:'';
$this->collect_sleep($this->config['toapi']['interval'],true);
- $json=json_decode($html,true);
$returnData=array('id'=>'','target'=>'','desc'=>'','error'=>'');
- if(!empty($apiResponse['id'])&&is_array($json)&&isset($json[$apiResponse['id']])){
+
+ if(empty($apiResponse['module'])){
+ $json=json_decode($html,true);
foreach ($returnData as $k=>$v){
-
if(isset($apiResponse[$k])){
- $returnData[$k]=$json[$apiResponse[$k]]?$json[$apiResponse[$k]]:'';
- }else{
- $returnData[$k]='';
+ $returnData[$k]=$cpatternBase->rule_module_json_data(array(
+ 'json' => $apiResponse[$k],
+ 'json_arr' => '',
+ 'json_arr_implode' => '',
+ ), $json);
}
}
+ }elseif($apiResponse['module']=='xpath'){
+
+ foreach ($returnData as $k=>$v){
+ if(isset($apiResponse[$k])){
+ $returnData[$k]=$cpatternBase->rule_module_xpath_data(array(
+ 'xpath' => $apiResponse[$k],
+ 'xpath_attr' => 'innerHtml',
+ 'xpath_multi' => '',
+ 'xpath_multi_str' => '',
+ ), $html);
+ }
+ }
+ }elseif($apiResponse['module']=='rule'){
+
+ foreach ($returnData as $k=>$v){
+ if(isset($apiResponse[$k])){
+ $returnData[$k]=$cpatternBase->rule_module_rule_data_get(array(
+ 'rule' => $apiResponse[$k],
+ 'rule_merge' => '',
+ 'rule_multi' => '',
+ 'rule_multi_str' => '',
+ 'rule_flags'=>'iu',
+ ), $html,array(),true);
+ }
+ }
+ }
+ if(!is_empty($apiResponse['id'],true)&&$html&&!is_empty($returnData['id'],true)){
+
if($returnData['id']>0){
$addedNum++;
if($returnData['id']>1&&empty($returnData['target'])){
@@ -224,23 +263,23 @@ class Rtoapi extends Release{
}
}else{
- $this->retry_first_echo($retryCur,'发布设置»调用接口失败',null,$htmlInfo);
+ $this->retry_first_echo($retryCur,'发布接口调用失败',null,$htmlInfo);
$this->collect_sleep($retryWait);
- if($this->retry_do_func($retryCur,$retryMax,'接口无效')){
+ if($this->retry_do_func($retryCur,$retryMax,'发布接口无效')){
$doWhile=true;
}
$returnData['id']=0;
- $returnData['error']='发布接口无响应状态';
+ $returnData['error']='未获取到响应状态';
}
}while($doWhile);
$this->record_collected($contUrl,$returnData,$this->release,$contTitle);
if($testToapi){
- $this->echo_msg('发布接口响应数据:
','black');
+ $this->echo_msg('发布接口响应内容:
','black');
}
diff --git a/vendor/skycaiji/app/admin/lang/zh-cn.php b/vendor/skycaiji/app/admin/lang/zh-cn.php
index 3d7f04e..afbf3b7 100644
--- a/vendor/skycaiji/app/admin/lang/zh-cn.php
+++ b/vendor/skycaiji/app/admin/lang/zh-cn.php
@@ -48,19 +48,14 @@ return array(
'setting_store'=>'云端设置',
'store_authkey_error'=>'通信密钥只能由字母和数字组成且长度在6-100位之间',
+ 'down_file_name_'=>'按时间生成(方便日期归类)',
+ 'down_file_name_time'=>'按时间生成(方便日期归类)',
+ 'down_file_name_url'=>'按网址生成(防止重复下载)',
+ 'down_file_name_custom'=>'自定义',
- 'down_img_m_'=>'本地存储',
- 'down_img_m_loc'=>'本地存储',
- 'down_img_m_func'=>'使用函数',
-
- 'down_img_name_'=>'按时间生成(方便日期归类)',
- 'down_img_name_time'=>'按时间生成(方便日期归类)',
- 'down_img_name_url'=>'按网址生成(防止重复下载)',
- 'down_img_name_custom'=>'自定义',
-
+ 'down_file_name_custom_name_'=>'文件网址MD5码',
'down_img_name_custom_name_'=>'图片网址MD5码',
-
'config_error_none_email'=>'没有邮箱服务器配置,请在后台设置!',
@@ -180,7 +175,8 @@ return array(
'process_module_insert'=>'插入内容',
'process_module_replace'=>'内容替换',
'process_module_filter'=>'关键词过滤',
- 'process_module_if'=>'条件判断',
+ 'process_module_if'=>'条件判断',
+ 'process_module_download'=>'本地化',
'process_module_translate'=>'翻译',
'process_module_tool'=>'工具箱',
'process_module_batch'=>'批量替换',
diff --git a/vendor/skycaiji/app/admin/model/Collector.php b/vendor/skycaiji/app/admin/model/Collector.php
index acd803d..b776eb1 100644
--- a/vendor/skycaiji/app/admin/model/Collector.php
+++ b/vendor/skycaiji/app/admin/model/Collector.php
@@ -73,31 +73,62 @@ class Collector extends \skycaiji\common\model\BaseModel{
if(is_array($config['field_process'])){
foreach($config['field_process'] as $k=>$v){
- $config['field_process'][$k]=$this->_compatible_process_api($v);
+ $config['field_process'][$k]=$this->_compatible_processes($v);
}
}
if(is_array($config['common_process'])){
- $config['common_process']=$this->_compatible_process_api($config['common_process']);
+ $config['common_process']=$this->_compatible_processes($config['common_process']);
}
return $config;
}
-
- private function _compatible_process_api($processes){
+
+ private function _compatible_processes($processes){
if(is_array($processes)){
+ $processes=array_values($processes);
+ $toolIsImg=array();
foreach ($processes as $pk=>$pv){
- if(is_array($pv)&&$pv['module']=='api'){
- if(is_array($pv['api_headers'])&&!isset($pv['api_headers']['addon'])){
+ if(is_array($pv)){
+ if($pv['module']=='api'){
+
+ if(is_array($pv['api_headers'])&&!isset($pv['api_headers']['addon'])){
+
+ $pv['api_headers']['addon']=$pv['api_headers']['val'];
+ foreach ($pv['api_headers']['val'] as $vk=>$vv){
+ if($vv){
+ $pv['api_headers']['val'][$vk]='custom';
+ }
+ }
+ $processes[$pk]=$pv;
+ }
+ if(isset($pv['api_json_implode'])){
+
+ $pv['api_json_arr_implode']=$pv['api_json_implode'];
+ unset($pv['api_json_implode']);
+ $processes[$pk]=$pv;
+ }
+ }elseif($pv['module']=='tool'){
- $pv['api_headers']['addon']=$pv['api_headers']['val'];
- foreach ($pv['api_headers']['val'] as $vk=>$vv){
- if($vv){
- $pv['api_headers']['val'][$vk]='custom';
+ if(is_array($pv['tool_list'])){
+ foreach ($pv['tool_list'] as $k=>$v){
+ if($v=='is_img'){
+ $toolIsImg[]=$pk;
+ unset($pv['tool_list'][$k]);
+ }
}
+ $pv['tool_list']=array_values($pv['tool_list']);
+ $processes[$pk]=$pv;
}
- $processes[$pk]=$pv;
}
}
}
+ if(!empty($toolIsImg)){
+
+ $count=0;
+ foreach ($toolIsImg as $k){
+ array_splice($processes,$k+1+$count,0,array(array('title'=>'','module'=>'download','download_op'=>'is_img')));
+ $count++;
+ }
+ }
}
return $processes;
}
@@ -259,7 +290,7 @@ class Collector extends \skycaiji\common\model\BaseModel{
return $lockList;
}
/*触发运行自动采集*/
- public static function collect_run_auto($rootUrl=''){
+ public static function collect_run_auto($rootUrl='',$taskIds=null){
try{
$url='';
@@ -269,6 +300,11 @@ class Collector extends \skycaiji\common\model\BaseModel{
$url=url('admin/index/auto_collect',null,false,true);
}
$url.=(strpos($url, '?')===false?'?':'&').'backstage_run=1&key='.\util\Param::set_cache_key('auto_collect');
+ if($taskIds&&is_array($taskIds)){
+
+ $taskIds=implode(',', $taskIds);
+ $url.='&task_ids='.rawurlencode($taskIds);
+ }
get_html($url,null,array('timeout'=>3));
}catch(\Exception $ex){}
}
diff --git a/vendor/skycaiji/app/admin/model/Config.php b/vendor/skycaiji/app/admin/model/Config.php
index bf80abc..ea54382 100644
--- a/vendor/skycaiji/app/admin/model/Config.php
+++ b/vendor/skycaiji/app/admin/model/Config.php
@@ -53,160 +53,27 @@ class Config extends \skycaiji\common\model\Config {
/*检查图片路径*/
public function check_img_path($imgPath){
- $result=return_result('',false);
- if(!empty($imgPath)){
-
- if(!preg_match('/(^\w+\:)|(^[\/\\\])/i', $imgPath)){
- $result['msg']='图片目录必须为绝对路径!';
- }else{
- if(!is_dir($imgPath)){
- $result['msg']='图片目录不存在!'.(self::check_basedir_limited($imgPath)?lang('error_open_basedir'):'');
- }else{
- $imgPath=realpath($imgPath);
- $root_path=rtrim(realpath(config('root_path')),'\\\/');
- if(preg_match('/^'.addslashes($root_path).'\b/i',$imgPath)){
-
- if(!preg_match('/^'.addslashes($root_path).'[\/\\\]data[\/\\\].+/i', $imgPath)){
- $result['msg']='图片保存到本程序中,目录必须在data文件夹里';
- }else{
- $result['success']=true;
- }
- }else{
- $result['success']=true;
- }
- }
- }
- }
- return $result;
+ return $this->_check_file_path(true,$imgPath);
}
-
/*检查图片网址*/
public function check_img_url($imgUrl){
- $result=return_result('',false);
- if(!empty($imgUrl)){
- if(!preg_match('/^\w+\:\/\//i',$imgUrl)){
- $result['msg']='图片链接地址必须以http://或者https://开头';
- }else{
- $result['success']=true;
- }
- }
- return $result;
+ return $this->_check_file_url(true,$imgUrl);
}
/*检查自定义图片名的路径设置*/
public function check_img_name_path($path){
- static $check_list=array();
- $pathMd5=md5($path);
- if(!isset($check_list[$pathMd5])){
- $result=return_result('',false);
- if(!empty($path)){
- if(!preg_match('/^(\w+|\-|\/|(\[(年|月|日|时|分|秒|前两位|后两位|任务名|任务ID)\])|(\[字段\:[^\/\[\]]+?\]))+$/u',$path)){
- $result['msg']='图片名称自定义路径只能输入字母、数字、下划线、/ 或 使用标签';
- }else{
- if(preg_match('/^\/+$/', $path)){
- $result['msg']='图片名称自定义路径不能只由/组成';
- }else{
- $result['success']=true;
- }
- }
- }
- $check_list[$pathMd5]=$result;
- }else{
- $result=$check_list[$pathMd5];
- }
- return $result;
+ return $this->_check_file_name_path(true,$path);
}
/*转换自定义图片名的路径*/
public function convert_img_name_path($path,$url){
- if(!empty($path)){
- $md5=md5($url);
- static $tags=array('[年]','[月]','[日]','[时]','[分]','[秒]','[前两位]','[后两位]');
- $nowTime=time();
- $tagsRe=array(
- date('Y',$nowTime),
- date('m',$nowTime),
- date('d',$nowTime),
- date('H',$nowTime),
- date('i',$nowTime),
- date('s',$nowTime),
- substr($md5,0,2),
- substr($md5,-2,2),
- );
- $path=str_replace($tags, $tagsRe, $path);
- $path=preg_replace('/[\s\r\n\~\`\!\@\#\$\%\^\&\*\(\)\+\=\{\}\[\]\|\\\\:\;\"\'\<\>\,\?]+/', '_', $path);
- $path=preg_replace('/\_{2,}/', '_', $path);
- $path=preg_replace('/\/{2,}/', '/', $path);
- $path=trim($path,'_');
- $path=trim($path,'/');
- }
- if(empty($path)){
- $path='temp';
- }
- return $path;
+ return $this->_convert_file_name_path(true,$path,$url);
}
/*检查自定义图片名的名称设置*/
public function check_img_name_name($name){
- static $check_list=array();
- $nameMd5=md5($name);
- if(!isset($check_list[$nameMd5])){
- $result=return_result('',false);
- if(!empty($name)){
- if(!preg_match('/^(\w+|\-|(\[(年|月|日|时|分|秒|前两位|后两位|任务名|任务ID|图片网址MD5码|图片原名)\])|(\[字段\:[^\/\[\]]+?\]))+$/u',$name)){
- $result['msg']='图片名称自定义名称只能输入字母、数字、下划线 或 使用标签';
- }else{
- $result['success']=true;
- }
- }
- $check_list[$nameMd5]=$result;
- }else{
- $result=$check_list[$nameMd5];
- }
-
- return $result;
+ return $this->_check_file_name_name(true,$name);
}
/*转换自定义图片名的名称*/
public function convert_img_name_name($name,$url){
- $md5=md5($url);
- if(!empty($name)){
- $urlname='';
- if(preg_match('/([^\/]+?)(\.[a-zA-Z][\w\-]+){0,1}([\?\#]|$)/', $url,$urlname)){
-
- $urlname=$urlname[1];
- if(mb_strlen($urlname,'utf-8')>100){
-
- $urlname=mb_substr($urlname,0,100,'utf-8');
- }
- }else{
- $urlname='';
- }
-
- if(empty($urlname)){
-
- $urlname=$md5;
- }
-
- static $tags=array('[年]','[月]','[日]','[时]','[分]','[秒]','[前两位]','[后两位]','[图片网址MD5码]','[图片原名]');
- $nowTime=time();
- $tagsRe=array(
- date('Y',$nowTime),
- date('m',$nowTime),
- date('d',$nowTime),
- date('H',$nowTime),
- date('i',$nowTime),
- date('s',$nowTime),
- substr($md5,0,2),
- substr($md5,-2,2),
- $md5,
- $urlname
- );
- $name=str_replace($tags, $tagsRe, $name);
- $name=preg_replace('/[\/\s\r\n\~\`\!\@\#\$\%\^\&\*\(\)\+\=\{\}\[\]\|\\\\:\;\"\'\<\>\,\?]+/', '_', $name);
- $name=preg_replace('/\_{2,}/', '_', $name);
- $name=trim($name,'_');
- }
- if(empty($name)){
- $name=$md5;
- }
- return $name;
+ return $this->_convert_file_name_name(true,$name,$url);
}
/*从采集设置中提取出图片本地化设置*/
@@ -224,6 +91,70 @@ class Config extends \skycaiji\common\model\Config {
return $config;
}
+ /*检查文件路径*/
+ public function check_file_path($filePath){
+ return $this->_check_file_path(false,$filePath);
+ }
+ /*检查文件网址*/
+ public function check_file_url($fileUrl){
+ return $this->_check_file_url(false,$fileUrl);
+ }
+ /*检查自定义文件名的路径设置*/
+ public function check_file_name_path($path){
+ return $this->_check_file_name_path(false,$path);
+ }
+ /*转换自定义文件名的路径*/
+ public function convert_file_name_path($path,$url){
+ return $this->_convert_file_name_path(false,$path,$url);
+ }
+ /*检查自定义文件名的名称设置*/
+ public function check_file_name_name($name){
+ return $this->_check_file_name_name(false,$name);
+ }
+ /*转换自定义文件名的名称*/
+ public function convert_file_name_name($name,$url){
+ return $this->_convert_file_name_name(false,$name,$url);
+ }
+
+ /*上传图片水印logo*/
+ public function check_img_watermark_logo($formName,$fileName=''){
+ $result=return_result('',false,array('file_prop'=>'','file_data'));
+ $imgWmLogo=$_FILES[$formName];
+ if(!empty($imgWmLogo)&&!empty($imgWmLogo['tmp_name'])){
+ if(preg_match('/^image\/(jpg|jpeg|gif|png)$/i',$imgWmLogo['type'],$mprop)){
+ $mprop=strtolower($mprop[1]);
+ $imgWmLogo=file_get_contents($imgWmLogo['tmp_name']);
+ if(empty($imgWmLogo)){
+ $result['msg']='请上传有效的水印logo';
+ }else{
+ $result['success']=true;
+ $result['file_prop']=$mprop;
+ $result['file_data']=$imgWmLogo;
+ }
+ }else{
+ $result['msg']='仅支持上传 jpg、jpeg、gif、png 格式的水印logo';
+ }
+ }else{
+ $result['success']=true;
+ }
+ return $result;
+ }
+ public function upload_img_watermark_logo($formName,$fileName=''){
+ $result=$this->check_img_watermark_logo($formName,$fileName);
+ if($result['success']){
+ if($result['file_data']){
+
+ $fileName=$fileName?$fileName:'logo';
+ $result['file_name']='/data/images/watermark/'.$fileName.'.'.$result['file_prop'];
+ write_dir_file(config('root_path').$result['file_name'], $result['file_data']);
+ }
+
+ }else{
+ $result['msg']=$result['msg']?:'上传水印logo失败';
+ }
+ return $result;
+ }
+
/*检测出php可执行文件路径*/
public static function detect_php_exe(){
static $php_filename=null;
@@ -361,5 +292,219 @@ class Config extends \skycaiji\common\model\Config {
}
return $seconds;
}
+
+
+ public static function process_suffix($suffix,$returnArr=false){
+ static $list=array();
+ $key=md5($suffix);
+ $data=array();
+ if(!isset($list[$key])){
+ if($suffix){
+
+ if(preg_match_all('/\b[a-zA-Z]\w*\b/i',$suffix,$msuffix)){
+ $data=array_unique($msuffix[0]);
+ $data=array_values($data);
+ $data=array_map('strtolower', $data);
+ }
+ }
+ $list[$key]=$data;
+ }
+ $data=$list[$key];
+ return $returnArr?$data:implode(',',$data);
+ }
+
+
+ public static function process_tag_attr($tagAttr,$returnArr=false){
+ static $list=array();
+ $key=md5($tagAttr);
+ $data=array();
+ if(!isset($list[$key])){
+ if($tagAttr){
+
+ if(preg_match_all('/\b([a-zA-Z]\w*)\:([a-zA-Z]\w*)\b/i',$tagAttr,$mtag)){
+
+ $data=array(0=>array(),1=>array(),2=>array());
+ for($i=0;$i\,\?]+/', '_', $path);
+ $path=preg_replace('/\_{2,}/', '_', $path);
+ $path=preg_replace('/\/{2,}/', '/', $path);
+ $path=trim($path,'_');
+ $path=trim($path,'/');
+ }
+ if(empty($path)){
+ $path='temp';
+ }
+ return $path;
+ }
+
+ private function _check_file_name_name($isImg,$name){
+ $title=$isImg?'图片':'文件';
+ static $check_list=array();
+ $nameMd5=md5($name);
+ if(!isset($check_list[$nameMd5])){
+ $result=return_result('',false);
+ if(!empty($name)){
+ $pattern='/^(\w+|\-|(\[(年|月|日|时|分|秒|前两位|后两位|任务名|任务ID|'.$title.'网址MD5码|'.$title.'原名)\])|(\[字段\:[^\/\[\]]+?\]))+$/u';
+ if(!preg_match($pattern,$name)){
+ $result['msg']=$title.'名称自定义名称只能输入字母、数字、下划线 或 使用标签';
+ }else{
+ $result['success']=true;
+ }
+ }
+ $check_list[$nameMd5]=$result;
+ }else{
+ $result=$check_list[$nameMd5];
+ }
+ return $result;
+ }
+
+ private function _convert_file_name_name($isImg,$name,$url){
+ $title=$isImg?'图片':'文件';
+ $md5=md5($url);
+ if(!empty($name)){
+ $urlname='';
+ if(preg_match('/([^\/]+?)(\.[a-zA-Z][\w\-]+){0,1}([\?\#]|$)/', $url,$urlname)){
+
+ $urlname=$urlname[1];
+ if(mb_strlen($urlname,'utf-8')>100){
+
+ $urlname=mb_substr($urlname,0,100,'utf-8');
+ }
+ }else{
+ $urlname='';
+ }
+
+ if(empty($urlname)){
+
+ $urlname=$md5;
+ }
+
+ static $sameTags=array('[年]','[月]','[日]','[时]','[分]','[秒]','[前两位]','[后两位]');
+ $tags=$sameTags;
+ $tags[]='['.$title.'网址MD5码]';
+ $tags[]='['.$title.'原名]';
+
+ $nowTime=time();
+ $tagsRe=array(
+ date('Y',$nowTime),
+ date('m',$nowTime),
+ date('d',$nowTime),
+ date('H',$nowTime),
+ date('i',$nowTime),
+ date('s',$nowTime),
+ substr($md5,0,2),
+ substr($md5,-2,2),
+ $md5,
+ $urlname
+ );
+ $name=str_replace($tags, $tagsRe, $name);
+ $name=preg_replace('/[\/\s\r\n\~\`\!\@\#\$\%\^\&\*\(\)\+\=\{\}\[\]\|\\\\:\;\"\'\<\>\,\?]+/', '_', $name);
+ $name=preg_replace('/\_{2,}/', '_', $name);
+ $name=trim($name,'_');
+ }
+ if(empty($name)){
+ $name=$md5;
+ }
+ return $name;
+ }
}
?>
\ No newline at end of file
diff --git a/vendor/skycaiji/app/admin/model/FuncApp.php b/vendor/skycaiji/app/admin/model/FuncApp.php
index 3cc4739..4847432 100644
--- a/vendor/skycaiji/app/admin/model/FuncApp.php
+++ b/vendor/skycaiji/app/admin/model/FuncApp.php
@@ -29,6 +29,10 @@ class FuncApp extends \skycaiji\common\model\BaseModel{
'name'=>'下载图片',
'loc'=>'设置»采集设置»图片本地化»使用函数',
),
+ 'downloadFile'=>array(
+ 'name'=>'下载文件',
+ 'loc'=>'设置»采集设置»文件本地化»使用函数',
+ ),
'contentSign'=>array(
'name'=>'内容标签',
'loc'=>'任务»采集器设置»页面配置»提取内容标签»使用函数',
@@ -326,13 +330,14 @@ class FuncApp extends \skycaiji\common\model\BaseModel{
*/
public function execute_func($module,$funcName,$defaultVal,$paramsStr,$paramValList=null){
- static $func_class_list=array('process'=>array(),'processIf'=>array(),'contentSign'=>array(),'downloadImg'=>array());
- static $func_param_num_list=array('process'=>array(),'processIf'=>array(),'contentSign'=>array(),'downloadImg'=>array());
+ static $func_class_list=array('process'=>array(),'processIf'=>array(),'contentSign'=>array(),'downloadImg'=>array(),'downloadFile'=>array());
+ static $func_param_num_list=array('process'=>array(),'processIf'=>array(),'contentSign'=>array(),'downloadImg'=>array(),'downloadFile'=>array());
static $func_param_rules=array(
'process'=>'/\[\x{5b57}\x{6bb5}\:.+?\]/u',
'processIf'=>'/\[\x{5b57}\x{6bb5}\:.+?\]/u',
'contentSign'=>null,
'downloadImg'=>'/\[\x{56fe}\x{7247}\:.+?\]/u',
+ 'downloadFile'=>'/\[\x{6587}\x{4ef6}\:.+?\]/u',
);
$class_list=&$func_class_list[$module];
$param_num_list=&$func_param_num_list[$module];
@@ -378,7 +383,7 @@ class FuncApp extends \skycaiji\common\model\BaseModel{
if(is_object($class_list[$className])){
if(!method_exists($class_list[$className], $methodName)){
- $result['msg']=$options['loc'].'»不存在方法:'.$className.'->'.$methodName;
+ $result['msg']=$options['loc'].'»不存在方法:'.$className.'->'.$methodName;
}else{
$result['success']=true;
}
diff --git a/vendor/skycaiji/app/admin/model/Task.php b/vendor/skycaiji/app/admin/model/Task.php
index f3e036f..a92a9b6 100644
--- a/vendor/skycaiji/app/admin/model/Task.php
+++ b/vendor/skycaiji/app/admin/model/Task.php
@@ -11,6 +11,21 @@
namespace skycaiji\admin\model;
class Task extends \skycaiji\common\model\BaseModel{
+ public function getById($id){
+ $data=$this->where('id',$id)->find();
+ if($data){
+ $data=$data->toArray();
+ if(!empty($data['config'])){
+ $data['config']=unserialize($data['config']);
+ }
+ if(empty($data['config'])){
+ $data['config']=array();
+ }
+ }else{
+ $data=array();
+ }
+ return $data;
+ }
public function loadConfig($taskData){
$config=$taskData['config'];
if(empty($config)){
@@ -24,12 +39,12 @@ class Task extends \skycaiji\common\model\BaseModel{
$config=array();
}
+ $config=$this->compatible_config($config);
+
$original_config=g_sc('c_original');
- set_g_sc(['c','caiji','interval'],empty($config['interval'])?$original_config['caiji']['interval']:$config['interval']);
-
- set_g_sc(['c','caiji','interval_html'],empty($config['interval_html'])?$original_config['caiji']['interval_html']:$config['interval_html']);
+ $this->set_c_num_names('caiji', array('interval'=>'num_interval','interval_html'=>'num_interval_html'), $config, $original_config);
if(empty($config['same_url'])){
@@ -71,6 +86,30 @@ class Task extends \skycaiji\common\model\BaseModel{
}
+ if(empty($config['download_file'])){
+
+ set_g_sc(['c','download_file','download_file'],$original_config['download_file']['download_file']);
+ }else{
+ set_g_sc(['c','download_file','download_file'],$config['download_file']=='n'?0:1);
+ }
+
+ if(empty($config['file_func'])){
+
+ set_g_sc(['c','download_file','file_func'],$original_config['download_file']['file_func']);
+ }else{
+
+ set_g_sc(['c','download_file','file_func'],$config['file_func']=='n'?'':$config['file_func']);
+ }
+
+
+ if(empty($config['translate'])){
+
+ set_g_sc(['c','translate','open'],$original_config['translate']['open']);
+ }else{
+ set_g_sc(['c','translate','open'],$config['translate']=='n'?0:1);
+ }
+
+
if(empty($config['proxy'])){
set_g_sc(['c','proxy','open'],$original_config['proxy']['open']);
@@ -86,7 +125,7 @@ class Task extends \skycaiji\common\model\BaseModel{
set_g_sc(['c','proxy','group_id'],$config['proxy_group_id']);
}
- static $imgParams=array('img_path','img_url','img_name','name_custom_path','name_custom_name','interval_img','img_func_param');
+ static $imgParams=array('img_path','img_url','img_name','name_custom_path','name_custom_name','img_func_param','img_wm_logo');
foreach ($imgParams as $imgParam){
set_g_sc(['c','download_img',$imgParam],empty($config[$imgParam])?$original_config['download_img'][$imgParam]:$config[$imgParam]);
@@ -96,22 +135,57 @@ class Task extends \skycaiji\common\model\BaseModel{
set_g_sc(['c','download_img','name_custom_path'],$original_config['download_img']['name_custom_path']);
set_g_sc(['c','download_img','name_custom_name'],$original_config['download_img']['name_custom_name']);
}
+
+ if(empty($config['img_watermark'])){
+
+ set_g_sc(['c','download_img','img_watermark'],$original_config['download_img']['img_watermark']);
+ }else{
+ set_g_sc(['c','download_img','img_watermark'],$config['img_watermark']=='n'?0:1);
+ }
+ $this->set_c_num_names('download_img', array('interval_img'=>'num_interval_img','img_wm_bottom'=>'img_wm_bottom','img_wm_right'=>'img_wm_right','img_wm_opacity'=>'img_wm_opacity'), $config, $original_config);
- $htmlMillisecond=g_sc_c('caiji','interval_html');
- if(empty($htmlMillisecond)&&$original_config['caiji']['html_interval']>0){
+ static $fileParams=array('file_path','file_url','file_name','file_func_param');
+ foreach ($fileParams as $fileParam){
- $htmlMillisecond=$original_config['caiji']['html_interval']*1000;
- set_g_sc(['c','caiji','interval_html'],$htmlMillisecond);
+ set_g_sc(['c','download_file',$fileParam],empty($config[$fileParam])?$original_config['download_file'][$fileParam]:$config[$fileParam]);
}
+
+ set_g_sc(['c','download_file','name_custom_path'],empty($config['file_custom_path'])?$original_config['download_file']['name_custom_path']:$config['file_custom_path']);
+ set_g_sc(['c','download_file','name_custom_name'],empty($config['file_custom_name'])?$original_config['download_file']['name_custom_name']:$config['file_custom_name']);
- $imgMillisecond=g_sc_c('download_img','interval_img');
- if(empty($imgMillisecond)&&$original_config['download_img']['img_interval']>0){
+ if(empty($config['file_name'])){
- $imgMillisecond=$original_config['download_img']['img_interval']*1000;
- set_g_sc(['c','download_img','interval_img'],$imgMillisecond);
+ set_g_sc(['c','download_file','name_custom_path'],$original_config['download_file']['name_custom_path']);
+ set_g_sc(['c','download_file','name_custom_name'],$original_config['download_file']['name_custom_name']);
}
- }
+ $this->set_c_num_names('download_file', array('file_interval'=>'file_interval'), $config, $original_config);
+ }
+
+ private function set_c_num_names($cKey,$names,&$config,&$original_config){
+ foreach ($names as $k=>$v){
+ set_g_sc(['c',$cKey,$k],is_empty($config[$v],true)?$original_config[$cKey][$k]:$config[$v]);
+ }
+ }
+ public function compatible_config($config){
+
+ if(!empty($config)&&is_array($config)){
+
+ $oldNumNames=array('interval'=>'num_interval','interval_html'=>'num_interval_html','interval_img'=>'num_interval_img');
+ foreach($oldNumNames as $k=>$v){
+ if(isset($config[$k])){
+ if(empty($config[$k])){
+ $config[$v]='';
+ }elseif($config[$k]==='-1'||$config[$k]===-1){
+ $config[$v]=0;
+ }else{
+ $config[$v]=$config[$k];
+ }
+ }
+ }
+ }
+ return $config;
+ }
public function set_backstage($taskId){
if($taskId>0){
diff --git a/vendor/skycaiji/app/admin/view/common/header_public.html b/vendor/skycaiji/app/admin/view/common/header_public.html
index 5511a93..a0d37ff 100644
--- a/vendor/skycaiji/app/admin/view/common/header_public.html
+++ b/vendor/skycaiji/app/admin/view/common/header_public.html
@@ -6,6 +6,7 @@
{:g_sc('html_tag_title')?(g_sc('html_tag_title').' - '):''}蓝天采集器后台管理
+
@@ -33,7 +34,7 @@
-
+
diff --git a/vendor/skycaiji/app/admin/view/cpattern/front_url.html b/vendor/skycaiji/app/admin/view/cpattern/front_url.html
index aece394..4e5f3d1 100644
--- a/vendor/skycaiji/app/admin/view/cpattern/front_url.html
+++ b/vendor/skycaiji/app/admin/view/cpattern/front_url.html
@@ -26,6 +26,7 @@
+