member_webapp/@overflow/member/service/member-totp.service.ts

33 lines
1.0 KiB
TypeScript
Raw Normal View History

2018-04-06 11:02:18 +00:00
import { Injectable } from '@angular/core';
2018-05-24 06:44:13 +00:00
import { RPCService } from '@loafer/ng-rpc';
2018-06-04 08:25:29 +00:00
import { Observable } from 'rxjs';
2018-05-02 08:09:39 +00:00
import { MemberTotp } from '@overflow/commons-typescript/model/member';
import { Member } from '@overflow/commons-typescript/model/member';
2018-04-06 11:02:18 +00:00
@Injectable()
export class MemberTotpService {
public constructor(
private rpcService: RPCService,
) {
}
2018-05-28 12:37:47 +00:00
public createTotp(member: Member): Observable<any> {
return this.rpcService.call<any>('MemberTotpService.createTotp', member);
2018-04-06 11:02:18 +00:00
}
public regist(member: Member, secretCode: string, code: string): Observable<boolean> {
// const param = {
// Member: {id: 1, },
// MemberTotp: {id: 1, secretCode: 'dkdkdkdk'},
// code: '123123'
// };
return this.rpcService.call<boolean>('MemberTotpService.regist', member, secretCode, code);
}
public checkCodeForMember(member: Member, code: string): Observable<boolean> {
return this.rpcService.call<boolean>('MemberTotpService.checkCodeForMember', member, code);
}
}