// src/app/services/user.service.ts
import { Injectable } from '@angular/core';
import { BehaviorSubject } from 'rxjs';

@Injectable({
  providedIn: 'root'
})
export class UserService {
  private userSubject = new BehaviorSubject<any>({
    username: '金以纯',
    userAvatar: '../../assets/images/user-avatar.png',
    userType: '普通用户'
  });

  getUserInfo$() {
    return this.userSubject.asObservable();
  }

  updateUserInfo(userInfo: any) {
    this.userSubject.next(userInfo);
  }
}