Skip to content

Commit e198afb

Browse files
authored
Merge pull request cmliu#868 from cmliu/beta2.0
fix: 修正用户ID生成逻辑,确保UUID格式正确
2 parents 0d1e9dd + 820abe7 commit e198afb

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

_worker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export default {
1313
const userIDMD5 = await MD5MD5(管理员密码 + 加密秘钥);
1414
const uuidRegex = /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$/;
1515
const envUUID = env.UUID || env.uuid;
16-
const userID = (envUUID && uuidRegex.test(envUUID)) ? envUUID.toLowerCase() : [userIDMD5.slice(0, 8), userIDMD5.slice(8, 12), '4' + userIDMD5.slice(13, 16), userIDMD5.slice(16, 20), userIDMD5.slice(20)].join('-');
16+
const userID = (envUUID && uuidRegex.test(envUUID)) ? envUUID.toLowerCase() : [userIDMD5.slice(0, 8), userIDMD5.slice(8, 12), '4' + userIDMD5.slice(13, 16), '8' + userIDMD5.slice(17, 20), userIDMD5.slice(20)].join('-');
1717
const host = env.HOST ? env.HOST.toLowerCase().replace(/^https?:\/\//, '').split('/')[0].split(':')[0] : url.hostname;
1818
if (env.PROXYIP) {
1919
const proxyIPs = await 整理成数组(env.PROXYIP);

0 commit comments

Comments
 (0)