feat: add adminContact && DEFAULT_SEND_BALANCE (#162)

This commit is contained in:
Dream Hunter
2024-04-26 00:21:43 +08:00
committed by GitHub
parent b058a1bd12
commit f624fe5b58
17 changed files with 175 additions and 110 deletions

View File

@@ -23,13 +23,14 @@ export const getPasswords = (c) => {
// check if PASSWORDS is an array, if not use json.parse
if (!Array.isArray(c.env.PASSWORDS)) {
try {
return JSON.parse(c.env.PASSWORDS);
let res = JSON.parse(c.env.PASSWORDS);
return res.filter((item) => item.length > 0);
} catch (e) {
console.error("Failed to parse PASSWORDS", e);
return [];
}
}
return c.env.PASSWORDS;
return c.env.PASSWORDS.filter((item) => item.length > 0);
}
export const getAdminPasswords = (c) => {