You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
pocketcommunityweb/src/app/account/register/register.service.ts

31 lines
773 B

import {Injectable} from '@angular/core';
import {JSONRequest} from '../../interface/JSONRequest';
import {HttpClient} from '@angular/common/http';
import {catchError} from 'rxjs/operators';
import {HttpInterface} from '../../interface/HttpInterface';
import {Observable} from 'rxjs';
import {RegisterResponse} from '../../interface/Response';
@Injectable({
providedIn: 'root'
})
export class RegisterService extends JSONRequest {
constructor(
private http: HttpClient,
) {
super();
}
/**
*
* @param body 注册表单
*/
register(body): Observable<RegisterResponse> {
return this.http.post<RegisterResponse>(HttpInterface.register, body, this.httpOptions)
.pipe(
catchError(this.handleError<any>('注册'))
);
}
}