- 新增 WindowsCredential 模型和控制器,用于管理 Windows 凭据 - 新增 RemoteAccessToken 模型,支持生成可分享的远程访问链接 - 更新 RemoteDesktopController,添加 Token 生成、验证、撤销等 API - 更新前端 RemoteDesktopModal,支持4种连接方式:快速连接、生成分享链接、手动输入、链接管理 - 新增 WindowsCredentialManager 组件用于管理 Windows 凭据 - 新增 RemoteAccessPage 用于通过 Token 访问远程桌面 - 添加 Vue Router 支持 /remote/:token 路由 - 更新数据库迁移,添加 WindowsCredentials 和 RemoteAccessTokens 表
61 lines
1.3 KiB
C#
61 lines
1.3 KiB
C#
using System.ComponentModel.DataAnnotations;
|
|
|
|
namespace AmtScanner.Api.Models;
|
|
|
|
/// <summary>
|
|
/// Windows 远程桌面凭据
|
|
/// </summary>
|
|
public class WindowsCredential
|
|
{
|
|
[Key]
|
|
public long Id { get; set; }
|
|
|
|
/// <summary>
|
|
/// 凭据名称(便于识别)
|
|
/// </summary>
|
|
[Required]
|
|
[MaxLength(200)]
|
|
public string Name { get; set; } = string.Empty;
|
|
|
|
/// <summary>
|
|
/// Windows 用户名
|
|
/// </summary>
|
|
[Required]
|
|
[MaxLength(200)]
|
|
public string Username { get; set; } = string.Empty;
|
|
|
|
/// <summary>
|
|
/// Windows 密码(加密存储)
|
|
/// </summary>
|
|
[Required]
|
|
[MaxLength(500)]
|
|
public string Password { get; set; } = string.Empty;
|
|
|
|
/// <summary>
|
|
/// 域名(可选)
|
|
/// </summary>
|
|
[MaxLength(200)]
|
|
public string? Domain { get; set; }
|
|
|
|
/// <summary>
|
|
/// 是否为默认凭据
|
|
/// </summary>
|
|
public bool IsDefault { get; set; } = false;
|
|
|
|
/// <summary>
|
|
/// 备注
|
|
/// </summary>
|
|
[MaxLength(500)]
|
|
public string? Note { get; set; }
|
|
|
|
/// <summary>
|
|
/// 创建时间
|
|
/// </summary>
|
|
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
|
|
|
/// <summary>
|
|
/// 更新时间
|
|
/// </summary>
|
|
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
|
|
}
|