t-comm
Version:
专业、稳定、纯粹的工具库
17 lines (16 loc) • 584 B
TypeScript
/**
* 支持预发布环境切换。
*
* 检测当前页面 URL 中的 `tip_debug_cgi_env` 参数,自动将环境标识写入 `sessionStorage`:
* - 当 URL 包含 `tip_debug_cgi_env=prod` 时,将环境设置为正式环境(写入 sessionStorage)。
* - 当 URL 包含 `tip_debug_cgi_env=test` 时,移除环境标识(回退到测试环境)。
*
* > 仅在浏览器环境下生效,SSR / Node 环境中会直接跳过。
*
* @example
* ```ts
* // 在应用入口处调用
* supportPrePublish();
* ```
*/
export declare function supportPrePublish(): void;