Files
playbook/skills/tsl-api-reference/references/codegen/builtin/system/platform.md
T
csh e1f7ce052c feat(skills): add tsl api reference skill
Bundle the TSL API index and markdown references under the skill, route TSL docs to use it, and update the codegen index generator to maintain the bundled data.
2026-07-07 16:36:15 +08:00

1.2 KiB

Builtin - 系统 / 平台与客户端

userName()

返回当前的用户。

返回:string

functionType()

当前运行的函数的类型。即返回当前函数是公用函数,还是用户函数。

返回:integer

functionName()

当前运行的函数的名称

返回:string

userConfig(section, ret_type)

返回用户的配置信息,Section为配置名,RetType用于指定返回的类型,0为字符串,1为数字,2为日期类型。注:此函数为特殊用途。

参数 类型 说明
section string 字符串,配置名。
ret_type integer 整数,返回类型。

返回:real|string|tdatetime

sudo(uid, exp)

以UID指定的用户执行EXP表达式,该EXP为隐式表达式,例如SUDO(“system”,DoSomeThing()),如用户需要用显式的表达式,采用SUDO(UID,Eval(Exp))即可。SUDO和User不一样,SUDO需要有权限,而且SUDO是完全以指定用户来执行,访问的数据资源等均以指定的UID来运行。与SetUID不一样的地方是SUDO执行完EXP后用户ID便恢复成原始的ID。

参数 类型 说明
uid string 字符串,用户名。
exp expression 表达式。

返回:any