fix: fix mark bugs

This commit is contained in:
2025-03-29 18:24:00 +08:00
parent 12aa9022c4
commit d8d78d184b
5 changed files with 17 additions and 15 deletions

View File

@@ -1,13 +1,16 @@
import path from 'path';
import dotenv from 'dotenv';
// import { useConfig } from '@kevisual/use-config/env';
const envFiles = [
path.resolve(process.cwd(), '.env.dev'),
path.resolve(process.cwd(), '.env'),
path.resolve(process.cwd(), process.env.NODE_ENV === 'development' ? '.env.dev' : '.env'),
// path.resolve(process.cwd(), '.env'), //
];
dotenv.config({
export const config = dotenv.config({
path: envFiles,
});
export const config = process.env;
override: true,
}).parsed;
// const config = useConfig();
// export const config = process.env;
console.log('config', config);
export const port = config.PORT || 4005;

View File

@@ -7,6 +7,7 @@ const minioConfig = {
accessKey: config.MINIO_ACCESS_KEY,
secretKey: config.MINIO_SECRET_KEY,
};
console.log('minioConfig', minioConfig);
export const minioClient = new Client(minioConfig);
export const bucketName = config.MINIO_BUCKET_NAME || 'resources';

View File

@@ -301,10 +301,8 @@ export const MarkMInit = async <T = any>(opts: MarkInitOpts<T>, sync?: Opts) =>
paranoid: true,
...optsRest,
});
console.log('MarkModel init', optsRest);
if (sync && sync.sync) {
const { sync: _, ...rest } = sync;
console.log('MarkModel sync', rest);
MarkModel.sync({ alter: true, logging: false, ...rest }).catch((e) => {
console.error('MarkModel sync', e);
});
@@ -318,4 +316,4 @@ export const syncMarkModel = async (sync?: Opts) => {
await MarkMInit({ sequelize, tableName: 'micro_mark' }, sync);
};
syncMarkModel({ sync: true, alter: true, logging: true });
syncMarkModel({ sync: true, alter: true, logging: false });