★ 建站顺序另见《云酷德建站流程法》(tempx buildlaw.index,打开章程,2026-10-05 定稿):先名后形 → 计划六表 → 补正 → 开工 → newresname 建名 → 照 funtxt 施工 → samekdatatotab 回填 → 验收。
以前文档里写的是「直接调 API 接口」——那是旧约,作废。所有资源的增删改,一律按下述六步走。
GET 本站域名/localxres/funx/commonlogin/?uid=<账号>&pass=<makepass密文>&sysid=<系统id>msg 就是 stoken。随后 Cookie 必须带 三个值:uid、stoken、deadline=time()+3600*72。$leftt>0 拦掉,现象是 302 静默跳转,接口返回空。funx.newresname?restype=<类型>&rescode=<域.名>&sysid=<系统>&restitle=<标题>coode_userlist 中必须 PRIME=1。tempx 的 rescode 若含点号,点前是域、点后是单元名;不含点号则自动补 .index。coode_sysrestypedefine 按 restypecode 查 cloudpath 字段——它就是该类型资源的编辑器地址。cloudpath 值为 mysql 的,说明这类资源基本不落盘,可以直接改数据;值是一条 URL 的,说明会落盘,必须进编辑器改,直接改库会造成库盘不一致。coode_sysrestypedefine 找到该 restypecode 那一行,读它的 cloudpath 字段,那就是现成的完整编辑器地址,? 后面已经把参数位留好了;你要做的只是把占位符换成资源名或该数据的 SNO 序号。https://qianjilian.com/localxres/tempx/tempeditor/index.html?unitid=xianfa.indexhttps://qianjilian.com/localxres/pagex/htmleditor/WrvLoe/index.html?funid=savefunchttps://qianjilian.com/localxres/pagex/htmleditor/WrvLoe/index.html?funid=coode_funsetfile@SNO:12345.funfullcoode_funlist 的 usearea 字段声明:它写明该方法允许被哪个页面调用,形如 tempx.tempeditor.index。pgmark(资源类型.目录.单元),拿它和 usearea 比对,不匹配直接判无权。所以「在哪个页面里调」不是形式,是权限本身。heartbeat 的 refreshtoken 方法:校验 stoken 是否有效、刷新 coode_loginstoken 有效期、并下发 deadline。所有「为什么明明登录了还是没权限」的答案都在这里。下表「编辑器 / 落点」列即 coode_sysrestypedefine.cloudpath 的值(已补全域名前缀),可直接复制使用。
| 类型 | 主表 | 编辑器 / 落点(完整地址) |
|---|---|---|
| funx 函数 | coode_funlist | https://qianjilian.com/localxres/pagex/htmleditor/WrvLoe/index.html?funid=<函数名> |
| clsx 类 | coode_phpcls | https://qianjilian.com/localxres/pagex/htmleditor/WrvLoe/index.html?funid=<类名> |
| sfunx 函数集 | coode_funsetfile | https://qianjilian.com/localxres/pagex/htmleditor/WrvLoe/index.html?funid=coode_funsetfile@SNO:<该数据序号>.funfull |
| dfunx 数据函数 | coode_datafun | https://qianjilian.com/localxres/pagex/htmleditor/WrvLoe/index.html?funid=coode_funsetfile@SNO:<该数据序号>.funfull |
| constx 静态量 | coode_sysconstant | https://qianjilian.com/localxres/pagex/htmleditor/WrvLoe/index.html?funid=coode_funsetfile@SNO:<该数据序号>.funfull |
| configx 系统参数 | coode_sysconfig | https://qianjilian.com/localxres/pagex/htmleditor/WrvLoe/index.html?funid=coode_funsetfile@SNO:<该数据序号>.funfull |
| tempx 模板 | coode_domainunit | https://qianjilian.com/localxres/tempx/tempeditor/index.html?unitid=<域.单元> |
| pagex 页面 | coode_tiny | https://qianjilian.com/localxres/tempx/tinylayeditor/index.html?unitid=<域.单元>&tinyid=<tinymark> |
| mfunx 分布函数 | coode_multifunlist | https://qianjilian.com/localxres/tempx/tinylayeditor/index.html?unitid=resuptool.index&tinyid=o16CUI |
| tabx 表 | coode_tablist | https://qianjilian.com/localxres/funx/anyjsshort/?stid=2qPIqS-sfile:anyjsshort.php-&pnum=150:<表名>&page=1:TABLE_NAME& |
| formx 表单 | coode_shortdata | https://qianjilian.com/localxres/funx/anyjsshort/?datatype=html&stid=keydtly-&pnum=100:<shortid>&page=1:shortid& |
| dataspacex 数据空间 | coode_dataspace | https://qianjilian.com/localxres/tempx/dspcmgr/index.html |
| sysx 系统容器 | coode_sysinformation | mysql:不落盘,可直接改库 |
| appx 应用容器 | coode_appdefault | mysql:不落盘,可直接改库 |
| layx 输出容器 | coode_applay | mysql:不落盘,可直接改库 |
| cdtrdrx 条件跳转 | coode_cdtrdr | mysql:不落盘,可直接改库 |
| parardrx 参数跳转 | coode_parardr | mysql:不落盘,可直接改库 |
| groupx 一级分类 | coode_grouplist | mysql:不落盘,可直接改库 |
| plotx 节点 | coode_plotlist | mysql:不落盘,可直接改库 |
| csspagex 样式页面 | coode_facelist | mysql:不落盘,可直接改库 |
| iconsetx 图标库 | coode_iconset | mysql:不落盘,可直接改库 |
| databasex 数据库 | coode_dblist | mysql:不落盘,可直接改库 |
| afunx 事务函数 | coode_affairfunlist | mysql:不落盘,可直接改库 |
| parax 外部框架 | coode_para | mysql:不落盘,可直接改库 |
| apix 接口密钥 | coode_apipool | mysql:不落盘,可直接改库 |
| smallcssx 小CSS | coode_codedemo | mysql:不落盘,可直接改库 |
资源图标库 —— 专为系统 26 种资源本身存头像 / 海报 / 图标。主表 coode_iconset(setmark=资源类型码),落盘 /localxres/iconsetx/<类型码>/。
图:iconsetx(资源图标库)在云酷德体系里的位置
一句话:资源图标库 —— 专为系统 26 种资源本身存头像 / 海报 / 图标。主表 coode_iconset(setmark=资源类型码),落盘 /localxres/iconsetx/<类型码>/。
★ 定位(2026-09-29 铁哥重定义):iconsetx 不再是一个"通用图标素材库",而是专门为系统这 26 种资源本身存图像的地方——每个资源类型的头像、海报、示意图、封面图都归它管。
目录按资源类型码分:/localxres/iconsetx/sysx/、/localxres/iconsetx/funx/、/localxres/iconsetx/tempx/……一个类型一个目录。
主表 coode_iconset 里不存图片二进制,只存每一张图的访问地址链接(outurl)加元信息;SVG 源码可另存 imgcode 字段供内联。
为什么要单独拎出来:26 种资源各有各的"脸",图散在各处就找不回来;统一进 iconsetx 后,给某个资源配图 = 往它的类型目录里放图 + 在表里收录一条地址,别处引用时按 setmark 一查就有。
所有资源都是这套节奏:先建,再存,要改就取回来改,不用了就卸载
主表字段(coode_iconset,共 14 个起):SNO setarea setmark settitle imgmark imgtitle imglabel imgtype industry width height colora colorb shapex…
select * from coode_iconset where setmark='iconsetx';含 head 里要引的 css/js,以及完整 body;本地先拼好再提交
'dTYPE:HEX:' + html.encode('utf8').hex() —— 中文走明文会被 unstrs() 改字符
带 resid=域.名、wb=1、sysid=0,必须带 Cookie
wbinfo.isnew=1 才是真新建,fileok=1 说明盘上已落
第一次新建走 anahtmlcode:给它一份完整成品 HTML,它会自己拆成 样式 / 脚本 / 主体 / 骨架,写进 coode_domainunit,并落盘 /localxres/tempx/xianfa/iconsetx.html。
这一步就把「库 + 盘 + 索引」都建好了,不要自己插 SQL、不要 SFTP 传文件。
除了本类型自己的专用接口,26 种资源全部可以走同一个入口:funx.askapi。
它怎么知道每种资源该填哪些字段'+String.fromCharCode(65311)+'——看这两张表:coode_asklist(datamark=<类型码>_<操作>,记录作用在哪个主表、定位键是哪个)coode_askkey(同 datamark,逐字段记录字段名、中文名、fromurl=GET / POST / VIEW)。
所以「这个资源要建哪些字段」不用猜,查这两张表就有。
| 必填字段 | 含义 | 提交方式 | 类型 | 说明 |
|---|---|---|---|---|
| setmark | 图集标记 | POST | varchar | ★ 定位键——整个资源靠它被找到;fullinfo / view 都得拿它当<定位值> |
| settitle | 图集标题 | POST | varchar | 资源的中文名(标题/别名)。必填,但随时可改——改走 fullinfo 或 setbtn |
| sysid | 系统ID | POST | varchar | 所属系统ID。公共资源填 0(云酷德运行时);填了具体 sysid 就归到那个系统名下 |
| srctype | 资源类型 | POST | varchar | 资源类型码,固定填 iconsetx,不要拼错 |
crtres 基本都只要这四样——定位键(setmark)+ 标题 + sysid(公共资源填 0)+ srctype(填资源类型码 iconsetx)。剩下的字段建完再用 optype=fullinfo 补。POST 本站域名/localxres/funx/askapi/?optype=crtres&stype=iconsetx
Cookie: uid=divlovecss; stoken=; deadline= # ① 补全其余字段(一次可改多个)
POST 本站域名/localxres/funx/askapi/?optype=fullinfo&stype=iconsetx&setmark=<定位值>
Cookie: uid=divlovecss; stoken=; deadline= | optype | 干什么 | 说明 |
|---|---|---|
| crtres | 新建资源 | 插一条记录到主表,并自动给你放开发权限(coode_devespace) |
| fullinfo | 改多个字段 | 按定位键找到记录,一次改掉提交上来的所有可写字段 |
| view | 读取一条 | 按定位键取出这条记录的主字段 |
| viewext | 读取扩展 | 取出关联的扩展信息(子项、依赖面等) |
| setbtn | 按钮写值 | 改少量字段(通常是开关、状态位) |
| mkfile | 生成资源文件 | 按类型生成落盘文件:函数类 index.php、模板类 index.html,其余生成数据出口 |
GET=从 URL 参数取值、POST=从表单体取值、VIEW=只展示不写库。crtres 时 VIEW 字段会被跳过,所以创建后它们还是空的——这正是要接着走 fullinfo 的原因。POST 本站域名/localxres/funx/anahtmlcode/
Cookie: uid=divlovecss; stoken=; deadline=
Content-Type: application/x-www-form-urlencoded
resid = xianfa.iconsetx
htmlcode = dTYPE:HEX:<完整 HTML 的十六进制> # ★ 中文必须 hex,明文会被 unstrs 改字符
hex = 1
wb = 1 # 返回 JSON
unittitle = iconsetx 资源图标库
sysid = 0 # 顺手登记 coode_sysregres {"status":"1","msg":"生成成功","redirect":"",
"wbinfo":{"resid":"xianfa.iconsetx","outurl":"/localxres/tempx/xianfa/iconsetx.html",
"isnew":1,"fileok":1,"bytes":32110,"regok":1}}import io, urllib.parse, urllib.request
SITE = 'https://<你的本站域名>'
COOKIE = 'uid=divlovecss; stoken=; deadline=' # ★ 铁律:系统资源操作必带,否则 CRTOR 写空
def post(fn, data, timeout=180):
url = SITE + '/localxres/funx/' + fn + '/'
body = urllib.parse.urlencode(data).encode('utf8')
req = urllib.request.Request(url, data=body, headers={
'Content-Type': 'application/x-www-form-urlencoded',
'Cookie': COOKIE})
return urllib.request.urlopen(req, timeout=timeout).read().decode('utf8', 'replace')
def tohex(s):
return 'dTYPE:HEX:' + s.encode('utf8').hex() # ★ 中文正文必须走 hex,明文会被 unstrs 改字符
def nl(s):
return s.replace('\r\n', '\n').replace('\n', '
') # 换行 ->
,unstrs 还原成 \r\n
# ---------- 1. 新建:anahtmlcode ----------
html = io.open('iconsetx.html', encoding='utf8').read()
r = post('anahtmlcode', {
'resid': 'xianfa.iconsetx', # 域.名 -> 落盘 /localxres/tempx/xianfa/iconsetx.html
'htmlcode': tohex(html), # 完整成品页(含 <head> 里的 css/js 引用)
'hex': '1',
'wb': '1', # 返回 JSON:isnew / fileok / bytes / regok
'unittitle': 'iconsetx 资源图标库',
'sysid': '0', # 顺手登记进 coode_sysregres
})
print(r) # isnew:1 才是真新建;isnew:0 说明同名已存在,走的是更新分支 不想写脚本'+String.fromCharCode(65311)+'用可视化通道:打开 本站域名/localxres/tempx/abhtmlcode/index.html?resid=xianfa.iconsetx(页面标题就叫「html代码吸收器」),把整页 HTML 粘进文本框点提交即可。
它其实就是 anahtmlcode 的前端壳,提交的是 resid=<域.名>&htmlcode=mkstr(整页源码)——走明文、不带 hex=1,值统一过 mkstr();同名直接覆盖,所以也是改页面最省事的办法(铁哥 2026-09-29 亲授)。
resid 必须是 域.名 两段式,wb=1 才返回 JSON;isnew 为 0 说明同名已存在,这次走的是更新分支(不会重复插库)。界面类资源最终落到页面上:被 tempx 引用、被页面引入,最后交给浏览器渲染。改它 = 改模板定义 + 重新 savetempdata 落盘。引用的公共 CSS/JS 要做成输出型 funx,不能直接往站点传文件。
用 setmark 在主表 coode_iconset 里查到这一条
库里正文是 dTYPE:HEX: 开头的十六进制,要先解出来才是可读原文
被 tempx / 页面引用后由浏览器渲染
看盘上文件是否更新、页面刷新后是否变了
select SNO,* from coode_iconset where setmark='<资源码>';
# 按主键改某列(SNO 用上面查出来的真实值)
POST 本站域名/localxres/funx/savefunc/?fn=SNO:<真实主键>.<列名>@coode_iconset
Cookie: uid=divlovecss; stoken=; deadline=
dt=<这一列的新值>
# 库里正文是 TYPE_HEX 包装的十六进制,解出来才是原文
# Python: bytes.fromhex(值[len('dTYPE:HEX:'):]).decode('utf8') 别在服务器上直接改文件,改本地源再重新提交
同名会走更新分支(isnew=0),不会重复插库
casecode 会被 eval,写错就是静默失败——返回空串要警惕
让别的站能 installpod 装走
改完内容用 savetempdata 回写。它负责替换骨架里的 6 个占位、重算 vermd5、重新落盘 outurl,并自动调 savetoseed 刷索引。
⛔ 返回空串 = 失败(最常见的原因是 casecode 语法错,它内部会 eval,错了就静默不写库)。
POST 本站域名/localxres/funx/savetempdata/
Cookie: uid=divlovecss; stoken=; deadline=
Content-Type: application/x-www-form-urlencoded
domain = xianfa
mark = iconsetx
unittitle = iconsetx 资源图标库
unitclass = content # ★ 自绘页必须 content(list/form/… 会被加 listdemo)
unitdescrib = 云酷德宪法 - iconsetx 资源图标库
stylex = # 留空:公共样式走 cssfiles
scriptx = <script src="/localxres/funx/xianfajs/"></script>
casecode = $utitle="..."; 换行 $tmpcode='...'; # 会被 eval,语法错必失败
tmpcode = <页面主体,< > 写成 { }>
srdcode = <页面骨架,含 {!--thesecomCSSFILES--} 等占位>
cssfiles = /localxres/funx/xianfacss/
jsfiles = /localxres/funx/xianfajs/ # 多个用 ; 分隔
outurl = /localxres/tempx/xianfa/iconsetx.html # ---------- 2. 保存:savetempdata ----------
BODY = html[html.index('<div class="cg-wrap"'):] # 页面主体
SCRIPT = '<script src="/localxres/funx/xianfajs/"></script>'
to_code = lambda s: s.replace('<', '{').replace('>', '}') # coode 码:< > 写成 { }
r = post('savetempdata', {
'domain': DOMAIN, 'mark': 'iconsetx',
'unittitle': 'iconsetx 资源图标库',
'unitclass': 'content', # ★ 自绘页必须是 content
'unitdescrib': '云酷德宪法 - iconsetx 资源图标库',
'stylex': '', # 公共样式走 cssfiles,不内联
'scriptx': nl(SCRIPT),
'casecode': nl('$utitle="iconsetx 资源图标库";' + chr(10) + "$tmpcode='" +
to_code(BODY).replace("'", "'.dyh().'") + "';"),
'tmpcode': nl(to_code(BODY)),
'srdcode': nl(SRD), # 页面骨架,含 {!--thesecomCSSFILES--} 等占位
'cssfiles': '/localxres/funx/xianfacss/',
'jsfiles': '/localxres/funx/xianfajs/', # 多个用 ; 分隔
'outurl': '/localxres/tempx/xianfa/iconsetx.html',
})
print(r) # 返回 '1' = 成功;返回空串 = 失败(多半是 casecode 语法错)unstrs()——\ 反斜杠直接删光(所以别写正则);换行用
;& 会被还原成 &;全角问号会被变半角。casecode 是
形态,必须先还原成真换行再提交,否则 eval 直接语法错。GET 本站域名/localxres/funx/gettempdata/?unitid=xianfa.iconsetx
Cookie: uid=divlovecss; stoken=; deadline= # ---------- 3. 读取:gettempdata ----------
import urllib.request
url = SITE + '/localxres/funx/gettempdata/?unitid=xianfa.iconsetx'
req = urllib.request.Request(url, headers={'Cookie': COOKIE})
print(urllib.request.urlopen(req, timeout=60).read().decode('utf8', 'replace'))可视化编辑器:本站域名/localxres/tempx/tempeditor/index.html?unitid=xianfa.iconsetx
⛔ 编辑器在 tempx 下,不是 csspagex(那只是 CSS 样式模板库)。
只有库 + 盘都存对了,编辑器才取得到内容并能改——这也是「不许直接写文件」的原因。
# 卸载资源
GET 本站域名/localxres/funx/unstallres/?restype=tempx&rescode=xianfa.iconsetx&sysid=0&insmark=xianfa.iconsetx
# 存为种子(刷 resdata 索引,让别的站能装)
GET 本站域名/localxres/funx/savetoseed/?restype=tempx&sysid=0&resmark=xianfa.iconsetx
# 从别的站装过来
GET 本站域名/localxres/funx/installpod/?fromhost=<源站>&restype=tempx&rescode=xianfa.iconsetx&sysid=0insert into coode_sysregres(grpid,restype,resmark,restitle,STATUS,CRTM,UPTM,OLMK)
values('0','tempx','xianfa.iconsetx','iconsetx 资源图标库','0',now(),now(),'...');iconsetx 这种资源本身的主表是 coode_iconset,定位键 setmark;卸载时把 restype 换成 iconsetx 即可。下面每一条都是真跑过、真踩过之后记下来的,按时间正序排列。新发现只往上加,旧的绝不删——同一个资源的认识就是这样一点点变准、变细的。
/localxres/iconsetx/<类型码>//localxres/iconsetx/sysx/(系统资源的头像/海报)、
/localxres/iconsetx/funx/、/localxres/iconsetx/tempx/……
一个资源类型一个目录,不混放。coode_iconset 存什么:不存图片二进制,
只存每一张图的访问地址链接加元信息:setarea=localxres · setmark=资源类型码(新定位下的组名)·
settitle=组标题 · imgmark/imgtitle=图的标记与标题 ·
imgtype=svg/png… · grppath=类型目录 ·
outpath=服务器绝对路径 · outurl=访问地址(引用时用这个) ·
cloudurl=云地址 · imgcode=SVG 源码(可内联)·
vermd5/VRT=版本与校验。setmark 一查就有。
/localxres/iconsetx/<类型码>/
(如 sysx 的图进 /localxres/iconsetx/sysx/);coode_iconset 插一条,
核心是把图的访问地址写进 outurl
(grppath 写类型目录,setmark 写类型码);setmark 查出 outurl 直接用。sysx / appx / layx / pagex(容器类)需要系统头像、层级示意图;funx / sfunx / clsx(函数类)需要函数封面图;tabx / dataspacex / formx(数据类)需要结构示意图;tempx / csspagex / smallcssx(界面类)需要模板预览图、样式缩略图。select imgmark,imgtitle,imgtype,outurl from coode_iconset
where setmark='<类型码>';outurl 直接打开(200 + 图片 MIME),
且 grppath 指向该类型目录。
a.svg~z.svg、0.svg~9.svg,50×50,
渐变圆底 + 白色大字),全部落在 /localxres/iconsetx/sysx/,
主表收录了 36 条地址。savesvgdata(SNO=52251)写盘:
GET imgurl=/localxres/iconsetx/<类型码>/<名>.svg +
POST imgdata=<SVG正文>
→ 内部 overfile(combineurl(localroot(),$imgurl),$imgdata),
目录不存在会自动建;⚠ imgvmark 必须留空,否则走另一条更新分支;newiconset(SNO=52248)登记组:
GET /localxres/funx/newiconset/ 会扫 /localxres/iconsetx/ 下的
目录名当 setmark 写进 coode_iconset(已存在只刷 UPTM);getsvgcode(SNO=52250)读回验收:
GET svgurl=<路径>。setmark=资源类型码(如 sysx)、
imgmark=文件名(如 a)、grppath=类型目录、
outurl=访问地址(引用时用这个)、
outpath=localroot() 拼出来的绝对路径
(千机连 = /www/wwwroot/qianjilian.com)。ls 数文件 + HTTP 逐个访问确认 200 且内容是完整 <svg>…</svg>。
coode_keydetailx.sysshowfun 里引用的所有图标,
统一搬进 /localxres/iconsetx/tabx/ 并把引用地址改过去。
(不是某一个图标,是「某种资源自己的图库」的完整用法 —— 参见第 1 条的新定位。)
① 老路径早已死了:/ORG/BRAIN/images/icon/system/*.svg、
/sysdisk/pubimgs/controller/ 这两个目录在盘上根本不存在(SSH 实测),
HTTP 全是 404。但同名文件几乎都在
/localxres/iconsetx/pagecontrol/ 里(千机连该目录有 1164 个文件)。
→ 老路径按文件名还原即可,不用去别的站搬。
另有 安装.svg / 警示.svg 盘上确实没有,属死引用,按铁哥指示忽略。
② 搬一次就够:以 basename 为目标文件名,天然去重
(ORG/system/detail5.svg 和 pagecontrol/detail5.svg 落到同一个目标)。
本次 84 条去重引用 → 59 个目标文件 → 有源 57 个。
③ 两个 png 搬不了:savesvgdata 源码里写着
if ($kzmx=="svg")< overfile(...) > —— 只认 .svg 扩展名。
edit.png / kill.png 这类要另想办法,别白试。
④ newiconset 只登记目录组,不逐图收录:它 dirlist(/localxres/iconsetx/)
把每个子目录名当一条 setmark 插 coode_iconset,
已存在则只 update UPTM——幂等,放心跑,不会把 pagecontrol 的 1164 个文件灌进去。
本次 tabx 组登记 SNO=2828。
⑤ 主站(divlovecss.com)从本机连不上 HTTP:80/443 被阿里云安全组拦(直连超时,
但 3306 放行、22 放行)。解法是 SSH 进主站再 curl 127.0.0.1 调自己的接口,
记得带 -H "Host: io.halo123.cn"(多域名同 vhost)。
取源内容不落临时文件:curl 源 | curl --data-urlencode imgdata@- 管道打通。
⚠ 顺带提醒:这批任务真正的拦路虎不是图标搬运,而是 savefunc 的 fn 顺序(见 funx 沉淀),
遇到「回执成功但库里没动」先去看那条。
xianfa.iconsetx,落盘 /localxres/tempx/xianfa/iconsetx.html,上面每段代码就是造它自己的真实调用