feat: improve application access and money precision

This commit is contained in:
hectorzhao
2026-07-16 17:54:05 +08:00
parent 9d5c507007
commit faa716b8d0
49 changed files with 1699 additions and 489 deletions
+11
View File
@@ -4,6 +4,17 @@ import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger';
import { AppModule } from './app.module';
import { OpenApiModule } from './open-api/open-api.module';
Object.defineProperty(BigInt.prototype, 'toJSON', {
configurable: true,
value(this: bigint) {
const result = Number(this);
if (!Number.isSafeInteger(result)) {
throw new RangeError('金额超过 JavaScript 安全整数范围');
}
return result;
},
});
async function bootstrap() {
const app = await NestFactory.create(AppModule, { rawBody: true });
app.setGlobalPrefix('api');