使用openai进行了代码review
This commit is contained in:
@@ -13,10 +13,12 @@ async function hashPassword(password) {
|
||||
}
|
||||
|
||||
async function main() {
|
||||
const password = process.argv[2] || process.env.INIT_DEFAULT_PASSWORD || "admin";
|
||||
|
||||
const count = await prisma.globalSettings.count();
|
||||
if (count === 0) {
|
||||
console.log("Initializing default settings...");
|
||||
const hashedPassword = await hashPassword("admin");
|
||||
const hashedPassword = await hashPassword(password);
|
||||
await prisma.globalSettings.create({
|
||||
data: {
|
||||
id: "default",
|
||||
|
||||
@@ -13,8 +13,9 @@ async function hashPassword(password) {
|
||||
}
|
||||
|
||||
async function main() {
|
||||
console.log("Resetting password to 'admin'...");
|
||||
const hashedPassword = await hashPassword("admin");
|
||||
const password = process.argv[2] || process.env.INIT_DEFAULT_PASSWORD || "admin";
|
||||
console.log("Resetting password...");
|
||||
const hashedPassword = await hashPassword(password);
|
||||
const settings = await prisma.globalSettings.findFirst();
|
||||
|
||||
if (settings) {
|
||||
|
||||
Reference in New Issue
Block a user