[webapp,manager]认证与TOKEN刷新

This commit is contained in:
tomsun28
2022-01-30 10:56:52 +08:00
parent 251c4aaedb
commit 0792fda524
7 changed files with 177 additions and 87 deletions

View 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();
});
});

View 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}`);
}
}