This commit is contained in:
xtexChooser 2022-12-10 07:55:07 +08:00 committed by GitHub
parent 847f59369b
commit 020cd5cc02
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View file

@ -10,20 +10,20 @@ import { bindThis } from '@/decorators.js';
@Injectable()
export class IdService {
private metohd: string;
private method: string;
constructor(
@Inject(DI.config)
private config: Config,
) {
this.metohd = config.id.toLowerCase();
this.method = config.id.toLowerCase();
}
@bindThis
public genId(date?: Date): string {
if (!date || (date > new Date())) date = new Date();
switch (this.metohd) {
switch (this.method) {
case 'aid': return genAid(date);
case 'meid': return genMeid(date);
case 'meidg': return genMeidg(date);