优化后台登录界面、完善后台附件管理、编辑器上传视频增加封面 、合并安装时执行mysql脚本
This commit is contained in:
@@ -53,11 +53,297 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers
|
|||||||
public IActionResult GetDirList(string subdir)
|
public IActionResult GetDirList(string subdir)
|
||||||
{
|
{
|
||||||
//string attachPath = $"{_env.WebRootPath}{Path.DirectorySeparatorChar}{attach.AttachPatch}{Path.DirectorySeparatorChar}";
|
//string attachPath = $"{_env.WebRootPath}{Path.DirectorySeparatorChar}{attach.AttachPatch}{Path.DirectorySeparatorChar}";
|
||||||
|
List<DirInfo> list = getAllAttach(subdir);
|
||||||
|
return Json(new { code = 0, message = "success", data = list });
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 获取指定目录下的文件
|
||||||
|
[HttpPost]
|
||||||
|
[MyAuthorize("viewlist", "attach", "JSON")]
|
||||||
|
public IActionResult GetFileList(string path)
|
||||||
|
{
|
||||||
|
string basePath = $"{_env.WebRootPath}{Path.DirectorySeparatorChar}{attach.AttachPatch}{Path.DirectorySeparatorChar}";
|
||||||
|
string currentPath = basePath;
|
||||||
|
if (!string.IsNullOrEmpty(path))
|
||||||
|
{
|
||||||
|
currentPath = Path.Combine(basePath, path.TrimStart('/').Replace("/", Path.DirectorySeparatorChar.ToString()));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!Directory.Exists(currentPath))
|
||||||
|
{
|
||||||
|
return Json(new { code = 1, message = "目录不存在" });
|
||||||
|
}
|
||||||
|
|
||||||
//Directory.GetDirectories()
|
List<AttachFileInfo> list = new List<AttachFileInfo>();
|
||||||
return Json(tip);
|
DirectoryInfo dir = new DirectoryInfo(currentPath);
|
||||||
|
|
||||||
|
// 获取子目录
|
||||||
|
foreach (var d in dir.GetDirectories())
|
||||||
|
{
|
||||||
|
if (d.Name.Equals("_thumbs", StringComparison.OrdinalIgnoreCase)) continue; // 过滤缩略图目录
|
||||||
|
list.Add(new AttachFileInfo
|
||||||
|
{
|
||||||
|
name = d.Name,
|
||||||
|
path = (string.IsNullOrEmpty(path) ? "" : path + "/") + d.Name,
|
||||||
|
updateTime = d.LastWriteTime,
|
||||||
|
isDir = true,
|
||||||
|
type = "folder"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取文件
|
||||||
|
foreach (var f in dir.GetFiles())
|
||||||
|
{
|
||||||
|
string ext = f.Extension.ToLower();
|
||||||
|
string type = "file";
|
||||||
|
if (IsImage(ext)) type = "image";
|
||||||
|
else if (IsVideo(ext)) type = "video";
|
||||||
|
|
||||||
|
list.Add(new AttachFileInfo
|
||||||
|
{
|
||||||
|
name = f.Name,
|
||||||
|
path = (string.IsNullOrEmpty(path) ? "" : path + "/") + f.Name,
|
||||||
|
ext = ext,
|
||||||
|
size = f.Length,
|
||||||
|
updateTime = f.LastWriteTime,
|
||||||
|
isDir = false,
|
||||||
|
type = type
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return Json(new { code = 0, message = "success", data = list });
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 创建文件夹
|
||||||
|
[HttpPost]
|
||||||
|
[MyAuthorize("add", "attach", "JSON")]
|
||||||
|
public IActionResult CreateDir(string path, string name)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(name)) return Json(new { code = 1, message = "文件夹名称不能为空" });
|
||||||
|
if (!IsSafeName(name)) return Json(new { code = 1, message = "文件夹名称包含非法字符" });
|
||||||
|
|
||||||
|
string basePath = $"{_env.WebRootPath}{Path.DirectorySeparatorChar}{attach.AttachPatch}{Path.DirectorySeparatorChar}";
|
||||||
|
string currentPath = basePath;
|
||||||
|
if (!string.IsNullOrEmpty(path))
|
||||||
|
{
|
||||||
|
currentPath = Path.Combine(basePath, path.TrimStart('/').Replace("/", Path.DirectorySeparatorChar.ToString()));
|
||||||
|
}
|
||||||
|
|
||||||
|
string newDirPath = Path.Combine(currentPath, name);
|
||||||
|
if (Directory.Exists(newDirPath))
|
||||||
|
{
|
||||||
|
return Json(new { code = 1, message = "文件夹已存在" });
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Directory.CreateDirectory(newDirPath);
|
||||||
|
return Json(new { code = 0, message = "创建成功" });
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
return Json(new { code = 1, message = "创建失败:" + ex.Message });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 删除文件或文件夹
|
||||||
|
[HttpPost]
|
||||||
|
[MyAuthorize("del", "attach", "JSON")]
|
||||||
|
public IActionResult DeleteFile(string path, bool isDir)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(path)) return Json(new { code = 1, message = "路径不能为空" });
|
||||||
|
|
||||||
|
string basePath = $"{_env.WebRootPath}{Path.DirectorySeparatorChar}{attach.AttachPatch}{Path.DirectorySeparatorChar}";
|
||||||
|
string fullPath = Path.Combine(basePath, path.TrimStart('/').Replace("/", Path.DirectorySeparatorChar.ToString()));
|
||||||
|
|
||||||
|
// 安全检查,防止删除基础目录以外的文件
|
||||||
|
if (!Path.GetFullPath(fullPath).StartsWith(Path.GetFullPath(basePath)))
|
||||||
|
{
|
||||||
|
return Json(new { code = 1, message = "非法路径" });
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (isDir)
|
||||||
|
{
|
||||||
|
if (Directory.Exists(fullPath))
|
||||||
|
{
|
||||||
|
Directory.Delete(fullPath, true); // 递归删除
|
||||||
|
return Json(new { code = 0, message = "删除成功" });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (System.IO.File.Exists(fullPath))
|
||||||
|
{
|
||||||
|
System.IO.File.Delete(fullPath);
|
||||||
|
return Json(new { code = 0, message = "删除成功" });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return Json(new { code = 1, message = "文件或目录不存在" });
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
return Json(new { code = 1, message = "删除失败:" + ex.Message });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 重命名文件或文件夹
|
||||||
|
[HttpPost]
|
||||||
|
[MyAuthorize("edit", "attach", "JSON")]
|
||||||
|
public IActionResult RenameFile(string path, string newName, bool isDir)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(path) || string.IsNullOrEmpty(newName)) return Json(new { code = 1, message = "参数不能为空" });
|
||||||
|
if (!IsSafeName(newName)) return Json(new { code = 1, message = "新名称包含非法字符" });
|
||||||
|
|
||||||
|
string basePath = $"{_env.WebRootPath}{Path.DirectorySeparatorChar}{attach.AttachPatch}{Path.DirectorySeparatorChar}";
|
||||||
|
string fullPath = Path.Combine(basePath, path.TrimStart('/').Replace("/", Path.DirectorySeparatorChar.ToString()));
|
||||||
|
|
||||||
|
// 安全检查
|
||||||
|
if (!Path.GetFullPath(fullPath).StartsWith(Path.GetFullPath(basePath)))
|
||||||
|
{
|
||||||
|
return Json(new { code = 1, message = "非法路径" });
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
string parentDir = Path.GetDirectoryName(fullPath);
|
||||||
|
string newFullPath = Path.Combine(parentDir, newName);
|
||||||
|
|
||||||
|
if (isDir)
|
||||||
|
{
|
||||||
|
if (!Directory.Exists(fullPath)) return Json(new { code = 1, message = "原文件夹不存在" });
|
||||||
|
if (Directory.Exists(newFullPath)) return Json(new { code = 1, message = "目标文件夹已存在" });
|
||||||
|
Directory.Move(fullPath, newFullPath);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (!System.IO.File.Exists(fullPath)) return Json(new { code = 1, message = "原文件不存在" });
|
||||||
|
// 保持扩展名一致性检查(可选,这里简单处理,如果newName没有扩展名则加上原扩展名,或者要求用户输入完整文件名)
|
||||||
|
// 假设前端传来的 newName 是完整文件名
|
||||||
|
if (System.IO.File.Exists(newFullPath)) return Json(new { code = 1, message = "目标文件已存在" });
|
||||||
|
System.IO.File.Move(fullPath, newFullPath);
|
||||||
|
}
|
||||||
|
return Json(new { code = 0, message = "重命名成功" });
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
return Json(new { code = 1, message = "重命名失败:" + ex.Message });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 上传文件
|
||||||
|
[HttpPost]
|
||||||
|
[MyAuthorize("add", "attach", "JSON")]
|
||||||
|
public async Task<IActionResult> UploadFile(string path)
|
||||||
|
{
|
||||||
|
// 安全检查:禁止在根目录上传
|
||||||
|
if (string.IsNullOrEmpty(path))
|
||||||
|
{
|
||||||
|
return Json(new { code = 1, message = "根目录不允许上传文件,请选择子目录" });
|
||||||
|
}
|
||||||
|
|
||||||
|
var files = Request.Form.Files;
|
||||||
|
if (files == null || files.Count == 0)
|
||||||
|
{
|
||||||
|
return Json(new { code = 1, message = "请选择文件" });
|
||||||
|
}
|
||||||
|
|
||||||
|
string basePath = $"{_env.WebRootPath}{Path.DirectorySeparatorChar}{attach.AttachPatch}{Path.DirectorySeparatorChar}";
|
||||||
|
string currentPath = basePath;
|
||||||
|
if (!string.IsNullOrEmpty(path))
|
||||||
|
{
|
||||||
|
currentPath = Path.Combine(basePath, path.TrimStart('/').Replace("/", Path.DirectorySeparatorChar.ToString()));
|
||||||
|
}
|
||||||
|
|
||||||
|
// 安全检查:防止目录遍历
|
||||||
|
if (!Path.GetFullPath(currentPath).StartsWith(Path.GetFullPath(basePath)))
|
||||||
|
{
|
||||||
|
return Json(new { code = 1, message = "非法路径" });
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!Directory.Exists(currentPath))
|
||||||
|
{
|
||||||
|
return Json(new { code = 1, message = "目录不存在" });
|
||||||
|
}
|
||||||
|
|
||||||
|
int successCount = 0;
|
||||||
|
string msg = "";
|
||||||
|
|
||||||
|
foreach (var file in files)
|
||||||
|
{
|
||||||
|
string fileName = file.FileName;
|
||||||
|
// 安全检查:文件名
|
||||||
|
if (!IsSafeName(fileName))
|
||||||
|
{
|
||||||
|
msg += $"文件 {fileName} 名称非法; ";
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检查扩展名
|
||||||
|
string ext = Path.GetExtension(fileName).ToLower();
|
||||||
|
string allowedExts = _attachsetting.FileAllowedExtensions + "," + _attachsetting.ImageAllowedExtensions + "," + _attachsetting.MediaAllowedExtensions;
|
||||||
|
if (!allowedExts.ToLower().Split(',').Contains(ext.TrimStart('.')))
|
||||||
|
{
|
||||||
|
msg += $"文件 {fileName} 类型不允许; ";
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
string fullPath = Path.Combine(currentPath, fileName);
|
||||||
|
// 如果文件存在,重命名
|
||||||
|
if (System.IO.File.Exists(fullPath))
|
||||||
|
{
|
||||||
|
string nameNoExt = Path.GetFileNameWithoutExtension(fileName);
|
||||||
|
fileName = $"{nameNoExt}_{Utils.GetOrderNum()}{ext}";
|
||||||
|
fullPath = Path.Combine(currentPath, fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
using (var stream = new FileStream(fullPath, FileMode.Create))
|
||||||
|
{
|
||||||
|
await file.CopyToAsync(stream);
|
||||||
|
}
|
||||||
|
successCount++;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
msg += $"文件 {fileName} 上传失败: {ex.Message}; ";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (successCount > 0)
|
||||||
|
{
|
||||||
|
return Json(new { code = 0, message = $"成功上传 {successCount} 个文件. {msg}" });
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return Json(new { code = 1, message = msg });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 辅助方法
|
||||||
|
private bool IsImage(string ext)
|
||||||
|
{
|
||||||
|
return new[] { ".jpg", ".jpeg", ".png", ".gif", ".bmp", ".webp" }.Contains(ext);
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool IsVideo(string ext)
|
||||||
|
{
|
||||||
|
return new[] { ".mp4", ".avi", ".mov", ".wmv", ".flv", ".mkv" }.Contains(ext);
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool IsSafeName(string str)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(str)) return false;
|
||||||
|
// 允许字母、数字、下划线、中划线、点、中文
|
||||||
|
return System.Text.RegularExpressions.Regex.IsMatch(str, @"^[\u4e00-\u9fa5a-zA-Z0-9_\-\.]+$");
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
@@ -76,17 +362,22 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers
|
|||||||
basePath += subdir.Replace("/", Path.DirectorySeparatorChar.ToString());
|
basePath += subdir.Replace("/", Path.DirectorySeparatorChar.ToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!Directory.Exists(basePath)) return list;
|
||||||
|
|
||||||
string[] arrDirs = Directory.GetDirectories(basePath);
|
string[] arrDirs = Directory.GetDirectories(basePath);
|
||||||
|
|
||||||
if (arrDirs != null && arrDirs.Length > 0)
|
if (arrDirs != null && arrDirs.Length > 0)
|
||||||
{
|
{
|
||||||
foreach (var item in arrDirs)
|
foreach (var item in arrDirs)
|
||||||
{
|
{
|
||||||
string nextSubDir = subdir + "/" + item.Substring(item.LastIndexOf(Path.DirectorySeparatorChar)+1);
|
string dirName = item.Substring(item.LastIndexOf(Path.DirectorySeparatorChar) + 1);
|
||||||
|
if (dirName.Equals("_thumbs", StringComparison.OrdinalIgnoreCase)) continue; // 过滤缩略图目录
|
||||||
|
|
||||||
|
string nextSubDir = string.IsNullOrEmpty(subdir) ? dirName : subdir + "/" + dirName;
|
||||||
var tpmList = getAllAttach(nextSubDir);
|
var tpmList = getAllAttach(nextSubDir);
|
||||||
list.Add(new DirInfo()
|
list.Add(new DirInfo()
|
||||||
{
|
{
|
||||||
name = item.Substring(item.LastIndexOf(Path.DirectorySeparatorChar)+1),
|
name = dirName,
|
||||||
path = nextSubDir,
|
path = nextSubDir,
|
||||||
//fullPath = item,
|
//fullPath = item,
|
||||||
subList = tpmList
|
subList = tpmList
|
||||||
@@ -98,4 +389,22 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers
|
|||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class DirInfo
|
||||||
|
{
|
||||||
|
public string name { get; set; }
|
||||||
|
public string path { get; set; }
|
||||||
|
public List<DirInfo> subList { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class AttachFileInfo
|
||||||
|
{
|
||||||
|
public string name { get; set; }
|
||||||
|
public string path { get; set; }
|
||||||
|
public string ext { get; set; }
|
||||||
|
public long size { get; set; }
|
||||||
|
public DateTime updateTime { get; set; }
|
||||||
|
public bool isDir { get; set; }
|
||||||
|
public string type { get; set; }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -498,7 +498,7 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers
|
|||||||
using (Stream stream = fileProvider.GetFileInfo(logname).CreateReadStream())
|
using (Stream stream = fileProvider.GetFileInfo(logname).CreateReadStream())
|
||||||
{
|
{
|
||||||
byte[] buffer = new byte[stream.Length];
|
byte[] buffer = new byte[stream.Length];
|
||||||
await stream.ReadAsync(buffer, 0, buffer.Length);
|
await stream.ReadExactlyAsync(buffer);
|
||||||
detail.Append(Encoding.Default.GetString(buffer));
|
detail.Append(Encoding.Default.GetString(buffer));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -909,7 +909,7 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers
|
|||||||
{
|
{
|
||||||
// 保存为byte[]
|
// 保存为byte[]
|
||||||
byte[] byData = new byte[stream.Length];
|
byte[] byData = new byte[stream.Length];
|
||||||
stream.Read(byData, 0, byData.Length);
|
stream.ReadExactly(byData);
|
||||||
stream.Dispose();
|
stream.Dispose();
|
||||||
return byData;
|
return byData;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,75 +1,673 @@
|
|||||||
@{
|
@using Newtonsoft.Json
|
||||||
|
@{
|
||||||
ViewBag.title = "附件管理";
|
ViewBag.title = "附件管理";
|
||||||
|
var folderJson = ViewBag.folderJson as string;
|
||||||
}
|
}
|
||||||
|
<style>
|
||||||
|
/* Grid View Styles */
|
||||||
|
.file-box {
|
||||||
|
float: left;
|
||||||
|
width: 120px;
|
||||||
|
height: 140px;
|
||||||
|
padding: 10px;
|
||||||
|
text-align: center;
|
||||||
|
cursor: pointer;
|
||||||
|
position: relative;
|
||||||
|
margin: 5px;
|
||||||
|
border: 1px solid #eee;
|
||||||
|
border-radius: 4px;
|
||||||
|
transition: all 0.2s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.file-box:hover {
|
||||||
|
background-color: #f8f8f8;
|
||||||
|
border-color: #ddd;
|
||||||
|
box-shadow: 0 0 5px rgba(0,0,0,0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.file-box.active {
|
||||||
|
background-color: #e8f0fe;
|
||||||
|
border-color: #1c84c6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.file-icon {
|
||||||
|
height: 80px;
|
||||||
|
line-height: 80px;
|
||||||
|
font-size: 48px;
|
||||||
|
color: #666;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.file-icon img {
|
||||||
|
max-width: 100%;
|
||||||
|
max-height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.file-name {
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
font-size: 12px;
|
||||||
|
line-height: 1.5;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.file-info {
|
||||||
|
font-size: 10px;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* List View Styles */
|
||||||
|
.file-list-item {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 8px 15px;
|
||||||
|
border-bottom: 1px solid #eee;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: background-color 0.2s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.file-list-item:hover {
|
||||||
|
background-color: #f8f8f8;
|
||||||
|
}
|
||||||
|
|
||||||
|
.file-list-item.active {
|
||||||
|
background-color: #e8f0fe;
|
||||||
|
}
|
||||||
|
|
||||||
|
.file-list-icon {
|
||||||
|
width: 30px;
|
||||||
|
font-size: 20px;
|
||||||
|
color: #666;
|
||||||
|
text-align: center;
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.file-list-icon img {
|
||||||
|
max-width: 100%;
|
||||||
|
max-height: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.file-list-name {
|
||||||
|
flex: 1;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
font-size: 14px;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.file-list-info {
|
||||||
|
width: 150px;
|
||||||
|
text-align: right;
|
||||||
|
font-size: 12px;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
|
||||||
|
.file-list-date {
|
||||||
|
width: 150px;
|
||||||
|
text-align: right;
|
||||||
|
font-size: 12px;
|
||||||
|
color: #999;
|
||||||
|
margin-left: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.folder-tree {
|
||||||
|
overflow-x: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.folder-tree ul {
|
||||||
|
list-style: none;
|
||||||
|
padding-left: 20px;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.folder-tree li {
|
||||||
|
padding: 2px 0;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.folder-tree a {
|
||||||
|
color: #333;
|
||||||
|
text-decoration: none;
|
||||||
|
display: inline-block;
|
||||||
|
padding: 4px 8px;
|
||||||
|
border-radius: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.folder-tree a:hover {
|
||||||
|
background-color: #f0f0f0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.folder-tree a.active {
|
||||||
|
background-color: #e8f0fe;
|
||||||
|
color: #1c84c6;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.folder-tree i {
|
||||||
|
margin-right: 5px;
|
||||||
|
color: #f8ac59;
|
||||||
|
}
|
||||||
|
|
||||||
|
.breadcrumb {
|
||||||
|
background: none;
|
||||||
|
padding: 8px 0;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Drag and Drop Overlay */
|
||||||
|
#dropOverlay {
|
||||||
|
display: none;
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
background: rgba(255, 255, 255, 0.8);
|
||||||
|
z-index: 1000;
|
||||||
|
border: 3px dashed #1c84c6;
|
||||||
|
text-align: center;
|
||||||
|
padding-top: 20%;
|
||||||
|
font-size: 24px;
|
||||||
|
color: #1c84c6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ibox-content {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
<div class="wrapper wrapper-content">
|
<div class="wrapper wrapper-content">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-3">
|
<div class="col-sm-3">
|
||||||
<div class="ibox float-e-margins">
|
<div class="ibox float-e-margins">
|
||||||
<div class="ibox-content">
|
<div class="ibox-title">
|
||||||
<div class="file-manager">
|
|
||||||
<h5>显示:</h5>
|
|
||||||
<a href="file_manager.html#" class="file-control active">所有</a>
|
|
||||||
<a href="file_manager.html#" class="file-control">文档</a>
|
|
||||||
<a href="file_manager.html#" class="file-control">视频</a>
|
|
||||||
<a href="file_manager.html#" class="file-control">图片</a>
|
|
||||||
<div class="hr-line-dashed"></div>
|
|
||||||
<button class="btn btn-primary btn-block">上传文件</button>
|
|
||||||
<div class="hr-line-dashed"></div>
|
|
||||||
<h5>文件夹</h5>
|
<h5>文件夹</h5>
|
||||||
<ul class="folder-list" style="padding: 0">
|
<div class="ibox-tools">
|
||||||
<li>
|
<a onclick="window.location.reload()"><i class="fa fa-refresh"></i></a>
|
||||||
<a href="file_manager.html"><i class="fa fa-folder"></i> 文件</a>
|
</div>
|
||||||
</li>
|
</div>
|
||||||
<li>
|
<div class="ibox-content" style="min-height: 600px; overflow-y: auto;">
|
||||||
<a href="file_manager.html"><i class="fa fa-folder"></i> 图片</a>
|
<div id="folderTree"></div>
|
||||||
</li>
|
</div>
|
||||||
<li>
|
</div>
|
||||||
<a href="file_manager.html"><i class="fa fa-folder"></i> Web页面</a>
|
</div>
|
||||||
</li>
|
<div class="col-sm-9">
|
||||||
<li>
|
<div class="ibox float-e-margins">
|
||||||
<a href="file_manager.html"><i class="fa fa-folder"></i> 插图</a>
|
<div class="ibox-title">
|
||||||
</li>
|
<div class="btn-group">
|
||||||
<li>
|
<button class="btn btn-primary btn-sm" onclick="uploadFile()"><i class="fa fa-upload"></i> 上传</button>
|
||||||
<a href="file_manager.html"><i class="fa fa-folder"></i> 电影</a>
|
<button class="btn btn-success btn-sm" onclick="createFolder()"><i class="fa fa-plus"></i> 新建文件夹</button>
|
||||||
</li>
|
<button class="btn btn-danger btn-sm" onclick="deleteSelected()"><i class="fa fa-trash"></i> 删除</button>
|
||||||
<li>
|
<button class="btn btn-warning btn-sm" onclick="renameFile()"><i class="fa fa-pencil"></i> 重命名</button>
|
||||||
<a href="file_manager.html"><i class="fa fa-folder"></i> 书籍</a>
|
<button class="btn btn-info btn-sm" onclick="copyLink()"><i class="fa fa-copy"></i> 复制链接</button>
|
||||||
</li>
|
<button class="btn btn-default btn-sm" onclick="refreshFiles()"><i class="fa fa-refresh"></i> 刷新</button>
|
||||||
</ul>
|
</div>
|
||||||
<h5 class="tag-title">标签</h5>
|
<div class="pull-right">
|
||||||
<ul class="tag-list" style="padding: 0">
|
<div class="btn-group">
|
||||||
<li>
|
<button type="button" class="btn btn-default btn-sm active" id="btnViewGrid" onclick="switchView('grid')" title="缩略图模式"><i class="fa fa-th-large"></i></button>
|
||||||
<a href="file_manager.html">爱人</a>
|
<button type="button" class="btn btn-default btn-sm" id="btnViewList" onclick="switchView('list')" title="列表模式"><i class="fa fa-list"></i></button>
|
||||||
</li>
|
</div>
|
||||||
<li>
|
<span id="currentPathDisplay" class="text-muted" style="margin-left: 10px;">/</span>
|
||||||
<a href="file_manager.html">工作</a>
|
</div>
|
||||||
</li>
|
</div>
|
||||||
<li>
|
<div class="ibox-content" style="min-height: 600px;" id="fileContainer">
|
||||||
<a href="file_manager.html">家庭</a>
|
<div id="dropOverlay">
|
||||||
</li>
|
<i class="fa fa-cloud-upload fa-3x"></i><br>
|
||||||
<li>
|
松开鼠标上传文件
|
||||||
<a href="file_manager.html">孩子</a>
|
</div>
|
||||||
</li>
|
<div id="fileList" class="clearfix">
|
||||||
<li>
|
<div class="text-center text-muted" style="padding: 50px;">正在加载...</div>
|
||||||
<a href="file_manager.html">假期</a>
|
</div>
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<a href="file_manager.html">音乐</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<a href="file_manager.html">照片</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<a href="file_manager.html">电影</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
<div class="clearfix"></div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
<input type="file" id="fileInput" multiple style="display:none" onchange="doUpload()" />
|
||||||
|
|
||||||
|
<script>
|
||||||
|
var currentPath = "";
|
||||||
|
var folders = @Html.Raw(string.IsNullOrEmpty(folderJson) ? "[]" : folderJson);
|
||||||
|
var selectedFile = null;
|
||||||
|
var currentView = 'grid'; // 'grid' or 'list'
|
||||||
|
var currentFilesData = []; // Store current files data for view switching
|
||||||
|
|
||||||
|
$(function() {
|
||||||
|
initTree();
|
||||||
|
loadFiles("");
|
||||||
|
|
||||||
|
// 点击空白处取消选择
|
||||||
|
$(document).on('click', function(e) {
|
||||||
|
if (!$(e.target).closest('.file-box').length &&
|
||||||
|
!$(e.target).closest('.file-list-item').length &&
|
||||||
|
!$(e.target).closest('.btn-group').length) {
|
||||||
|
$('.file-box, .file-list-item').removeClass('active');
|
||||||
|
selectedFile = null;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Drag and Drop Support
|
||||||
|
var $container = $('#fileContainer');
|
||||||
|
var $overlay = $('#dropOverlay');
|
||||||
|
var dragCounter = 0;
|
||||||
|
|
||||||
|
$container.on('dragenter', function(e) {
|
||||||
|
e.preventDefault();
|
||||||
|
e.stopPropagation();
|
||||||
|
dragCounter++;
|
||||||
|
$overlay.show();
|
||||||
|
});
|
||||||
|
|
||||||
|
$container.on('dragover', function(e) {
|
||||||
|
e.preventDefault();
|
||||||
|
e.stopPropagation();
|
||||||
|
});
|
||||||
|
|
||||||
|
$container.on('dragleave', function(e) {
|
||||||
|
e.preventDefault();
|
||||||
|
e.stopPropagation();
|
||||||
|
dragCounter--;
|
||||||
|
if (dragCounter === 0) {
|
||||||
|
$overlay.hide();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$container.on('drop', function(e) {
|
||||||
|
e.preventDefault();
|
||||||
|
e.stopPropagation();
|
||||||
|
dragCounter = 0;
|
||||||
|
$overlay.hide();
|
||||||
|
|
||||||
|
var files = e.originalEvent.dataTransfer.files;
|
||||||
|
if (files.length > 0) {
|
||||||
|
handleDroppedFiles(files);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
function switchView(view) {
|
||||||
|
currentView = view;
|
||||||
|
if (view === 'grid') {
|
||||||
|
$('#btnViewGrid').addClass('active');
|
||||||
|
$('#btnViewList').removeClass('active');
|
||||||
|
} else {
|
||||||
|
$('#btnViewGrid').removeClass('active');
|
||||||
|
$('#btnViewList').addClass('active');
|
||||||
|
}
|
||||||
|
renderFiles(currentFilesData);
|
||||||
|
}
|
||||||
|
|
||||||
|
function initTree() {
|
||||||
|
var treeData = convertToJsTreeData(folders);
|
||||||
|
// Add root node
|
||||||
|
var rootNode = {
|
||||||
|
"id": "root",
|
||||||
|
"text": "根目录",
|
||||||
|
"state": { "opened": true, "selected": true },
|
||||||
|
"icon": "fa fa-folder-open",
|
||||||
|
"data": { "path": "" },
|
||||||
|
"children": treeData
|
||||||
|
};
|
||||||
|
|
||||||
|
$('#folderTree').jstree({
|
||||||
|
'core': {
|
||||||
|
'data': [rootNode],
|
||||||
|
'check_callback': true
|
||||||
|
},
|
||||||
|
'plugins': ['types', 'wholerow'],
|
||||||
|
'types': {
|
||||||
|
'default': {
|
||||||
|
'icon': 'fa fa-folder'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).on('select_node.jstree', function(e, data) {
|
||||||
|
var path = data.node.data.path;
|
||||||
|
currentPath = path;
|
||||||
|
$('#currentPathDisplay').text(path || '/');
|
||||||
|
loadFiles(path);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function convertToJsTreeData(nodes) {
|
||||||
|
var data = [];
|
||||||
|
$.each(nodes, function(i, node) {
|
||||||
|
var item = {
|
||||||
|
"text": node.name,
|
||||||
|
"icon": "fa fa-folder",
|
||||||
|
"data": { "path": node.path },
|
||||||
|
"children": []
|
||||||
|
};
|
||||||
|
if (node.subList && node.subList.length > 0) {
|
||||||
|
item.children = convertToJsTreeData(node.subList);
|
||||||
|
}
|
||||||
|
data.push(item);
|
||||||
|
});
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
function loadFiles(path) {
|
||||||
|
$('#fileList').html('<div class="text-center text-muted" style="padding: 50px;"><i class="fa fa-spinner fa-spin"></i> 正在加载...</div>');
|
||||||
|
selectedFile = null;
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
url: '/AdminCP/Attach/GetFileList',
|
||||||
|
type: 'POST',
|
||||||
|
data: { path: path },
|
||||||
|
success: function(res) {
|
||||||
|
if (res.code === 0) {
|
||||||
|
currentFilesData = res.data;
|
||||||
|
renderFiles(res.data);
|
||||||
|
} else {
|
||||||
|
layer.msg(res.message, {icon: 2});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error: function() {
|
||||||
|
layer.msg('加载失败', {icon: 2});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function renderFiles(files) {
|
||||||
|
var html = '';
|
||||||
|
if (!files || files.length === 0) {
|
||||||
|
html = '<div class="text-center text-muted" style="padding: 50px;">暂无文件</div>';
|
||||||
|
} else {
|
||||||
|
if (currentView === 'grid') {
|
||||||
|
// Grid View
|
||||||
|
$.each(files, function(i, file) {
|
||||||
|
var icon = '';
|
||||||
|
if (file.isDir) {
|
||||||
|
icon = '<i class="fa fa-folder" style="color: #f8ac59;"></i>';
|
||||||
|
} else if (file.type === 'image') {
|
||||||
|
icon = '<img src="/' + '@(Config.GetSystemConfig().AttachConfigEntity.AttachPatch)/' + file.path + '" />';
|
||||||
|
} else if (file.type === 'video') {
|
||||||
|
icon = '<i class="fa fa-file-video-o" style="color: #23c6c8;"></i>';
|
||||||
|
} else {
|
||||||
|
icon = '<i class="fa fa-file-o"></i>';
|
||||||
|
}
|
||||||
|
|
||||||
|
var safeName = file.name.replace(/'/g, "\\'");
|
||||||
|
var safePath = file.path.replace(/'/g, "\\'");
|
||||||
|
|
||||||
|
html += '<div class="file-box" onclick="selectFile(this, \'' + safePath + '\', ' + file.isDir + ', \'' + safeName + '\')" ondblclick="openFile(\'' + safePath + '\', ' + file.isDir + ')">';
|
||||||
|
html += '<div class="file-icon">' + icon + '</div>';
|
||||||
|
html += '<div class="file-name" title="' + file.name + '">' + file.name + '</div>';
|
||||||
|
if (!file.isDir) {
|
||||||
|
html += '<div class="file-info">' + formatSize(file.size) + '</div>';
|
||||||
|
}
|
||||||
|
html += '</div>';
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// List View
|
||||||
|
html += '<div class="file-list-header" style="padding: 8px 15px; border-bottom: 1px solid #ddd; font-weight: bold; color: #666; display: flex;">';
|
||||||
|
html += '<div style="width: 40px;"></div>';
|
||||||
|
html += '<div style="flex: 1;">名称</div>';
|
||||||
|
html += '<div style="width: 150px; text-align: right;">大小</div>';
|
||||||
|
html += '<div style="width: 150px; text-align: right; margin-left: 15px;">修改时间</div>';
|
||||||
|
html += '</div>';
|
||||||
|
|
||||||
|
$.each(files, function(i, file) {
|
||||||
|
var icon = '';
|
||||||
|
if (file.isDir) {
|
||||||
|
icon = '<i class="fa fa-folder" style="color: #f8ac59;"></i>';
|
||||||
|
} else if (file.type === 'image') {
|
||||||
|
icon = '<i class="fa fa-file-image-o" style="color: #1c84c6;"></i>';
|
||||||
|
} else if (file.type === 'video') {
|
||||||
|
icon = '<i class="fa fa-file-video-o" style="color: #23c6c8;"></i>';
|
||||||
|
} else {
|
||||||
|
icon = '<i class="fa fa-file-o"></i>';
|
||||||
|
}
|
||||||
|
|
||||||
|
var safeName = file.name.replace(/'/g, "\\'");
|
||||||
|
var safePath = file.path.replace(/'/g, "\\'");
|
||||||
|
var sizeStr = file.isDir ? '-' : formatSize(file.size);
|
||||||
|
var dateStr = file.updateTime ? file.updateTime.replace('T', ' ').substring(0, 19) : '-';
|
||||||
|
|
||||||
|
html += '<div class="file-list-item" onclick="selectFile(this, \'' + safePath + '\', ' + file.isDir + ', \'' + safeName + '\')" ondblclick="openFile(\'' + safePath + '\', ' + file.isDir + ')">';
|
||||||
|
html += '<div class="file-list-icon">' + icon + '</div>';
|
||||||
|
html += '<div class="file-list-name" title="' + file.name + '">' + file.name + '</div>';
|
||||||
|
html += '<div class="file-list-info">' + sizeStr + '</div>';
|
||||||
|
html += '<div class="file-list-date">' + dateStr + '</div>';
|
||||||
|
html += '</div>';
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$('#fileList').html(html);
|
||||||
|
}
|
||||||
|
|
||||||
|
function selectFile(el, path, isDir, name) {
|
||||||
|
$('.file-box, .file-list-item').removeClass('active');
|
||||||
|
$(el).addClass('active');
|
||||||
|
selectedFile = { path: path, isDir: isDir, name: name };
|
||||||
|
event.stopPropagation();
|
||||||
|
}
|
||||||
|
|
||||||
|
function openFile(path, isDir) {
|
||||||
|
if (isDir) {
|
||||||
|
currentPath = path;
|
||||||
|
$('#currentPathDisplay').text(path || '/');
|
||||||
|
loadFiles(path);
|
||||||
|
} else {
|
||||||
|
// Preview file?
|
||||||
|
var file = currentFilesData.find(function(f) { return f.path == path; });
|
||||||
|
if (file && file.type === 'image') {
|
||||||
|
var photosData = {
|
||||||
|
"title": "图片预览",
|
||||||
|
"id": 1,
|
||||||
|
"start": 0,
|
||||||
|
"data": []
|
||||||
|
};
|
||||||
|
|
||||||
|
var images = [];
|
||||||
|
$.each(currentFilesData, function(i, f) {
|
||||||
|
if (f.type === 'image') images.push(f);
|
||||||
|
});
|
||||||
|
|
||||||
|
$.each(images, function(i, img) {
|
||||||
|
var src = '/' + '@(Config.GetSystemConfig().AttachConfigEntity.AttachPatch)/' + img.path;
|
||||||
|
photosData.data.push({
|
||||||
|
"alt": img.name,
|
||||||
|
"pid": i,
|
||||||
|
"src": src,
|
||||||
|
"thumb": ""
|
||||||
|
});
|
||||||
|
|
||||||
|
if (img.path === path) {
|
||||||
|
photosData.start = i;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
layer.photos({
|
||||||
|
photos: photosData,
|
||||||
|
anim: 5
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
var url = '/' + '@(Config.GetSystemConfig().AttachConfigEntity.AttachPatch)/' + path;
|
||||||
|
window.open(url);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function createFolder() {
|
||||||
|
layer.prompt({title: '请输入文件夹名称', formType: 0}, function(text, index){
|
||||||
|
layer.close(index);
|
||||||
|
$.ajax({
|
||||||
|
url: '/AdminCP/Attach/CreateDir',
|
||||||
|
type: 'POST',
|
||||||
|
data: { path: currentPath, name: text },
|
||||||
|
success: function(res) {
|
||||||
|
if (res.code === 0) {
|
||||||
|
layer.msg('创建成功', {icon: 1});
|
||||||
|
refreshFiles();
|
||||||
|
setTimeout(function(){ window.location.reload(); }, 1000);
|
||||||
|
} else {
|
||||||
|
layer.msg(res.message, {icon: 2});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function deleteSelected() {
|
||||||
|
if (!selectedFile) {
|
||||||
|
layer.msg('请先选择文件或文件夹', {icon: 0});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
layer.confirm('确定要删除吗?此操作不可恢复!', {icon: 3, title:'提示'}, function(index){
|
||||||
|
$.ajax({
|
||||||
|
url: '/AdminCP/Attach/DeleteFile',
|
||||||
|
type: 'POST',
|
||||||
|
data: { path: selectedFile.path, isDir: selectedFile.isDir },
|
||||||
|
success: function(res) {
|
||||||
|
if (res.code === 0) {
|
||||||
|
layer.msg('删除成功', {icon: 1});
|
||||||
|
refreshFiles();
|
||||||
|
if (selectedFile.isDir) {
|
||||||
|
setTimeout(function(){ window.location.reload(); }, 1000);
|
||||||
|
}
|
||||||
|
selectedFile = null;
|
||||||
|
} else {
|
||||||
|
layer.msg(res.message, {icon: 2});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
layer.close(index);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function renameFile() {
|
||||||
|
if (!selectedFile) {
|
||||||
|
layer.msg('请先选择文件或文件夹', {icon: 0});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var currentFile = selectedFile;
|
||||||
|
|
||||||
|
layer.prompt({
|
||||||
|
title: '请输入新名称',
|
||||||
|
formType: 0,
|
||||||
|
value: currentFile.name
|
||||||
|
}, function(text, index){
|
||||||
|
layer.close(index);
|
||||||
|
|
||||||
|
if (text === currentFile.name) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var loading = layer.load(1, {shade: [0.1,'#fff']});
|
||||||
|
$.ajax({
|
||||||
|
url: '/AdminCP/Attach/RenameFile',
|
||||||
|
type: 'POST',
|
||||||
|
data: { path: currentFile.path, newName: text, isDir: currentFile.isDir },
|
||||||
|
success: function(res) {
|
||||||
|
layer.close(loading);
|
||||||
|
if (res.code === 0) {
|
||||||
|
layer.msg('重命名成功', {icon: 1});
|
||||||
|
refreshFiles();
|
||||||
|
if (currentFile.isDir) {
|
||||||
|
setTimeout(function(){ window.location.reload(); }, 1000);
|
||||||
|
}
|
||||||
|
selectedFile = null;
|
||||||
|
} else {
|
||||||
|
layer.msg(res.message, {icon: 2});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error: function() {
|
||||||
|
layer.close(loading);
|
||||||
|
layer.msg('请求失败', {icon: 2});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function uploadFile() {
|
||||||
|
if (!checkUploadPermission()) return;
|
||||||
|
$('#fileInput').click();
|
||||||
|
}
|
||||||
|
|
||||||
|
function checkUploadPermission() {
|
||||||
|
if (!currentPath || currentPath === "") {
|
||||||
|
layer.msg('根目录不允许上传文件,请选择子目录', {icon: 0});
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
function doUpload() {
|
||||||
|
var files = $('#fileInput')[0].files;
|
||||||
|
if (files.length === 0) return;
|
||||||
|
processUpload(files);
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleDroppedFiles(files) {
|
||||||
|
if (!checkUploadPermission()) return;
|
||||||
|
processUpload(files);
|
||||||
|
}
|
||||||
|
|
||||||
|
function processUpload(files) {
|
||||||
|
var formData = new FormData();
|
||||||
|
for (var i = 0; i < files.length; i++) {
|
||||||
|
formData.append("files", files[i]);
|
||||||
|
}
|
||||||
|
formData.append("path", currentPath);
|
||||||
|
|
||||||
|
var loading = layer.load(1, {shade: [0.1,'#fff']});
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
url: '/AdminCP/Attach/UploadFile',
|
||||||
|
type: 'POST',
|
||||||
|
data: formData,
|
||||||
|
processData: false,
|
||||||
|
contentType: false,
|
||||||
|
success: function(res) {
|
||||||
|
layer.close(loading);
|
||||||
|
if (res.code === 0) {
|
||||||
|
layer.msg(res.message, {icon: 1});
|
||||||
|
refreshFiles();
|
||||||
|
} else {
|
||||||
|
layer.alert(res.message, {icon: 2});
|
||||||
|
}
|
||||||
|
$('#fileInput').val('');
|
||||||
|
},
|
||||||
|
error: function() {
|
||||||
|
layer.close(loading);
|
||||||
|
layer.msg('上传出错', {icon: 2});
|
||||||
|
$('#fileInput').val('');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function refreshFiles() {
|
||||||
|
loadFiles(currentPath);
|
||||||
|
}
|
||||||
|
|
||||||
|
function copyLink() {
|
||||||
|
if (!selectedFile || selectedFile.isDir) {
|
||||||
|
layer.msg('请选择一个文件', {icon: 0});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var url = '/' + '@(Config.GetSystemConfig().AttachConfigEntity.AttachPatch)/' + selectedFile.path;
|
||||||
|
var $temp = $("<input>");
|
||||||
|
$("body").append($temp);
|
||||||
|
$temp.val(url).select();
|
||||||
|
document.execCommand("copy");
|
||||||
|
$temp.remove();
|
||||||
|
layer.msg('链接已复制', {icon: 1});
|
||||||
|
}
|
||||||
|
|
||||||
|
function formatSize(bytes) {
|
||||||
|
if (bytes === 0) return '0 B';
|
||||||
|
var k = 1024;
|
||||||
|
var sizes = ['B', 'KB', 'MB', 'GB', 'TB'];
|
||||||
|
var i = Math.floor(Math.log(bytes) / Math.log(k));
|
||||||
|
return (bytes / Math.pow(k, i)).toFixed(2) + ' ' + sizes[i];
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,6 @@
|
|||||||
<link href="~/hplus/css/style.css" rel="stylesheet" />
|
<link href="~/hplus/css/style.css" rel="stylesheet" />
|
||||||
<link href="~/hplus/css/font-awesome.min.css" rel="stylesheet" />
|
<link href="~/hplus/css/font-awesome.min.css" rel="stylesheet" />
|
||||||
<link href="~/hplus/css/animate.min.css" rel="stylesheet" />
|
<link href="~/hplus/css/animate.min.css" rel="stylesheet" />
|
||||||
<link href="~/hplus/css/login.css" rel="stylesheet" />
|
|
||||||
<link href="~/js/treegrid/jquery.treegrid.css" rel="stylesheet" />
|
<link href="~/js/treegrid/jquery.treegrid.css" rel="stylesheet" />
|
||||||
<script src="~/js/jquery2.min.js"></script>
|
<script src="~/js/jquery2.min.js"></script>
|
||||||
<script src="~/js/layer/layer.js"></script>
|
<script src="~/js/layer/layer.js"></script>
|
||||||
|
|||||||
@@ -22,7 +22,8 @@
|
|||||||
<script>var encrypt_key = '@ViewBag.key';</script>
|
<script>var encrypt_key = '@ViewBag.key';</script>
|
||||||
</head>
|
</head>
|
||||||
<body class="gray-bg">
|
<body class="gray-bg">
|
||||||
<div class="middle-box text-center loginscreen animated fadeInDown">
|
<canvas id="canvas-bg"></canvas>
|
||||||
|
<div class="middle-box animated fadeInDown">
|
||||||
<div>
|
<div>
|
||||||
<div class="text-center m-b-md" style="font-size:64px">
|
<div class="text-center m-b-md" style="font-size:64px">
|
||||||
COMCMS
|
COMCMS
|
||||||
@@ -80,6 +81,89 @@
|
|||||||
};
|
};
|
||||||
DoAdminLogin("loginForm", rules);
|
DoAdminLogin("loginForm", rules);
|
||||||
});
|
});
|
||||||
|
// --- 科技感粒子连线动画特效 (原生JS实现,无需引入额外库) ---
|
||||||
|
(function() {
|
||||||
|
var canvas = document.getElementById('canvas-bg');
|
||||||
|
var ctx = canvas.getContext('2d');
|
||||||
|
var width, height;
|
||||||
|
var particles = [];
|
||||||
|
|
||||||
|
// 特效配置
|
||||||
|
var config = {
|
||||||
|
count: 80, // 粒子数量
|
||||||
|
dist: 160, // 连线距离
|
||||||
|
radius: 2, // 粒子大小
|
||||||
|
color: '26, 179, 148',// 主色调 RGB (#1ab394)
|
||||||
|
speed: 0.8 // 移动速度
|
||||||
|
};
|
||||||
|
|
||||||
|
function resize() {
|
||||||
|
width = window.innerWidth;
|
||||||
|
height = window.innerHeight;
|
||||||
|
canvas.width = width;
|
||||||
|
canvas.height = height;
|
||||||
|
}
|
||||||
|
|
||||||
|
function Particle() {
|
||||||
|
this.x = Math.random() * width;
|
||||||
|
this.y = Math.random() * height;
|
||||||
|
this.vx = (Math.random() - 0.5) * config.speed;
|
||||||
|
this.vy = (Math.random() - 0.5) * config.speed;
|
||||||
|
}
|
||||||
|
|
||||||
|
Particle.prototype.update = function() {
|
||||||
|
this.x += this.vx;
|
||||||
|
this.y += this.vy;
|
||||||
|
if (this.x < 0 || this.x > width) this.vx = -this.vx;
|
||||||
|
if (this.y < 0 || this.y > height) this.vy = -this.vy;
|
||||||
|
};
|
||||||
|
|
||||||
|
Particle.prototype.draw = function() {
|
||||||
|
ctx.beginPath();
|
||||||
|
ctx.arc(this.x, this.y, config.radius, 0, Math.PI * 2);
|
||||||
|
ctx.fillStyle = 'rgba(' + config.color + ', 0.6)';
|
||||||
|
ctx.fill();
|
||||||
|
};
|
||||||
|
|
||||||
|
function init() {
|
||||||
|
resize();
|
||||||
|
particles = [];
|
||||||
|
for (var i = 0; i < config.count; i++) {
|
||||||
|
particles.push(new Particle());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function animate() {
|
||||||
|
ctx.clearRect(0, 0, width, height);
|
||||||
|
|
||||||
|
for (var i = 0; i < particles.length; i++) {
|
||||||
|
var p1 = particles[i];
|
||||||
|
p1.update();
|
||||||
|
p1.draw();
|
||||||
|
|
||||||
|
for (var j = i + 1; j < particles.length; j++) {
|
||||||
|
var p2 = particles[j];
|
||||||
|
var dx = p1.x - p2.x;
|
||||||
|
var dy = p1.y - p2.y;
|
||||||
|
var dist = Math.sqrt(dx * dx + dy * dy);
|
||||||
|
|
||||||
|
if (dist < config.dist) {
|
||||||
|
ctx.beginPath();
|
||||||
|
ctx.strokeStyle = 'rgba(' + config.color + ',' + (1 - dist / config.dist) * 0.4 + ')';
|
||||||
|
ctx.lineWidth = 1;
|
||||||
|
ctx.moveTo(p1.x, p1.y);
|
||||||
|
ctx.lineTo(p2.x, p2.y);
|
||||||
|
ctx.stroke();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
requestAnimationFrame(animate);
|
||||||
|
}
|
||||||
|
|
||||||
|
window.addEventListener('resize', resize);
|
||||||
|
init();
|
||||||
|
animate();
|
||||||
|
})();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@@ -8,12 +8,12 @@
|
|||||||
<link href="~/hplus/css/style.css" rel="stylesheet" />
|
<link href="~/hplus/css/style.css" rel="stylesheet" />
|
||||||
<link href="~/hplus/css/font-awesome.min.css" rel="stylesheet" />
|
<link href="~/hplus/css/font-awesome.min.css" rel="stylesheet" />
|
||||||
<link href="~/hplus/css/animate.min.css" rel="stylesheet" />
|
<link href="~/hplus/css/animate.min.css" rel="stylesheet" />
|
||||||
<link href="~/hplus/css/login.css" rel="stylesheet" />
|
|
||||||
<link href="~/hplus/js/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet" />
|
<link href="~/hplus/js/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet" />
|
||||||
<link href="~/hplus/css/plugins/iCheck/custom.css" rel="stylesheet" />
|
<link href="~/hplus/css/plugins/iCheck/custom.css" rel="stylesheet" />
|
||||||
<link href="~/js/treegrid/jquery.treegrid.css" rel="stylesheet" />
|
<link href="~/js/treegrid/jquery.treegrid.css" rel="stylesheet" />
|
||||||
<link href="~/js/webuploader/webuploader.css" rel="stylesheet" />
|
<link href="~/js/webuploader/webuploader.css" rel="stylesheet" />
|
||||||
<link href="~/js/bootstrap-colorpicker/css/bootstrap-colorpicker.css" rel="stylesheet" />
|
<link href="~/js/bootstrap-colorpicker/css/bootstrap-colorpicker.css" rel="stylesheet" />
|
||||||
|
<link href="~/js/jstree/themes/default/style.min.css" rel="stylesheet" />
|
||||||
<script src="~/js/my97/WdatePicker.js"></script>
|
<script src="~/js/my97/WdatePicker.js"></script>
|
||||||
<environment names="Development">
|
<environment names="Development">
|
||||||
<script src="~/lib/jquery/dist/jquery.js"></script>
|
<script src="~/lib/jquery/dist/jquery.js"></script>
|
||||||
@@ -35,6 +35,7 @@
|
|||||||
<script src="~/js/uploader.js"></script>
|
<script src="~/js/uploader.js"></script>
|
||||||
<script src="~/editor/ckeditor/ckeditor.js" asp-append-version="true"></script>
|
<script src="~/editor/ckeditor/ckeditor.js" asp-append-version="true"></script>
|
||||||
<script src="~/js/bootstrap-colorpicker/js/bootstrap-colorpicker.js"></script>
|
<script src="~/js/bootstrap-colorpicker/js/bootstrap-colorpicker.js"></script>
|
||||||
|
<script src="~/js/jstree/jstree.min.js"></script>
|
||||||
</environment>
|
</environment>
|
||||||
<environment names="Staging,Production">
|
<environment names="Staging,Production">
|
||||||
<script src="~/lib/jquery/dist/jquery.js"></script>
|
<script src="~/lib/jquery/dist/jquery.js"></script>
|
||||||
@@ -55,6 +56,7 @@
|
|||||||
<script src="~/js/uploader.js"></script>
|
<script src="~/js/uploader.js"></script>
|
||||||
<script src="~/editor/ckeditor/ckeditor.js"></script>
|
<script src="~/editor/ckeditor/ckeditor.js"></script>
|
||||||
<script src="~/js/bootstrap-colorpicker/js/bootstrap-colorpicker.js"></script>
|
<script src="~/js/bootstrap-colorpicker/js/bootstrap-colorpicker.js"></script>
|
||||||
|
<script src="~/js/jstree/jstree.min.js"></script>
|
||||||
</environment>
|
</environment>
|
||||||
</head>
|
</head>
|
||||||
<body class="gray-bg">
|
<body class="gray-bg">
|
||||||
|
|||||||
@@ -390,8 +390,6 @@
|
|||||||
<None Include="wwwroot\editor\ckeditor\plugins\xml\plugin.js" />
|
<None Include="wwwroot\editor\ckeditor\plugins\xml\plugin.js" />
|
||||||
<None Include="wwwroot\editor\ckeditor\skins\moono-lisa\readme.md" />
|
<None Include="wwwroot\editor\ckeditor\skins\moono-lisa\readme.md" />
|
||||||
<None Include="wwwroot\editor\ckeditor\vendor\promise.js" />
|
<None Include="wwwroot\editor\ckeditor\vendor\promise.js" />
|
||||||
<None Include="wwwroot\install\comcms_for_linux.sql" />
|
|
||||||
<None Include="wwwroot\install\comcms_for_windows.sql" />
|
|
||||||
<None Include="wwwroot\install\comcms_sqlserver.sql" />
|
<None Include="wwwroot\install\comcms_sqlserver.sql" />
|
||||||
<None Include="wwwroot\js\my97\lang\en.js" />
|
<None Include="wwwroot\js\my97\lang\en.js" />
|
||||||
<None Include="wwwroot\js\my97\lang\zh-cn.js" />
|
<None Include="wwwroot\js\my97\lang\zh-cn.js" />
|
||||||
|
|||||||
@@ -154,10 +154,7 @@ namespace COMCMS.Web.Controllers
|
|||||||
string sqlname = "comcms_sqlserver.sql";
|
string sqlname = "comcms_sqlserver.sql";
|
||||||
if (sqltype == "mysql")
|
if (sqltype == "mysql")
|
||||||
{
|
{
|
||||||
if (mysqltype == "linux")
|
sqlname = "comcms_mysql.sql";
|
||||||
sqlname = "comcms_for_linux.sql";
|
|
||||||
else
|
|
||||||
sqlname = "comcms_for_windows.sql";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
string sqlPath = $"{_env.WebRootPath}{Path.DirectorySeparatorChar}install{Path.DirectorySeparatorChar}";
|
string sqlPath = $"{_env.WebRootPath}{Path.DirectorySeparatorChar}install{Path.DirectorySeparatorChar}";
|
||||||
|
|||||||
@@ -38,6 +38,31 @@ CKEDITOR.dialog.add( 'html5video', function( editor ) {
|
|||||||
hidden: true,
|
hidden: true,
|
||||||
filebrowser: 'info:url'
|
filebrowser: 'info:url'
|
||||||
} ]
|
} ]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'hbox',
|
||||||
|
widths: [ '365px', '110px' ],
|
||||||
|
align: 'right',
|
||||||
|
children: [ {
|
||||||
|
type: 'text',
|
||||||
|
id: 'poster',
|
||||||
|
label: editor.lang.html5video.poster,
|
||||||
|
setup: function( widget ) {
|
||||||
|
this.setValue( widget.data.poster );
|
||||||
|
},
|
||||||
|
commit: function( widget ) {
|
||||||
|
widget.setData( 'poster', this.getValue() );
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'button',
|
||||||
|
id: 'browsePoster',
|
||||||
|
style: 'display:inline-block;margin-top:14px;',
|
||||||
|
align: 'center',
|
||||||
|
label: editor.lang.common.browseServer,
|
||||||
|
hidden: true,
|
||||||
|
filebrowser: 'info:poster'
|
||||||
|
} ]
|
||||||
} ]
|
} ]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -126,6 +151,20 @@ CKEDITOR.dialog.add( 'html5video', function( editor ) {
|
|||||||
filebrowser: 'info:url',
|
filebrowser: 'info:url',
|
||||||
label: editor.lang.html5video.btnUpload,
|
label: editor.lang.html5video.btnUpload,
|
||||||
'for': [ 'Upload', 'upload' ]
|
'for': [ 'Upload', 'upload' ]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'file',
|
||||||
|
id: 'uploadPoster',
|
||||||
|
label: editor.lang.html5video.posterUpload,
|
||||||
|
style: 'height:40px',
|
||||||
|
size: 38
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'fileButton',
|
||||||
|
id: 'uploadButtonPoster',
|
||||||
|
filebrowser: 'info:poster',
|
||||||
|
label: editor.lang.html5video.btnUpload,
|
||||||
|
'for': [ 'Upload', 'uploadPoster' ]
|
||||||
} ]
|
} ]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -11,5 +11,7 @@ CKEDITOR.plugins.setLang( 'html5video', 'en', {
|
|||||||
autoplay: 'Autoplay?',
|
autoplay: 'Autoplay?',
|
||||||
yes: 'Yes',
|
yes: 'Yes',
|
||||||
no: 'No',
|
no: 'No',
|
||||||
responsive: 'Responsive width'
|
responsive: 'Responsive width',
|
||||||
|
poster: 'Poster image',
|
||||||
|
posterUpload: 'Upload poster image'
|
||||||
} );
|
} );
|
||||||
|
|||||||
@@ -11,5 +11,7 @@ CKEDITOR.plugins.setLang('html5video', 'zh-cn', {
|
|||||||
autoplay: '自动播放?',
|
autoplay: '自动播放?',
|
||||||
yes: '是',
|
yes: '是',
|
||||||
no: '否',
|
no: '否',
|
||||||
responsive: '响应式宽度'
|
responsive: '响应式宽度',
|
||||||
|
poster: '封面图',
|
||||||
|
posterUpload: '上传封面图'
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ CKEDITOR.plugins.add( 'html5video', {
|
|||||||
* - div-s with text-align,float,margin-left,margin-right inline style rules and required ckeditor-html5-video class.
|
* - div-s with text-align,float,margin-left,margin-right inline style rules and required ckeditor-html5-video class.
|
||||||
* - video tags with src, controls, width and height attributes.
|
* - video tags with src, controls, width and height attributes.
|
||||||
*/
|
*/
|
||||||
allowedContent: 'div[data-responsive](!ckeditor-html5-video){text-align,float,margin-left,margin-right}; video[src,controls,autoplay,width, height]{max-width,height};',
|
allowedContent: 'div[data-responsive](!ckeditor-html5-video){text-align,float,margin-left,margin-right}; video[src,controls,autoplay,width,height,poster]{max-width,height};',
|
||||||
requiredContent: 'div(ckeditor-html5-video); video[src,controls];',
|
requiredContent: 'div(ckeditor-html5-video); video[src,controls];',
|
||||||
upcast: function( element ) {
|
upcast: function( element ) {
|
||||||
return element.name === 'div' && element.hasClass( 'ckeditor-html5-video' );
|
return element.name === 'div' && element.hasClass( 'ckeditor-html5-video' );
|
||||||
@@ -21,6 +21,7 @@ CKEDITOR.plugins.add( 'html5video', {
|
|||||||
var src = '';
|
var src = '';
|
||||||
var autoplay = '';
|
var autoplay = '';
|
||||||
var align = this.element.getStyle( 'text-align' );
|
var align = this.element.getStyle( 'text-align' );
|
||||||
|
var poster = '';
|
||||||
|
|
||||||
var width = '';
|
var width = '';
|
||||||
var height = '';
|
var height = '';
|
||||||
@@ -32,6 +33,7 @@ CKEDITOR.plugins.add( 'html5video', {
|
|||||||
width = this.element.getChild( 0 ).getAttribute( 'width' );
|
width = this.element.getChild( 0 ).getAttribute( 'width' );
|
||||||
height = this.element.getChild( 0 ).getAttribute( 'height' );
|
height = this.element.getChild( 0 ).getAttribute( 'height' );
|
||||||
autoplay = this.element.getChild( 0 ).getAttribute( 'autoplay' );
|
autoplay = this.element.getChild( 0 ).getAttribute( 'autoplay' );
|
||||||
|
poster = this.element.getChild( 0 ).getAttribute( 'poster' );
|
||||||
responsive = this.element.getAttribute( 'data-responsive' );
|
responsive = this.element.getAttribute( 'data-responsive' );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -56,6 +58,10 @@ CKEDITOR.plugins.add( 'html5video', {
|
|||||||
this.setData( 'autoplay', 'yes' );
|
this.setData( 'autoplay', 'yes' );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( poster ) {
|
||||||
|
this.setData('poster', poster);
|
||||||
|
}
|
||||||
|
|
||||||
if ( responsive ) {
|
if ( responsive ) {
|
||||||
this.setData( 'responsive', responsive );
|
this.setData( 'responsive', responsive );
|
||||||
}
|
}
|
||||||
@@ -76,6 +82,7 @@ CKEDITOR.plugins.add( 'html5video', {
|
|||||||
this.element.getChild( 0 ).setAttribute( 'src', this.data.src );
|
this.element.getChild( 0 ).setAttribute( 'src', this.data.src );
|
||||||
if (this.data.width) this.element.getChild( 0 ).setAttribute( 'width', this.data.width );
|
if (this.data.width) this.element.getChild( 0 ).setAttribute( 'width', this.data.width );
|
||||||
if (this.data.height) this.element.getChild( 0 ).setAttribute( 'height', this.data.height );
|
if (this.data.height) this.element.getChild( 0 ).setAttribute( 'height', this.data.height );
|
||||||
|
if (this.data.poster) this.element.getChild( 0 ).setAttribute( 'poster', this.data.poster );
|
||||||
|
|
||||||
if ( this.data.responsive ) {
|
if ( this.data.responsive ) {
|
||||||
this.element.setAttribute("data-responsive", this.data.responsive);
|
this.element.setAttribute("data-responsive", this.data.responsive);
|
||||||
|
|||||||
@@ -1,93 +1,129 @@
|
|||||||
html{height: 100%;}
|
/* login-tech.css */
|
||||||
body.signin {
|
|
||||||
background: #18c8f6;
|
/* 定义主色调变量 */
|
||||||
height: auto;
|
:root {
|
||||||
background:url("../img/login-background.jpg") no-repeat center fixed;
|
--primary-color: #1ab394;
|
||||||
-webkit-background-size: cover;
|
--primary-glow: rgba(26, 179, 148, 0.5);
|
||||||
-moz-background-size: cover;
|
--bg-dark: #0f1319;
|
||||||
-o-background-size: cover;
|
--text-color: #e0e0e0;
|
||||||
background-size: cover;
|
|
||||||
color: rgba(255,255,255,.95);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.signinpanel {
|
body.gray-bg {
|
||||||
width: 750px;
|
background: var(--bg-dark);
|
||||||
margin: 10% auto 0 auto;
|
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||||
|
color: var(--text-color);
|
||||||
|
overflow: hidden; /* 防止滚动条出现 */
|
||||||
}
|
}
|
||||||
|
|
||||||
.signinpanel .logopanel {
|
/* 动态背景 Canvas */
|
||||||
|
#canvas-bg {
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
z-index: -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 登录框主体 - 毛玻璃特效 */
|
||||||
|
.middle-box {
|
||||||
|
background: rgba(255, 255, 255, 0.05);
|
||||||
|
backdrop-filter: blur(10px); /* 毛玻璃模糊 */
|
||||||
|
-webkit-backdrop-filter: blur(10px);
|
||||||
|
padding: 40px;
|
||||||
|
border-radius: 10px;
|
||||||
|
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||||
|
box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
|
||||||
|
margin: 50px auto auto auto; /* 调整垂直位置 */
|
||||||
|
max-width: 400px;
|
||||||
|
width: 100%;
|
||||||
float: none;
|
float: none;
|
||||||
width: auto;
|
/* display: inline-block;*/
|
||||||
padding: 0;
|
position: relative;
|
||||||
background: none;
|
z-index: 10;
|
||||||
|
top: 50px
|
||||||
}
|
}
|
||||||
|
|
||||||
.signinpanel .signin-info ul {
|
/* 标题样式 */
|
||||||
list-style: none;
|
.logo-name {
|
||||||
padding: 0;
|
color: var(--primary-color);
|
||||||
margin: 20px 0;
|
font-size: 60px;
|
||||||
|
font-weight: 800;
|
||||||
|
letter-spacing: 2px;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
text-shadow: 0 0 10px var(--primary-glow);
|
||||||
}
|
}
|
||||||
|
|
||||||
.signinpanel .form-control {
|
.middle-box h3 {
|
||||||
display: block;
|
color: #fff;
|
||||||
margin-top: 15px;
|
font-weight: 300;
|
||||||
|
margin-bottom: 30px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.signinpanel .uname {
|
/* 输入框重写 - 科技感下划线风格 */
|
||||||
background: #fff url(../img/user.png) no-repeat 95% center;color:#333;
|
.form-control {
|
||||||
|
background-color: transparent !important;
|
||||||
|
border: none;
|
||||||
|
border-bottom: 1px solid rgba(255, 255, 255, 0.2);
|
||||||
|
border-radius: 0;
|
||||||
|
color: #fff !important;
|
||||||
|
box-shadow: none;
|
||||||
|
padding-left: 0;
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
height: 40px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.signinpanel .pword {
|
.form-control:focus {
|
||||||
background: #fff url(../img/locked.png) no-repeat 95% center;color:#333;
|
border-bottom: 1px solid var(--primary-color);
|
||||||
|
box-shadow: 0 1px 0 0 var(--primary-glow);
|
||||||
|
color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.signinpanel .btn {
|
/* 针对浏览器自动填充背景色的 Hack */
|
||||||
margin-top: 15px;
|
input:-webkit-autofill,
|
||||||
|
input:-webkit-autofill:hover,
|
||||||
|
input:-webkit-autofill:focus,
|
||||||
|
input:-webkit-autofill:active {
|
||||||
|
-webkit-box-shadow: 0 0 0 30px #151a23 inset !important;
|
||||||
|
-webkit-text-fill-color: white !important;
|
||||||
|
transition: background-color 5000s ease-in-out 0s;
|
||||||
}
|
}
|
||||||
|
|
||||||
.signinpanel form {
|
.form-control::-webkit-input-placeholder {
|
||||||
background: rgba(255, 255, 255, 0.2);
|
color: rgba(255,255,255,0.4);
|
||||||
border: 1px solid rgba(255,255,255,.3);
|
|
||||||
-moz-box-shadow: 0 3px 0 rgba(12, 12, 12, 0.03);
|
|
||||||
-webkit-box-shadow: 0 3px 0 rgba(12, 12, 12, 0.03);
|
|
||||||
box-shadow: 0 3px 0 rgba(12, 12, 12, 0.03);
|
|
||||||
-moz-border-radius: 3px;
|
|
||||||
-webkit-border-radius: 3px;
|
|
||||||
border-radius: 3px;
|
|
||||||
padding: 30px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.signup-footer{border-top: solid 1px rgba(255,255,255,.3);margin:20px 0;padding-top: 15px;}
|
.form-control:-moz-placeholder {
|
||||||
|
color: rgba(255,255,255,0.4);
|
||||||
@media screen and (max-width: 768px) {
|
|
||||||
.signinpanel,
|
|
||||||
.signuppanel {
|
|
||||||
margin: 0 auto;
|
|
||||||
width: 420px!important;
|
|
||||||
padding: 20px;
|
|
||||||
}
|
}
|
||||||
.signinpanel form {
|
|
||||||
|
/* 验证码输入框调整 */
|
||||||
|
.input-group-addon {
|
||||||
|
background: transparent;
|
||||||
|
border: none;
|
||||||
|
border-bottom: 1px solid rgba(255, 255, 255, 0.2);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 按钮样式 - 霓虹光效 */
|
||||||
|
.btn-primary {
|
||||||
|
background-color: var(--primary-color);
|
||||||
|
border-color: var(--primary-color);
|
||||||
|
color: #fff;
|
||||||
|
font-weight: bold;
|
||||||
|
border-radius: 25px; /* 圆角按钮 */
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
box-shadow: 0 4px 15px var(--primary-glow);
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
}
|
}
|
||||||
.signup-footer {
|
|
||||||
margin-bottom: 10px;
|
.btn-primary:hover, .btn-primary:active, .btn-primary:focus {
|
||||||
}
|
background-color: #15947a !important;
|
||||||
.signuppanel .form-control {
|
border-color: #15947a !important;
|
||||||
margin-bottom: 10px;
|
box-shadow: 0 6px 20px rgba(26, 179, 148, 0.8);
|
||||||
}
|
transform: translateY(-2px);
|
||||||
.signup-footer .pull-left,
|
|
||||||
.signup-footer .pull-right {
|
|
||||||
float: none !important;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
.signinpanel .signin-info ul {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@media screen and (max-width: 320px) {
|
|
||||||
.signinpanel,
|
|
||||||
.signuppanel {
|
|
||||||
margin:0 20px;
|
|
||||||
width:auto;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 底部文字 */
|
||||||
|
.text-muted {
|
||||||
|
color: rgba(255, 255, 255, 0.5) !important;
|
||||||
}
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
+172
-824
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+3
File diff suppressed because one or more lines are too long
Binary file not shown.
|
After Width: | Height: | Size: 1.5 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 6.4 KiB |
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 5.5 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.2 KiB |
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
+1247
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user