|
|
|
@ -1,4 +1,4 @@
|
|
|
|
import { BadRequestException, Body, Controller, Get, Post, Put, Query, Req } from '@nestjs/common';
|
|
|
|
import { BadRequestException, Body, Controller, Get, Post, Put, Query, Req, Res } from '@nestjs/common';
|
|
|
|
import { AppService } from './app.service';
|
|
|
|
import { AppService } from './app.service';
|
|
|
|
import * as fs from 'fs';
|
|
|
|
import * as fs from 'fs';
|
|
|
|
import { ApiBearerAuth, ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
|
|
|
import { ApiBearerAuth, ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
|
|
|
@ -13,6 +13,7 @@ import { InjectRepository } from '@nestjs/typeorm';
|
|
|
|
import axios from 'axios';
|
|
|
|
import axios from 'axios';
|
|
|
|
import { v4 as uuid } from 'uuid';
|
|
|
|
import { v4 as uuid } from 'uuid';
|
|
|
|
import { verificationService } from './lib/face';
|
|
|
|
import { verificationService } from './lib/face';
|
|
|
|
|
|
|
|
import { join } from 'path';
|
|
|
|
|
|
|
|
|
|
|
|
export class Electronics {
|
|
|
|
export class Electronics {
|
|
|
|
@ApiProperty({ description: "电子产品名称" })
|
|
|
|
@ApiProperty({ description: "电子产品名称" })
|
|
|
|
@ -584,4 +585,25 @@ export class AppController {
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Get('version.json')
|
|
|
|
|
|
|
|
async version(
|
|
|
|
|
|
|
|
@Req() req: any,
|
|
|
|
|
|
|
|
): Promise<any> {
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
|
|
|
"versionName":"1.1.2",
|
|
|
|
|
|
|
|
"apkUrl":`http://${process.env.LOCAL_IP}/app.apk`,
|
|
|
|
|
|
|
|
"forceUpdate": false,
|
|
|
|
|
|
|
|
"whatsNew": "新版本更新"
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Get('app.apk')
|
|
|
|
|
|
|
|
async file(
|
|
|
|
|
|
|
|
@Res() res: any,
|
|
|
|
|
|
|
|
): Promise<any> {
|
|
|
|
|
|
|
|
const file_path = join(__dirname, "./apk/app.apk")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
res.sendFile(file_path)
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|