File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed
Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -131,14 +131,16 @@ export const convertVal = val => {
131131 }
132132
133133 // 检测是否数字并避免数值溢出
134- if ( / ^ \d + $ / . test ( val ) ) {
135- const parsedNum = Number ( val )
136- // 如果数值大于 JavaScript 最大安全整数,则作为字符串返回
137- if ( parsedNum > Number . MAX_SAFE_INTEGER ) {
138- return val + ''
139- }
140- return parsedNum
134+ if ( / ^ \d + $ / . test ( val ) ) {
135+ const parsedNum = Number ( val )
136+ // 【关键修正】对于扣子 Bot ID 或 PAT Token(以 pat_ 开头的),强制返回字符串
137+ // 或者如果数值超过最大安全整数,也返回字符串
138+ const isCozeRelated = val . startsWith ( 'pat_' ) || val . length > 15 // 长度超过15的数字ID强制字符串
139+ if ( parsedNum > Number . MAX_SAFE_INTEGER || isCozeRelated ) {
140+ return val + ''
141141 }
142+ return parsedNum
143+ }
142144
143145 // 检测是否为布尔值
144146 if ( val === 'true' || val === 'false' ) {
You can’t perform that action at this time.
0 commit comments