2017-06-13 11:34:06 +08:00
|
|
|
|
using Bootstrap.DataAccess;
|
|
|
|
|
using Bootstrap.Security;
|
2018-06-07 00:45:47 +08:00
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
using System;
|
2017-06-13 11:34:06 +08:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.IO;
|
2016-12-10 12:23:59 +08:00
|
|
|
|
|
|
|
|
|
namespace Bootstrap.Admin.Models
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
///
|
|
|
|
|
/// </summary>
|
2017-03-23 17:21:58 +08:00
|
|
|
|
public class ProfilesModel : NavigatorBarModel
|
2016-12-10 12:23:59 +08:00
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获得/设置 头像文件大小
|
|
|
|
|
/// </summary>
|
2017-06-13 11:34:06 +08:00
|
|
|
|
public long Size { get; }
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获得 系统配置的所有样式表
|
|
|
|
|
/// </summary>
|
|
|
|
|
public IEnumerable<BootstrapDict> Csss { get; }
|
2016-12-10 12:23:59 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
///
|
|
|
|
|
/// </summary>
|
2018-06-07 00:45:47 +08:00
|
|
|
|
/// <param name="controller"></param>
|
|
|
|
|
public ProfilesModel(ControllerBase controller) : base(controller)
|
2016-12-10 12:23:59 +08:00
|
|
|
|
{
|
2018-06-07 00:45:47 +08:00
|
|
|
|
// TODO: 找到MapPath方法
|
|
|
|
|
var fileName = AppContext.BaseDirectory + Icon;
|
2016-12-10 12:23:59 +08:00
|
|
|
|
if (File.Exists(fileName))
|
|
|
|
|
{
|
|
|
|
|
Size = new FileInfo(fileName).Length;
|
|
|
|
|
}
|
2017-06-13 11:34:06 +08:00
|
|
|
|
|
|
|
|
|
Csss = DictHelper.RetrieveWebCss();
|
2016-12-10 12:23:59 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|