feat(store): 添加门店、门店验证

This commit is contained in:
R524809
2026-09-04 10:27:29 +08:00
parent 66ca8b496c
commit 70d9d5b92a
19 changed files with 602 additions and 26 deletions
+23
View File
@@ -0,0 +1,23 @@
import { existsSync } from 'node:fs';
import { resolve } from 'node:path';
import { loadEnvFile } from 'node:process';
for (const directory of [process.cwd(), resolve(process.cwd(), '..'), resolve(process.cwd(), '../..')]) {
const path = resolve(directory, '.env');
if (existsSync(path)) {
loadEnvFile(path);
break;
}
}
function required(name: string): string {
const value = process.env[name];
if (!value) throw new Error(`${name} is required`);
return value;
}
export const workerConfig = {
databaseUrl: required('DATABASE_URL'),
redisUrl: required('REDIS_URL'),
storeSecretEncryptionKey: required('STORE_SECRET_ENCRYPTION_KEY'),
};