Skip to content

Commit

Permalink
Update _worker.js
Browse files Browse the repository at this point in the history
  • Loading branch information
jyx04 authored Jun 9, 2024
1 parent 0b6031a commit 80da917
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions _worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ async function verifyTurnstile(responseToken) {
return data.success;
}
async function usermatch(userName, usertype) {
const typeUsers = await KV.get(usertype) || ''; ;
const typeUsers = await KV.get(usertype) || '';
const typeUsersArray = typeUsers.split(","); // 将返回的用户类型字符串分割成数组
return typeUsersArray.includes(userName); // 检查用户名是否在类型用户数组中
}
Expand Down Expand Up @@ -1145,10 +1145,10 @@ async function handleUserPostRequest(request) {

const userRegex = new RegExp(`^${newUsers}_(\\d+)$`);
let fullUserName = newUsers;
const defaultusers = await KV.get("Users");
const vipusers = await KV.get("VIPUsers");
const freeusers = await KV.get("FreeUsers");
const admin = await KV.get("Admin");
const defaultusers = await KV.get("Users")|| '';
const vipusers = await KV.get("VIPUsers")|| '';
const freeusers = await KV.get("FreeUsers")|| '';
const admin = await KV.get("Admin")|| '';
// 合并所有用户
const users = `${defaultusers},${vipusers},${freeusers},${admin}`;
// 自动查找匹配的用户名格式abc_xxx,并添加后缀
Expand Down

0 comments on commit 80da917

Please sign in to comment.