★ 宪法总纲:编辑任何资源的唯一正确姿势

★ 建站顺序另见《云酷德建站流程法》(tempx buildlaw.index,打开章程,2026-10-05 定稿):先名后形 → 计划六表 → 补正 → 开工 → newresname 建名 → 照 funtxt 施工 → samekdatatotab 回填 → 验收。

以前文档里写的是「直接调 API 接口」——那是旧约,作废。所有资源的增删改,一律按下述六步走。

  1. 先登录,拿三件套
    GET 本站域名/localxres/funx/commonlogin/?uid=<账号>&pass=<makepass密文>&sysid=<系统id>
    返回 JSON 的 msg 就是 stoken。随后 Cookie 必须带 三个值:uid、stoken、deadline=time()+3600*72。
    坑:只带 uid+stoken、不带 deadline,会被 heartbeat 的 $leftt>0 拦掉,现象是 302 静默跳转,接口返回空。
  2. 建资源名
    funx.newresname?restype=<类型>&rescode=<域.名>&sysid=<系统>&restitle=<标题>
    Cookie 里的 uid 在 coode_userlist 中必须 PRIME=1。tempx 的 rescode 若含点号,点前是域、点后是单元名;不含点号则自动补 .index。
  3. 查编辑器地址
    到 coode_sysrestypedefine 按 restypecode 查 cloudpath 字段——它就是该类型资源的编辑器地址。
    分水岭:cloudpath 值为 mysql 的,说明这类资源基本不落盘,可以直接改数据;值是一条 URL 的,说明会落盘,必须进编辑器改,直接改库会造成库盘不一致。
  4. 打开编辑器
    编辑器地址不用猜、不用记——去 coode_sysrestypedefine 找到该 restypecode 那一行,读它的 cloudpath 字段,那就是现成的完整编辑器地址,? 后面已经把参数位留好了;你要做的只是把占位符换成资源名或该数据的 SNO 序号。
    三个完整地址示例:
    https://qianjilian.com/localxres/tempx/tempeditor/index.html?unitid=xianfa.index
    https://qianjilian.com/localxres/pagex/htmleditor/WrvLoe/index.html?funid=savefunc
    https://qianjilian.com/localxres/pagex/htmleditor/WrvLoe/index.html?funid=coode_funsetfile@SNO:12345.funfull
  5. 编辑器里能调哪些后端方法
    由 coode_funlist 的 usearea 字段声明:它写明该方法允许被哪个页面调用,形如 tempx.tempeditor.index。
    heartbeat 会把 HTTP Referer 解析成 pgmark(资源类型.目录.单元),拿它和 usearea 比对,不匹配直接判无权。所以「在哪个页面里调」不是形式,是权限本身。
    usearea 为空 = 不限制来源,可从外部调用(如 newresname、savetoseed、makelayfolder)。
  6. 鉴权在哪
    数据集 heartbeat 的 refreshtoken 方法:校验 stoken 是否有效、刷新 coode_loginstoken 有效期、并下发 deadline。所有「为什么明明登录了还是没权限」的答案都在这里。

26 类资源:编辑器完整地址 / 能不能直接改库

下表「编辑器 / 落点」列即 coode_sysrestypedefine.cloudpath 的值(已补全域名前缀),可直接复制使用。

类型主表编辑器 / 落点(完整地址)
funx 函数coode_funlisthttps://qianjilian.com/localxres/pagex/htmleditor/WrvLoe/index.html?funid=<函数名>
clsx 类coode_phpclshttps://qianjilian.com/localxres/pagex/htmleditor/WrvLoe/index.html?funid=<类名>
sfunx 函数集coode_funsetfilehttps://qianjilian.com/localxres/pagex/htmleditor/WrvLoe/index.html?funid=coode_funsetfile@SNO:<该数据序号>.funfull
dfunx 数据函数coode_datafunhttps://qianjilian.com/localxres/pagex/htmleditor/WrvLoe/index.html?funid=coode_funsetfile@SNO:<该数据序号>.funfull
constx 静态量coode_sysconstanthttps://qianjilian.com/localxres/pagex/htmleditor/WrvLoe/index.html?funid=coode_funsetfile@SNO:<该数据序号>.funfull
configx 系统参数coode_sysconfighttps://qianjilian.com/localxres/pagex/htmleditor/WrvLoe/index.html?funid=coode_funsetfile@SNO:<该数据序号>.funfull
tempx 模板coode_domainunithttps://qianjilian.com/localxres/tempx/tempeditor/index.html?unitid=<域.单元>
pagex 页面coode_tinyhttps://qianjilian.com/localxres/tempx/tinylayeditor/index.html?unitid=<域.单元>&tinyid=<tinymark>
mfunx 分布函数coode_multifunlisthttps://qianjilian.com/localxres/tempx/tinylayeditor/index.html?unitid=resuptool.index&tinyid=o16CUI
tabx 表coode_tablisthttps://qianjilian.com/localxres/funx/anyjsshort/?stid=2qPIqS-sfile:anyjsshort.php-&pnum=150:<表名>&page=1:TABLE_NAME&
formx 表单coode_shortdatahttps://qianjilian.com/localxres/funx/anyjsshort/?datatype=html&stid=keydtly-&pnum=100:<shortid>&page=1:shortid&
dataspacex 数据空间coode_dataspacehttps://qianjilian.com/localxres/tempx/dspcmgr/index.html
sysx 系统容器coode_sysinformationmysql:不落盘,可直接改库
appx 应用容器coode_appdefaultmysql:不落盘,可直接改库
layx 输出容器coode_applaymysql:不落盘,可直接改库
cdtrdrx 条件跳转coode_cdtrdrmysql:不落盘,可直接改库
parardrx 参数跳转coode_parardrmysql:不落盘,可直接改库
groupx 一级分类coode_grouplistmysql:不落盘,可直接改库
plotx 节点coode_plotlistmysql:不落盘,可直接改库
csspagex 样式页面coode_facelistmysql:不落盘,可直接改库
iconsetx 图标库coode_iconsetmysql:不落盘,可直接改库
databasex 数据库coode_dblistmysql:不落盘,可直接改库
afunx 事务函数coode_affairfunlistmysql:不落盘,可直接改库
parax 外部框架coode_paramysql:不落盘,可直接改库
apix 接口密钥coode_apipoolmysql:不落盘,可直接改库
smallcssx 小CSScoode_codedemomysql:不落盘,可直接改库
云酷德宪法/tempx

tempx

模板已验证

前端页面模板。主表 coode_domainunit:domainmark=区块、unitmark=样式(=落盘文件名)、dumark=domainmark.unitmark;templatecode / stylex / scriptx 均 HEX。落盘 /localxres/tempx//.html(另出 -remote.html 给外站引用)。

它是什么

先看懂
界面类:模板经实例化变成页面,最后交给浏览器模板定义coode_domainunit实例化savetempdata 落盘页面 HTML/localxres/tempx/浏览器渲染公共 CSS / JS(做成输出型 funx 供引用)⛔ 站点上不许直接传文件,要用系统方法生成

图:tempx(模板)在云酷德体系里的位置

一句话:前端页面模板。主表 coode_domainunit:domainmark=区块、unitmark=样式(=落盘文件名)、dumark=domainmark.unitmark;templatecode / stylex / scriptx 均 HEX。落盘 /localxres/tempx//.html(另出 -remote.html 给外站引用)。

★ 四件套:anahtmlcode(新建)→ savetempdata(保存)→ gettempdata(读取)。编辑器在 /localxres/tempx/tempeditor/index.html?unitid=域.名,⛔ 不是 csspagex。自绘页 unitclass 一律填 content。

生命周期

四个接口走一圈
资源生命周期:建 → 存 → 读 → 卸(四个接口,走完一圈)anahtmlcode新建·拆骨架·落盘savetempdata保存·刷索引·回写gettempdata读取·编辑器取回unstallres卸载·摘掉资源

所有资源都是这套节奏:先建,再存,要改就取回来改,不用了就卸载

元信息

先认表
类型码
tempx
中文名
模板
主表
coode_domainunit
定位键
dumark
落盘目录
/localxres/tempx/
库内条数
867

主表字段(coode_domainunit,共 14 个起):
SNO sysid appid relyface unittitle unitclass funcls frmexp darela colora unitmark domainmark dumark unitdescrib…

主表速查 SQL复制
select * from coode_domainunit where dumark='tempx';

创建

anahtmlcode
1
准备一份成品 HTML

含 head 里要引的 css/js,以及完整 body;本地先拼好再提交

2
正文转 HEX

'dTYPE:HEX:' + html.encode('utf8').hex() —— 中文走明文会被 unstrs() 改字符

3
POST 到 anahtmlcode

带 resid=域.名、wb=1、sysid=0,必须带 Cookie

4
看返回值确认

wbinfo.isnew=1 才是真新建,fileok=1 说明盘上已落

第一次新建走 anahtmlcode:给它一份完整成品 HTML,它会自己拆成 样式 / 脚本 / 主体 / 骨架,写进 coode_domainunit,并落盘 /localxres/tempx/xianfa/tempx.html。
这一步就把「库 + 盘 + 索引」都建好了,不要自己插 SQL、不要 SFTP 传文件。

用 askapi 创建

万能通道 · 含必填字段

除了本类型自己的专用接口,26 种资源全部可以走同一个入口:funx.askapi。
它怎么知道每种资源该填哪些字段'+String.fromCharCode(65311)+'——看这两张表:
coode_asklist(datamark=<类型码>_<操作>,记录作用在哪个主表、定位键是哪个)
coode_askkey(同 datamark,逐字段记录字段名、中文名、fromurl=GET / POST / VIEW)。
所以「这个资源要建哪些字段」不用猜,查这两张表就有。

必填字段含义提交方式类型说明
dumark资源识别码POSTvarchar★ 定位键——整个资源靠它被找到;fullinfo / view 都得拿它当<定位值>
unittitle单元标题POSTvarchar资源的中文名(标题/别名)。必填,但随时可改——改走 fullinfo 或 setbtn
sysid系统IDPOSTvarchar所属系统ID。公共资源填 0(云酷德运行时);填了具体 sysid 就归到那个系统名下
srctype资源类型POSTvarchar资源类型码,固定填 tempx,不要拼错
规律:26 种资源的 crtres 基本都只要这四样——定位键(dumark)+ 标题 + sysid(公共资源填 0)+ srctype(填资源类型码 tempx)。剩下的字段建完再用 optype=fullinfo 补。
本类型实测 4 个必填字段(上表即全部)。
HTTP · 创建(tempx)复制
POST 本站域名/localxres/funx/askapi/?optype=crtres&stype=tempx
Cookie: uid=divlovecss; stoken=; deadline=
Content-Type: application/x-www-form-urlencoded
dumark=<值>
unittitle=<值>
sysid=<值>
srctype=<值>
# 返回:{"status":"1","msg":"已创建 … 共 N 个字段(权限已放行)","redirect":"<定位键值>"}
# status=0 的两种情况:
#   1. 缺少定位值 dumark   -> 必须提交这个字段
#   2. 资源已存在:XXX      -> 别重复插,改值走 fullinfo / setbtn
创建之后:补全字段 / 读取 / 生成文件复制
# ① 补全其余字段(一次可改多个)
POST 本站域名/localxres/funx/askapi/?optype=fullinfo&stype=tempx&dumark=<定位值>
Cookie: uid=divlovecss; stoken=; deadline=
Content-Type: application/x-www-form-urlencoded
<字段名>=<新值>&<字段名2>=<新值2>
# ② 读回来看看对不对
GET  本站域名/localxres/funx/askapi/?optype=view&stype=tempx&dumark=<定位值>
Cookie: uid=divlovecss; stoken=; deadline=
# ③ 让它落盘成真正的资源文件
GET  本站域名/localxres/funx/askapi/?optype=mkfile&stype=tempx&code=<定位值>
Cookie: uid=divlovecss; stoken=; deadline=
#   函数类 -> /localxres/tempx/<code>/index.php
#   模板类 -> /localxres/tempx/<code>/index.html
#   force=1 强制重写(默认文件缺失或为空才写)
# ④ 查这个类型到底有哪些字段可写
select keyname,keytitle,fromurl from coode_askkey where datamark='tempx_fullinfo' order by SNO;
optype干什么说明
crtres新建资源插一条记录到主表,并自动给你放开发权限(coode_devespace)
fullinfo改多个字段按定位键找到记录,一次改掉提交上来的所有可写字段
view读取一条按定位键取出这条记录的主字段
viewext读取扩展取出关联的扩展信息(子项、依赖面等)
setbtn按钮写值改少量字段(通常是开关、状态位)
mkfile生成资源文件按类型生成落盘文件:函数类 index.php、模板类 index.html,其余生成数据出口
fromurl 三种值:GET=从 URL 参数取值、POST=从表单体取值、VIEW=只展示不写库。crtres 时 VIEW 字段会被跳过,所以创建后它们还是空的——这正是要接着走 fullinfo 的原因。
HTTP · 新建复制
POST 本站域名/localxres/funx/anahtmlcode/
Cookie: uid=divlovecss; stoken=; deadline=
Content-Type: application/x-www-form-urlencoded
resid     = xianfa.tempx
htmlcode  = dTYPE:HEX:<完整 HTML 的十六进制>      # ★ 中文必须 hex,明文会被 unstrs 改字符
hex       = 1
wb        = 1                                     # 返回 JSON
unittitle = tempx 模板
sysid     = 0                                     # 顺手登记 coode_sysregres
返回 · JSON复制
{"status":"1","msg":"生成成功","redirect":"",
 "wbinfo":{"resid":"xianfa.tempx","outurl":"/localxres/tempx/xianfa/tempx.html",
           "isnew":1,"fileok":1,"bytes":32110,"regok":1}}
Python · 完整可跑(含公共库)复制
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('tempx.html', encoding='utf8').read()
r = post('anahtmlcode', {
    'resid':     'xianfa.tempx',              # 域.名 -> 落盘 /localxres/tempx/xianfa/tempx.html
    'htmlcode':  tohex(html),               # 完整成品页(含 <head> 里的 css/js 引用)
    'hex':       '1',
    'wb':        '1',                       # 返回 JSON:isnew / fileok / bytes / regok
    'unittitle': 'tempx 模板',
    'sysid':     '0',                       # 顺手登记进 coode_sysregres
})
print(r)      # isnew:1 才是真新建;isnew:0 说明同名已存在,走的是更新分支

不想写脚本'+String.fromCharCode(65311)+'用可视化通道:打开 本站域名/localxres/tempx/abhtmlcode/index.html?resid=xianfa.tempx(页面标题就叫「html代码吸收器」),把整页 HTML 粘进文本框点提交即可。
它其实就是 anahtmlcode 的前端壳,提交的是 resid=<域.名>&htmlcode=mkstr(整页源码)——走明文、不带 hex=1,值统一过 mkstr();同名直接覆盖,所以也是改页面最省事的办法(铁哥 2026-09-29 亲授)。

参数要点:resid 必须是 域.名 两段式,wb=1 才返回 JSON;isnew 为 0 说明同名已存在,这次走的是更新分支(不会重复插库)。

怎么调用

用起来

界面类资源最终落到页面上:被 tempx 引用、被页面引入,最后交给浏览器渲染。改它 = 改模板定义 + 重新 savetempdata 落盘。引用的公共 CSS/JS 要做成输出型 funx,不能直接往站点传文件。

1
定位它

用 dumark 在主表 coode_domainunit 里查到这一条

2
取内容

库里正文是 dTYPE:HEX: 开头的十六进制,要先解出来才是可读原文

3
真正使用

被 tempx / 页面引用后由浏览器渲染

4
确认生效

看盘上文件是否更新、页面刷新后是否变了

取一条记录出来看复制
select SNO,* from coode_domainunit where dumark='<资源码>';
# 按主键改某列(SNO 用上面查出来的真实值)
POST 本站域名/localxres/funx/savefunc/?fn=SNO:<真实主键>.<列名>@coode_domainunit
Cookie: uid=divlovecss; stoken=; deadline=
dt=<这一列的新值>
# 库里正文是 TYPE_HEX 包装的十六进制,解出来才是原文
# Python:  bytes.fromhex(值[len('dTYPE:HEX:'):]).decode('utf8')

维护 / 保存

savetempdata
1
改本地那份 HTML

别在服务器上直接改文件,改本地源再重新提交

2
重新 anahtmlcode

同名会走更新分支(isnew=0),不会重复插库

3
savetempdata 回写

casecode 会被 eval,写错就是静默失败——返回空串要警惕

4
savetoseed 刷索引

让别的站能 installpod 装走

改完内容用 savetempdata 回写。它负责替换骨架里的 6 个占位、重算 vermd5、重新落盘 outurl,并自动调 savetoseed 刷索引。
⛔ 返回空串 = 失败(最常见的原因是 casecode 语法错,它内部会 eval,错了就静默不写库)。

HTTP · 保存复制
POST 本站域名/localxres/funx/savetempdata/
Cookie: uid=divlovecss; stoken=; deadline=
Content-Type: application/x-www-form-urlencoded
domain      = xianfa
mark        = tempx
unittitle   = tempx 模板
unitclass   = content              # ★ 自绘页必须 content(list/form/… 会被加 listdemo)
unitdescrib = 云酷德宪法 - tempx 模板
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/tempx.html
Python · 完整可跑复制
# ---------- 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': 'tempx',
    'unittitle': 'tempx 模板',
    'unitclass': 'content',                 # ★ 自绘页必须是 content
    'unitdescrib': '云酷德宪法 - tempx 模板',
    'stylex': '',                           # 公共样式走 cssfiles,不内联
    'scriptx': nl(SCRIPT),
    'casecode': nl('$utitle="tempx 模板";' + 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/tempx.html',
})
print(r)      # 返回 '1' = 成功;返回空串 = 失败(多半是 casecode 语法错)
提交前必须消毒:每个字段都会过 unstrs()——\ 反斜杠直接删光(所以别写正则);换行用 ;& 会被还原成 &;全角问号会被变半角。
另外从库里取回的 casecode 是 形态,必须先还原成真换行再提交,否则 eval 直接语法错。

详情 / 读取

gettempdata
HTTP · 读取复制
GET 本站域名/localxres/funx/gettempdata/?unitid=xianfa.tempx
Cookie: uid=divlovecss; stoken=; deadline=
Python · 读取复制
# ---------- 3. 读取:gettempdata ----------
import urllib.request
url = SITE + '/localxres/funx/gettempdata/?unitid=xianfa.tempx'
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.tempx
⛔ 编辑器在 tempx 下,不是 csspagex(那只是 CSS 样式模板库)。
只有库 + 盘都存对了,编辑器才取得到内容并能改——这也是「不许直接写文件」的原因。

卸载 / 同步

unstallres · savetoseed
HTTP · 三件套复制
# 卸载资源
GET 本站域名/localxres/funx/unstallres/?restype=tempx&rescode=xianfa.tempx&sysid=0&insmark=xianfa.tempx
# 存为种子(刷 resdata 索引,让别的站能装)
GET 本站域名/localxres/funx/savetoseed/?restype=tempx&sysid=0&resmark=xianfa.tempx
# 从别的站装过来
GET 本站域名/localxres/funx/installpod/?fromhost=<源站>&restype=tempx&rescode=xianfa.tempx&sysid=0
登记表 · sysregres复制
insert into coode_sysregres(grpid,restype,resmark,restitle,STATUS,CRTM,UPTM,OLMK)
values('0','tempx','xianfa.tempx','tempx 模板','0',now(),now(),'...');
注意:本页讲的是「用 tempx 通道生成页面型资源」。tempx 这种资源本身的主表是 coode_domainunit,定位键 dumark;卸载时把 restype 换成 tempx 即可。

实操备注 / 踩坑沉淀

共 12 条 · 只增不删

下面每一条都是真跑过、真踩过之后记下来的,按时间正序排列。新发现只往上加,旧的绝不删——同一个资源的认识就是这样一点点变准、变细的。

1接口回「生成成功」,库里却一条记录都没有2026-09-29
现象:anahtmlcode 返回 JSON 里 wbinfo.isnew=1、页面显示「生成成功」,但 coode_domainunit 里查不到这条,落盘文件也没有。

原因:它的 insert 是裸拼 SQL、全程无转义:'$utitle','$um',...,'".gohex($bodyo)."',...。正文里只要有一个裸单引号(SQL 示例 where key='xxx'、Python 里的 'utf8'),整条 insert 就被拼串炸掉。而 $isnew="1" 是无条件赋值的,SQL 炸没炸它都回成功。

修法:提交前把正文里的 ' 写成 '——浏览器照样显示单引号,SQL 也安全。

验收:别信返回值,直接 select length(pagehtml),length(casecode),cssfilex from coode_domainunit where dumark='域.名',字段有长度才算真写进去。
2gohex() 被正文里的 TYPE:HEX: 骗过,导致存的是明文2026-09-29
现象:26 个资源页「入库了但没数据」——coode_domainunit 里 31 条记录都在,但 pagehtml / casecode / VRT 全是 0,cssfilex 连扩展名都没有。

原因(最隐蔽):gohex() 在 localxres/EARTH.php:948,写法是 if (strpos($vlsx,"TYPE:HEX:")>0) < return $vlsx; >——内容里只要出现过 TYPE:HEX: 就原样放行、根本不转 HEX。而 API SDK 的正文里满屏都是 dTYPE:HEX: 教学字样,于是明文入库 → 裸拼 SQL → $tmpcode='...' 的包裹引号直接炸。

修法:把正文里的 TYPE:HEX: 写成 TYPE:HEX:,显示一模一样,gohex 就重新生效。

验收:查 length(casecode) 非 0,且 cssfilex 带扩展名。
3改了公共 CSS,页面却一点没变2026-09-29
现象:本地把 api_style.css 加了一堆新类,重新生成页面,线上样式纹丝不动,抓下来的 CSS 还是旧字节数。

原因:资源不是文件——公共 CSS/JS 是做成「输出型 funx」存在 coode_funlist 里的,HTTP 请求每次从库里取。改本地文件不等于改资源,必须重新 savefunc 提交一次。

修法:python savefunx.py --fn xianfacss --file _xianfa/api_style.css --ctype css --go --force,然后 curl 端点确认 Content-Type 和字节数变了。

验收:curl -I <本站域名>/localxres/funx/xianfacss/?.css → 200 + text/css + 新字节数。
4CSS/JS 引用形态:必须是「目录/?.扩展名」,别自作聪明2026-09-29
✅ /localxres/funx/xianfacss/?.css → 200,Content-Type: text/css
❌ /localxres/funx/xianfacss/xianfacss.css → 404

那个 ? 不是查询串,是端点用来识别「你要输出什么类型」的标记,系统能识别也能保存。
这条我(大莲)踩过两次、被铁哥纠正两次,别再动它。判断是否生效看实际渲染结果:如果四大分类以外的区域显示都正常,说明渲染后的结果是对的,CSS 没问题。
5资源登记了,别的站却装不走2026-09-29
现象:funx / tempx 都能用,但别的站 installpod 装不到。

原因:两件事缺一不可——① 在 coode_sysregres 里登记(grpid / restype / resmark / restitle / STATUS / OLMK);② 调 savetoseed 刷 vermd5(种子索引靠它判断有没有新版本)。

修法:先 insert into coode_sysregres(...),再 GET /localxres/funx/savetoseed/?restype=funx&sysid=0&resmark=<名>。

验收:查 coode_funlist.vermd5 从空变成一串 md5;别站 installpod 能拉到。
6abhtmlcode 是 anahtmlcode 的可视化壳,改 tempx 更省事2026-09-29
地址:<本站域名>/localxres/tempx/abhtmlcode/index.html?resid=xianfa.<名>
提交:resid=域.名 + htmlcode=mkstr(整页源码)——明文提交、不带 hex=1、同名直接覆盖,适合改已经存在的页面。
想整页重建就用 anahtmlcode(带 hex),想改一版就用它。
7页面正文里写 mkstr 字符表,会把 savetempdata 炸成空串2026-09-29
现象:savetempdata 返回空串(不是 1),查库 casecode=0, 而且 cssfilex 里的扩展名被截掉(只剩 /localxres/funx/xianfacss/, 少了 ?.css)。

原因:页面正文里写了 mkstr 的字符替换表当教学示例 (反斜杠→↘、换行→卍、&→δ、单引号→ノ …), 服务端 unstrs() 会把它们原样还原成真实字符—— 还原出来的反斜杠和换行塞进 casecode 的 PHP 单引号串里,语法直接炸。

修法:教这些字符时写成 HTML 实体: \ ↘ 卍 δ ノ —— 显示一模一样,但 unstrs 认不出来。 (本 SDK 的 _build_all.py 里 mkstr_safe() 就是干这个的。)

验收:select length(casecode),cssfilex from coode_domainunit where dumark='域.名' —— casecode 有长度,且 cssfilex 完整带着 ?.css。
8输出型 funx 的 CSS/JS 被浏览器缓存 1 小时(max-age=3600),改了一直不生效2026-09-29
现象:重新提交了公共 CSS(字节数都变了),对方浏览器里页面还是旧样式—— 普通刷新(F5)也没用,过一阵子自己又好了。

原因(查响应头实锤):输出型 funx 的端点会发 Cache-Control: public, max-age=3600 —— CSS/JS 被浏览器缓存整整一小时。 这一小时里你重新提交多少次,对方看到的都是缓存里的旧版。 (铁哥 2026-09-29 亲验:「四大分类好了,css方法用的缓存」——加 rnd 之后立刻生效。)

修法(三件套):
① 页面间 .html 链接统一带 ?rnd=<构建时间戳>;
② CSS/JS 引用带 ?.css&rnd=<时间戳>(实测 200 text/css,端点兼容, &rnd 不影响 ? 的类型识别);
③ 库里 cssfilex 仍存干净的 ?.css,rnd 只出现在页面引用上。
本 SDK 的 _build_all.py 用 RND = str(int(time.time())) 每次构建自动换。

注意:系统渲染版会把 link 改写成 ?123.css(自带版本号), 但版本号不随内容变,挡不住 max-age=3600 —— rnd 仍然必要。

验收:抓线上页面,link href 里带 &rnd=; Edge 无头渲染 document.styleSheets 规则数 > 0、.cg-cat 计算样式生效。
9tempx 走 askapi:四个必填字段与复合唯一键的坑2026-09-29
26 种资源建 dispatch 之外,tempx 也有自己的 askapi 通道,位置在页面「创建」小节里的用 askapi 创建。

tempx 的 crtres 四个必填:dumark(定位键,必须是域.名两段式)、 unittitle(中文标题)、sysid(公共填 0)、srctype(固定 tempx)。
这里的坑:dumark 在系统里是复合唯一键(domainmark + unitmark), askapi 内部做了 tempx 特判——把 dumark 按点号拆成两半写进去,所以提交时必须带点号, 写成单段会落到 domainmark 为空的记录上。

分工要清楚:anahtmlcode 才负责把正文/样式/骨架全部写好并落盘 index.html; askapi 的 crtres 只是先站个坑(插一条记录 + 放权限)。 要补全内容,顺序是 crtres → fullinfo → mkfile(force=1)。
10提交体的真实加工:mkstr 表 + turnlab 反向2026-09-29
★ 提交体的真实加工方式(2026-09-29 实测确证)
后端收到的不是原文,是前端 mkstr 加工过的字符串,服务端 unstrs() 再还原成真字符入库。想让自己的脚本和编辑器一模一样,就照这张表加工:
' → ノ · & → δ · = → = · ? → '+String.fromCharCode(65311)+' · + → + · \ → ↘(⚠ 裸反斜杠会被 unstrs 直接删光,必须编码)· 换行 → 卍
HTML 模板字段(casecode / tmpcode)再叠加 turnlab 反向:< → <、> → >。
⛔ 别对 scriptx / savefunc 的 dt 做 turnlab —— 真实提交体里 scriptx 保留真 <script> 标签;PHP/JS 代码里的花括号会被 turnlab 误伤成尖括号。

⚠ 反面教材(我自己踩的):为了躲开单引号炸裸拼 SQL,我用 HTML 实体 ' → ' 提交。结果 unstrs() 只认 & → &、不认 ',实体原样留在库里 ——对比可见:真编辑器产物 dspcmgr.index 存的是真单引号,而我生成的页面里残留了 '。浏览器照样渲染所以肉眼看不出来,但这段内容再被 PHP / 模板二次处理时可能炸。

参数清单:新建/保存 tempx 走 anahtmlcode / savetempdata,参数共 13 个:domain mark unittitle unitclass unitdescrib stylex scriptx casecode tmpcode srdcode jsfiles cssfiles outurl;savefunc 只有 dt 一个。
11tempeditor(tempx 编辑器)到底怎么保存参数:stylex/scriptx 必须自带标签(2026-10-01 铁哥要求永久记忆)2026-10-01

需求:搞清 tempx 编辑器(tempeditor)到底怎么保存参数 —— 铁哥 2026-10-01 要求永久强烈记忆。

编辑器地址:/localxres/tempx/tempeditor/index.html?unitid=tdfindpg.index (unitid = <domainmark>.<unitmark>)。

真实提交串(解码编辑器 scriptx.js 得到):

updatex = ajaxhtmlpost("/localxres/funx/savetempdata/?clone="+clo,
  "domain="+dm+"&mark="+mk+"&unittitle="+unittitle+"&unitclass="+uclass
  +"&unitdescrib="+udescrib
  +"&stylex="+mkstr(stylex)+"&scriptx="+mkstr(scriptx)
  +"&casecode="+mkstr(casecode)+"&tmpcode="+mkstr(tmpcode)+"&srdcode="+mkstr(srdcode)
  +"&jsfiles="+mkstr(fmjs)+"&cssfiles="+mkstr(fmcss)+"&outurl="+outurl);

要点三条:

① 手工拼 query string,不是 urlencode。过 mkstr() 的只有 stylex / scriptx / casecode / tmpcode / srdcode / jsfiles / cssfiles 这 7 个; unittitle / unitclass / unitdescrib / outurl 原样拼。

② ⛔⛔ stylex 必须自带 <style>…</style>,scriptx 必须自带 <script type="text/javascript">…</script>。 铁哥原话:「你的 tempx 页面测试照片忘加 <stype> 开头和结尾,我加上好用了」。 因为 pagesurround 里只是 <!--thiscomSTYLE--> / <!--thiscomSCRIPT--> 的裸插入,引擎不补标签 —— 传裸 CSS 就当正文文本漏出来(样式全废、页面裸成纯文字),传裸 JS 就整段打在页面上。 提交前包一层即可:'<style>\n'+CSS+'\n</style>'、 '<script type="text/javascript">\n'+JS+'\n</script>'。

③ srdcode = gettempdata 返回的 pagesurround,必传; jsfiles / cssfiles 用 分号 分隔。

验收:抓回线上页面,确认 <style> 里面确实是 CSS、 <script> 里面确实是 JS、且没有裸 CSS 漏在 body 里; 再 unhex(scriptx) 后 grep 新加的类名/变量名(库里是 hex,别拿明文搜)。

配套:funx 那边的编辑器是 htmleditor,协议见 funx 资源页 (只有一个 dt 字段,必须 mkstr)。

12★★ 铁律:涉及保存参数就先现场扒编辑器;tempeditor 实际有四条提交路径(含 quick=1 与反向保存)2026-10-01

铁哥 2026-10-01 定的铁律:「以后只要涉及 tempx、funx 如何传参保存, 就找各自的前端编辑器页面重新寻找实现过程」。本条是 tempx 侧的落地。

做法:提交前先跑 python ~/.workbuddy/skills/coode-tempx/scripts/editorsrc.py --which tempx, 把 tempeditor.index 的源码解码落盘并打印保存串,以打印出来的为准。

2026-10-01 现场扒到的完整端点清单(以前我只记了「存」一条,实际有四条路):

① L108 读取:/localxres/funx/gettempdata/?unitid=<d>.<m>

② L260 保存:/localxres/funx/savetempdata/?clone=<clo>, 参数 domain mark unittitle unitclass unitdescrib stylex scriptx casecode tmpcode srdcode jsfiles cssfiles outurl

③ ⭕ L309 快速保存:savetempdata/?quick=1&clone=<clo> —— 参数与 ② 完全一样,只多一个 quick=1,这是以前没记的分支

④ ⭕ L271 反向保存:/localxres/funx/fanxiangtempdata/, 只有三个参数 domain / mark / rmthtml=mkstr(rmthtml)(把成品 HTML 反推回模板),新发现的端点

另有 anyjsshort/、visitpath/ 用于预览渲染。

不变的两条硬规矩:

⛔⛔ stylex 必须自带 <style>…</style>、 scriptx 必须自带 <script type="text/javascript">…</script> (pagesurround 是裸插入,引擎不补标签;铁哥:「忘加 <stype> 开头和结尾」)。

⛔ 过 mkstr() 的只有那 7 个字段,unittitle / unitclass / unitdescrib / outurl 原样拼; jsfiles / cssfiles 用分号分隔;srdcode 必传。

云酷德宪法 · 本页是 tempx 资源 xianfa.tempx,落盘 /localxres/tempx/xianfa/tempx.html,上面每段代码就是造它自己的真实调用
操作方法会随造系统的过程持续补充——每实操一次,就回来补一段