易优cms用采集工具发布内容后不自动更新生成静态页面

使用易优CMS_Eyoucms火车头免登陆发布接口发布内容后在前端找不到文章,怎么办? 更新首页get请求: http://你的域名/index.php?m=home&c=Buildhtml&a=buildIndexAll&lang=cn 更新文章页html 发送post请求: http://你的域名/index.php?m=home&c=Buildhtml&a=upHtml&lang=cn post数据内容: { 'aid': aid, 'typeid': typeid, 'type': 'view', 'ctl_name': 'Article', '_ajax': 1, } 更新列表页html 发送post请求: http://你的域名/index.php?m=home&c=Buildhtml&a=upHtml&lang=cn post 数据内容: { 'aid': aid, 'typeid': typeid, 'type': 'lists', 'ctl_name': 'Article', '_ajax': 1, } 我的文章发布工具Python: import urllib.request import urllib.parse import json def eyoucms_post(title, content, typeid, channel, domain, _password): headers = { "User-Agent" : "Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9.1.6) ", "Accept" : "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", "Accept-Language" : "zh-cn", "Connection" : "keep-alive", } url = "http://" + domain + "/api/publishArticle/insertArchives?__post_flag=post" data_form = { "__post_password": _password, "typeid": typeid, # 栏目ID,取得方法:后台管理->栏目管理->ID列的数字 "channel": channel, # 频道模型,取得方法:后台管理->高级选项->频道模型->取得“文章模型”的ID "title": title, "content": content, } data = urllib.parse.urlencode(data_form).encode(encoding='utf-8') req = urllib.request.Request(url, data=data, headers=headers) res = urllib.request.urlopen(req, timeout=60) result = res.read().decode('utf-8') # 解析JSON json_data = json.loads(result) if "data" in json_data and "url" in json_data["data"]: parsed_url = urllib.parse.urlparse(json_data["data"]["url"]) query_params = urllib.parse.parse_qs(parsed_url.query) aid_value = query_params.get("aid", [""])[0] return aid_value return None # 若未找到aid,则返回None def upindex(domain): headers = { "User-Agent" : "Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9.1.6) ", "Accept" : "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", "Accept-Language" : "zh-cn", "Connection" : "keep-alive", } url = "http://" + domain + "/index.php?m=home&c=Buildhtml&a=buildIndexAll&lang=cn" data_form = { } data = urllib.parse.urlencode(data_form).encode(encoding='utf-8') req = urllib.request.Request(url, data=data, headers=headers) res = urllib.request.urlopen(req, timeout=60) result = res.read().decode('utf-8') return result def upview(domain, aid, typeid): headers = { "User-Agent" : "Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9.1.6) ", "Accept" : "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", "Accept-Language" : "zh-cn", "Connection" : "keep-alive", } url = "http://" + domain + "/index.php?m=home&c=Buildhtml&a=upHtml&lang=cn" data_form = { 'aid': aid, 'typeid': typeid, 'type': 'view', 'ctl_name': 'Article', '_ajax': 1, } data = urllib.parse.urlencode(data_form).encode(encoding='utf-8') req = urllib.request.Request(url, data=data, headers=headers) res = urllib.request.urlopen(req, timeout=60) result = res.read().decode('utf-8') return result def uplists(domain, aid, typeid): headers = { "User-Agent" : "Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9.1.6) ", "Accept" : "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", "Accept-Language" : "zh-cn", "Connection" : "keep-alive", } url = "http://" + domain + "/index.php?m=home&c=Buildhtml&a=upHtml&lang=cn" data_form = { 'aid': aid, 'typeid': typeid, 'type': 'lists', 'ctl_name': 'Article', '_ajax': 1, } data = urllib.parse.urlencode(data_form).encode(encoding='utf-8') req = urllib.request.Request(url, data=data, headers=headers) res = urllib.request.urlopen(req, timeout=60) result = res.read().decode('utf-8') return result if __name__ == "__main__": title = "这是python自动发布的文章" content = "这是python自动发布的文章内容" typeid = 14 channel = 1 domain = "我的域名" _password = "这个和发布接口的密码一致" aid = eyoucms_post(title, content, typeid, channel, domain, _password) print(aid) upindex(domain) print(upview(domain, aid, typeid)) print(uplists(domain, aid, typeid))

February 13, 2025 · 2 min

易优cms关闭后台登录验证码

Eyouems 关闭后台登录时的验码, 修改文件路径: application\admin\controller\Admin.php 91行 $is_vertify = 0; 改成 $is_vertify = 1; 将0改成1

February 13, 2025 · 1 min

易优CMS_Eyoucms火车头免登陆发布接口

Eyoucms免登陆发布接口–通用发布插件,支持火车头、八爪鱼、简数等。 安装使用说明: 1、请把PublishArticle.php里面 const post_password = “changeme2”;(大约在13行左右)把changeme2改为新密码,注意一定要修改!!!在发布时需要填写该密码; 2、密码修改后,把文件PublishArticle.php上传到Eyoucms网站的/application/api/controller目录下。接口更新方法也相同。 3、此接口只支持文章模型的发布 4、如发布失败的话,请检查Eyoucms网站是否已配置TP框架pathinfo信息, 对应的XXX.com.conf 的配置文件进行增加 TP框架pathinfo配置 location / { if (!-e $request_filename){ rewrite ^/(.)$ /index.php?s=/$1 last; } } #TP框架pathinfo配置 location ~ \.php/?.$ { include fastcgi_params; fastcgi_index index.php; fastcgi_pass unix:/tmp/php-cgi.sock; fastcgi_param PHP_VALUE open_basedir=$document_root:/tmp/:/proc/; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } 插件接口各字段说明: 1、http://www.xxx.com/api/publishArticle/insertArchives?__post_flag=post //网站发布url,http://xxx使用要发布的网站首页代替 2、__post_password //发布密码 3、typeid//栏目ID,取得方法:后台管理->栏目管理->ID列的数字 4、channel//频道模型,取得方法:后台管理->高级选项->频道模型->取得“文章模型”的ID 5、title //文章标题 6、content //文章内容 最新易优CMS免登录通用发布接口.zip: https://url89.ctfile.com/f/63049189-1454341586-caed3a?p=9487 (访问密码: 9487)

February 7, 2025 · 1 min