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

34 lines
924 B

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