[webapp,manager]认证与TOKEN刷新
This commit is contained in:
16
web-app/src/app/service/auth.service.spec.ts
Normal file
16
web-app/src/app/service/auth.service.spec.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { AuthService } from './auth.service';
|
||||
|
||||
describe('AuthService', () => {
|
||||
let service: AuthService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(AuthService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
18
web-app/src/app/service/auth.service.ts
Normal file
18
web-app/src/app/service/auth.service.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { HttpClient, HttpParams } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
import { Message } from '../pojo/Message';
|
||||
|
||||
const account_auth_refresh_uri = '/account/auth/refresh';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class AuthService {
|
||||
constructor(private http: HttpClient) {}
|
||||
|
||||
public refreshToken(refreshToken: string): Observable<Message<any>> {
|
||||
return this.http.get<Message<any>>(`${account_auth_refresh_uri}/${refreshToken}`);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user