/// 用户模型 class UserModel { final String id; final String username; final String name; final String? avatar; final String role; final String? department; final String? phone; UserModel({ required this.id, required this.username, required this.name, this.avatar, required this.role, this.department, this.phone, }); factory UserModel.fromJson(Map json) { return UserModel( id: json['id']?.toString() ?? '', username: json['username'] ?? '', name: json['name'] ?? '', avatar: json['avatar'], role: json['role'] ?? '', department: json['department'], phone: json['phone'], ); } Map toJson() { return { 'id': id, 'username': username, 'name': name, 'avatar': avatar, 'role': role, 'department': department, 'phone': phone, }; } }