Compare commits
164
Commits
02db388433
..
docker
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d2a5ab9e3f | ||
|
|
4cbd11eb29 | ||
|
|
9a2123bf47 | ||
|
|
454c6825fa | ||
|
|
97f490e304 | ||
|
|
3aae9200eb | ||
|
|
8f4dd7f5ca | ||
|
|
df478d3516 | ||
|
|
b08d7c1ede | ||
|
|
991f032502 | ||
|
|
61aa025055 | ||
|
|
75d8402ff8 | ||
|
|
c2ef40c4c0 | ||
|
|
29ebabdc4e | ||
|
|
a6bbfb4827 | ||
|
|
632663ce02 | ||
|
|
831e4666f7 | ||
|
|
e69ee64088 | ||
|
|
9861e1af20 | ||
|
|
3e8e94147a | ||
|
|
e5beb6e5a2 | ||
|
|
f9b31383da | ||
|
|
3be384a668 | ||
|
|
1cdabd1ee7 | ||
|
|
e36e5548c1 | ||
|
|
75f6207ccc | ||
|
|
dc7e7fe41b | ||
|
|
1937f09864 | ||
|
|
7093fe22d1 | ||
|
|
ca716ed0dd | ||
|
|
624214a061 | ||
|
|
c56533c2da | ||
|
|
8de7d2ca6f | ||
|
|
5e2e12e670 | ||
|
|
937bdd0356 | ||
|
|
7cd41821c0 | ||
|
|
485d0b07ca | ||
|
|
e129c76471 | ||
|
|
0d26b9f89f | ||
|
|
68cae8d169 | ||
|
|
cbb05d5aec | ||
|
|
b7cafe76e5 | ||
|
|
f11a2dc840 | ||
|
|
7ae5d3e885 | ||
|
|
31afac93d3 | ||
|
|
a57211677d | ||
|
|
8344e3e349 | ||
|
|
1fbe4fc978 | ||
|
|
91b06ec8fe | ||
|
|
2cf41efc0f | ||
|
|
00776ca3a2 | ||
|
|
953ee66e8f | ||
|
|
4f1efc489a | ||
|
|
38767ae629 | ||
|
|
73f7c687c2 | ||
|
|
bd5374ceec | ||
|
|
a18f26f308 | ||
|
|
cb581ee8cc | ||
|
|
20a71ce910 | ||
|
|
e83b4c01fd | ||
|
|
00a551f784 | ||
|
|
c7205a98d8 | ||
|
|
c66589574c | ||
|
|
eac4f4fbea | ||
|
|
2aa1c0bcb2 | ||
|
|
96646acd86 | ||
|
|
722e413663 | ||
|
|
1b7a3286e5 | ||
|
|
a7febd84ef | ||
|
|
3a325774d8 | ||
|
|
6deb400144 | ||
|
|
48b68889b0 | ||
|
|
6a5ef1226c | ||
|
|
3328ba055b | ||
|
|
e97763bfab | ||
|
|
2543005f96 | ||
|
|
4d5d6fd006 | ||
|
|
63adfbd462 | ||
|
|
1f22424b78 | ||
|
|
f351dd3c62 | ||
|
|
67fced6dc7 | ||
|
|
62d8608864 | ||
|
|
543e7d8ee7 | ||
|
|
4bb00d68e1 | ||
|
|
dc1fea5f95 | ||
|
|
a1c6145fb4 | ||
|
|
76fe507e18 | ||
|
|
8f9049de7c | ||
|
|
653dffc14f | ||
|
|
20752c97a1 | ||
|
|
01dbb4461d | ||
|
|
8c7e285180 | ||
|
|
564ae42a57 | ||
|
|
ccdd1364f1 | ||
|
|
980518df46 | ||
|
|
8b62d8e61e | ||
|
|
d6ea0b35d8 | ||
|
|
ef0d81d917 | ||
|
|
cb6bf496eb | ||
|
|
815b3af928 | ||
|
|
cd86161c18 | ||
|
|
9014ee0190 | ||
|
|
d1af83f95d | ||
|
|
f0f1e3d7b6 | ||
|
|
2e7f71e860 | ||
|
|
7609e2e525 | ||
|
|
29efc22705 | ||
|
|
bcd4bca768 | ||
|
|
23a0c4b32e | ||
|
|
6e7f4c7cc3 | ||
|
|
9141e861c4 | ||
|
|
81e36f140d | ||
|
|
8d9c13b50b | ||
|
|
97bb7146aa | ||
|
|
e87e0d14e1 | ||
|
|
9ecb124f6e | ||
|
|
14ebc3acc7 | ||
|
|
80f7dc994c | ||
|
|
fc1fec7fc5 | ||
|
|
fcb4b8b027 | ||
|
|
9623fb033b | ||
|
|
269fd4a6fe | ||
|
|
ce7b525f1a | ||
|
|
3b7b523bec | ||
|
|
c1e551b7fb | ||
|
|
a5d1eb7cbe | ||
|
|
c3a8b7d57a | ||
|
|
dc4db4da28 | ||
|
|
c22c5dd51c | ||
|
|
13c6ee54ab | ||
|
|
905f1b37d1 | ||
|
|
321e055726 | ||
|
|
3d015baa56 | ||
|
|
0c1fb6b097 | ||
|
|
728b4a3bd0 | ||
|
|
14a43efb67 | ||
|
|
1f8e2b1e6e | ||
|
|
3af9250443 | ||
|
|
3f993c838f | ||
|
|
edefa34898 | ||
|
|
4fda24f62c | ||
|
|
92fb899d89 | ||
|
|
7a89991358 | ||
|
|
4f48e1dbaa | ||
|
|
a69621e016 | ||
|
|
2a49736cb8 | ||
|
|
f1080e3618 | ||
|
|
03fc965929 | ||
|
|
f991099b54 | ||
|
|
7962ab17a4 | ||
|
|
6cd8a0abea | ||
|
|
26672514f6 | ||
|
|
a201617a92 | ||
|
|
0c8f6dc6ed | ||
|
|
c1a935b88e | ||
|
|
7d8d2c5461 | ||
|
|
00fd583495 | ||
|
|
e693ebe3d1 | ||
|
|
14e391e5bb | ||
|
|
2292184e9e | ||
|
|
206993241a | ||
|
|
d40f0b8eaf | ||
|
|
f6779f2339 | ||
|
|
25f8e9d643 |
@@ -0,0 +1,15 @@
|
|||||||
|
# 数据库配置
|
||||||
|
MYSQL_ROOT_PASSWORD=root
|
||||||
|
MYSQL_DATABASE=comcms
|
||||||
|
MYSQL_USER=comcms
|
||||||
|
MYSQL_PASSWORD=comcms123
|
||||||
|
|
||||||
|
# Redis 配置
|
||||||
|
REDIS_PASSWORD=
|
||||||
|
|
||||||
|
# ASP.NET Core 环境
|
||||||
|
ASPNETCORE_ENVIRONMENT=Production
|
||||||
|
|
||||||
|
# 数据库连接字符串(会被覆盖,但保留作为参考)
|
||||||
|
# ConnectionStrings__dbconn__ConnectionString=Server=mysql;Port=3306;Database=comcms;Uid=comcms;Pwd=comcms123;charset=utf8mb4;
|
||||||
|
# ConnectionStrings__dbconn__providerName=MySql.Data.MySqlClient
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
# MySQL 配置
|
||||||
|
MYSQL_HOST=localhost
|
||||||
|
MYSQL_PORT=3306
|
||||||
|
MYSQL_DATABASE=comcms
|
||||||
|
MYSQL_USER=root
|
||||||
|
MYSQL_PASSWORD=your_password_here
|
||||||
|
|
||||||
|
# Redis 配置
|
||||||
|
REDIS_HOST=127.0.0.1
|
||||||
|
REDIS_PORT=6379
|
||||||
|
REDIS_PASSWORD=your_redis_password_here
|
||||||
|
REDIS_DB=2
|
||||||
|
|
||||||
|
# JWT 配置
|
||||||
|
JWT_SECRET=your_jwt_secret_here
|
||||||
|
|
||||||
|
# 系统配置
|
||||||
|
SIGN_SALT=your_salt_here
|
||||||
|
|
||||||
|
# ASP.NET Core 环境
|
||||||
|
ASPNETCORE_ENVIRONMENT=Development
|
||||||
+13
@@ -309,3 +309,16 @@ COMCMS.Web/wwwroot/userfiles/
|
|||||||
/COMCMS.Web/UploadTemp
|
/COMCMS.Web/UploadTemp
|
||||||
/WebTest/wwwroot
|
/WebTest/wwwroot
|
||||||
COMCMS.Web/wwwroot/install.lock
|
COMCMS.Web/wwwroot/install.lock
|
||||||
|
|
||||||
|
|
||||||
|
# others
|
||||||
|
.cursorrules
|
||||||
|
<<<<<<< HEAD
|
||||||
|
=======
|
||||||
|
|
||||||
|
# 环境变量文件(包含敏感信息)
|
||||||
|
.env
|
||||||
|
|
||||||
|
# 环境变量文件(包含敏感信息)
|
||||||
|
.env
|
||||||
|
>>>>>>> df478d351626c40c987712d66d991f327a698ff5
|
||||||
|
|||||||
@@ -0,0 +1,169 @@
|
|||||||
|
# CLAUDE.md
|
||||||
|
|
||||||
|
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
||||||
|
|
||||||
|
## 项目概述
|
||||||
|
|
||||||
|
COMCMS NetCore 是一个基于 .NET 10 的内容管理系统(CMS),包含后台管理和前台展示功能。支持二次开发扩展为商城系统、小程序、APP服务端等。
|
||||||
|
|
||||||
|
## 常用命令
|
||||||
|
|
||||||
|
### 构建和运行
|
||||||
|
```bash
|
||||||
|
# 构建整个解决方案
|
||||||
|
dotnet build COMCMS_NETCORE.sln
|
||||||
|
|
||||||
|
# 运行 Web 项目(开发模式)
|
||||||
|
cd COMCMS.Web
|
||||||
|
dotnet run
|
||||||
|
|
||||||
|
# 发布 Web 项目
|
||||||
|
dotnet publish -c Release -o ./publish
|
||||||
|
|
||||||
|
# 使用 Docker 运行
|
||||||
|
cd COMCMS.Web
|
||||||
|
docker build -t comcms .
|
||||||
|
docker run -p 80:80 comcms
|
||||||
|
```
|
||||||
|
|
||||||
|
### 数据库初始化
|
||||||
|
项目支持 MySQL 5.7/8.0 和 SQL Server 2008+ 数据库。初始化脚本位于 `data` 目录:
|
||||||
|
- `comcms_for_windows.sql` - Windows 环境的 MySQL 初始化脚本
|
||||||
|
- `comcms_for_linux.sql` - Linux 环境的 MySQL 初始化脚本
|
||||||
|
- `comcms_sqlserver.sql` - SQL Server 初始化脚本
|
||||||
|
|
||||||
|
### 测试
|
||||||
|
```bash
|
||||||
|
# 运行所有测试(如果存在)
|
||||||
|
dotnet test
|
||||||
|
|
||||||
|
# 运行特定项目测试
|
||||||
|
dotnet test [项目名称]
|
||||||
|
```
|
||||||
|
|
||||||
|
## 项目架构
|
||||||
|
|
||||||
|
### 核心组件
|
||||||
|
1. **COMCMS.Web** - ASP.NET Core MVC 网站,包含前台和后台管理界面
|
||||||
|
2. **COMCMS.Core** - 核心业务逻辑和数据访问层,使用 XCode ORM
|
||||||
|
3. **COMCMS.Common** - 通用工具类库
|
||||||
|
4. **COMCMS.API** - API 接口层(预留)
|
||||||
|
5. **Lib.Core** - 中间件库
|
||||||
|
6. **NewLife.UserGroup.WebUploader** - 大文件上传组件
|
||||||
|
7. **XCoder** - 代码生成器
|
||||||
|
|
||||||
|
### 数据层架构
|
||||||
|
- 使用 **XCode ORM** 进行数据访问,支持 MySQL 和 SQL Server
|
||||||
|
- 实体类采用部分类设计,包含实体定义(.cs)和业务逻辑(.Biz.cs)
|
||||||
|
- 每个实体类使用 `[BindTable]` 特性映射到数据库表
|
||||||
|
- 支持缓存机制,使用 Redis 作为分布式缓存
|
||||||
|
|
||||||
|
### Web 层结构
|
||||||
|
- **前台控制器**:位于 `Controllers/` 目录
|
||||||
|
- **后台管理**:位于 `Areas/AdminCP/`,使用 MVC Areas 组织
|
||||||
|
- **API 接口**:位于 `Controllers/api/`,提供 RESTful API
|
||||||
|
- **视图**:Razor 视图,后台使用 H+ 模板
|
||||||
|
- **静态资源**:位于 `wwwroot/`,包含编辑器(CKEditor)、上传组件(WebUploader)等
|
||||||
|
|
||||||
|
### 功能模块
|
||||||
|
- **文章系统**:文章管理、栏目管理、标签系统
|
||||||
|
- **商城模块**:商品管理、订单管理、购物车、优惠券
|
||||||
|
- **用户系统**:用户管理、角色权限、地址管理、余额管理
|
||||||
|
- **系统管理**:系统配置、数据字典、菜单权限、日志管理
|
||||||
|
- **微信集成**:微信公众号、微信支付
|
||||||
|
|
||||||
|
## 技术栈
|
||||||
|
|
||||||
|
- **.NET 10** - 主框架
|
||||||
|
- **MySQL/SQL Server** - 数据库
|
||||||
|
- **XCode ORM** - 数据访问层
|
||||||
|
- **Redis** - 分布式缓存
|
||||||
|
- **JWT** - 身份认证
|
||||||
|
- **CKEditor** - 富文本编辑器
|
||||||
|
- **WebUploader** - 文件上传
|
||||||
|
- **Senparc Weixin SDK** - 微信开发
|
||||||
|
|
||||||
|
## 配置说明
|
||||||
|
|
||||||
|
### 数据库连接
|
||||||
|
在 `appsettings.json` 中配置数据库连接字符串:
|
||||||
|
```json
|
||||||
|
"connectionStrings": {
|
||||||
|
"dbconn": {
|
||||||
|
"connectionString": "Server=.;Port=3306;Database=comcms;Uid=root;Pwd=root;charset=utf8mb4",
|
||||||
|
"providerName": "MySql.Data.MySqlClient"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Redis 缓存配置
|
||||||
|
```json
|
||||||
|
"RedisCache": {
|
||||||
|
"ConnectionString": "server=127.0.0.1;password=;db=2",
|
||||||
|
"InstanceName": "COMCMS:",
|
||||||
|
"DefaultDatabase": 2
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### 系统配置
|
||||||
|
```json
|
||||||
|
"SystemSetting": {
|
||||||
|
"FileAllowedExtensions": "zip,rar,7z,doc,docx,xls,xlsx,ppt,pptx,csv,pdf,txt,gz,gzip,gif,png,jpg,jpeg,bmp,avi,fla,flv,swf,mp4,mp3,mov,mid,mpg,mpeg,rm,rmvb,wma,wav,wmv",
|
||||||
|
"ImageAllowedExtensions": "gif,png,jpg,jpeg,bmp",
|
||||||
|
"JwtSecret": "your-jwt-secret",
|
||||||
|
"COMCMSPrefixKey": "abc_"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## 开发指南
|
||||||
|
|
||||||
|
### 添加新功能模块
|
||||||
|
1. 在 `COMCMS.Core` 中创建实体类和业务逻辑
|
||||||
|
2. 使用 XCoder 代码生成器生成基础代码
|
||||||
|
3. 在 `COMCMS.Web` 中添加控制器和视图
|
||||||
|
4. 更新菜单权限配置
|
||||||
|
|
||||||
|
### 权限控制
|
||||||
|
- 后台使用 `AdminBaseController` 进行登录验证
|
||||||
|
- 使用 `[MyAuthorize]` 特性进行权限控制
|
||||||
|
- 菜单和事件权限在 `后台菜单` 和 `目标事件` 表中配置
|
||||||
|
|
||||||
|
### 缓存使用
|
||||||
|
- 通过 `ICacheService` 接口使用缓存
|
||||||
|
- 支持分布式缓存(Redis)和内存缓存
|
||||||
|
- 在 `CacheSettings` 中配置不同类型数据的过期时间
|
||||||
|
|
||||||
|
### 文件上传
|
||||||
|
- 使用 WebUploader 组件处理文件上传
|
||||||
|
- 在 `UploadController` 中处理上传逻辑
|
||||||
|
- 支持图片、文件、媒体等多种类型
|
||||||
|
|
||||||
|
## 部署说明
|
||||||
|
|
||||||
|
### Docker 部署
|
||||||
|
项目包含 Dockerfile,支持容器化部署:
|
||||||
|
```dockerfile
|
||||||
|
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim AS base
|
||||||
|
WORKDIR /app
|
||||||
|
EXPOSE 80
|
||||||
|
COPY . .
|
||||||
|
ENTRYPOINT ["dotnet", "COMCMS.Web.dll"]
|
||||||
|
```
|
||||||
|
|
||||||
|
注意:Dockerfile 中的 .NET 版本需要更新到与项目一致的版本。
|
||||||
|
|
||||||
|
### 环境要求
|
||||||
|
- .NET 10 Runtime 或 SDK
|
||||||
|
- MySQL 5.7+ 或 SQL Server 2008+
|
||||||
|
- Redis(可选,用于分布式缓存)
|
||||||
|
|
||||||
|
### 默认账号
|
||||||
|
- 后台管理员账号:admin / admin
|
||||||
|
- 登录地址:/AdminCP
|
||||||
|
|
||||||
|
## 重要提示
|
||||||
|
|
||||||
|
- 项目使用中文命名实体类和字段,这是为了便于中文开发者理解
|
||||||
|
- 修改数据库结构后需要更新相应的实体类
|
||||||
|
- 部署前确保正确配置数据库连接字符串和系统配置
|
||||||
|
- 建议使用源码管理保存自定义修改,避免升级时覆盖
|
||||||
@@ -1,13 +1,17 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net7.0</TargetFramework>
|
<<<<<<< HEAD
|
||||||
|
<TargetFramework>net10.0</TargetFramework>
|
||||||
|
=======
|
||||||
|
<TargetFramework>net9.0</TargetFramework>
|
||||||
|
>>>>>>> df478d351626c40c987712d66d991f327a698ff5
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="NewLife.Core" Version="10.2.2023.301" />
|
<PackageReference Include="NewLife.Core" Version="11.9.2025.1112" />
|
||||||
<PackageReference Include="Senparc.Weixin" Version="6.15.8.7" />
|
<PackageReference Include="Senparc.Weixin" Version="6.23.0" />
|
||||||
<PackageReference Include="Senparc.Weixin.MP" Version="16.18.10.6" />
|
<PackageReference Include="Senparc.Weixin.MP" Version="16.24.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
+25
-15
@@ -1,5 +1,7 @@
|
|||||||
using System;
|
using Microsoft.AspNetCore.DataProtection.KeyManagement;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
using System.Security.Cryptography;
|
using System.Security.Cryptography;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
@@ -23,15 +25,18 @@ namespace COMCMS.Common
|
|||||||
encryptKey = GetSubString(encryptKey, 0, 32, "");
|
encryptKey = GetSubString(encryptKey, 0, 32, "");
|
||||||
encryptKey = encryptKey.PadRight(32, ' ');
|
encryptKey = encryptKey.PadRight(32, ' ');
|
||||||
|
|
||||||
RijndaelManaged rijndaelProvider = new RijndaelManaged();
|
|
||||||
rijndaelProvider.Key = Encoding.UTF8.GetBytes(encryptKey.Substring(0, 32));
|
|
||||||
rijndaelProvider.IV = Keys;
|
|
||||||
ICryptoTransform rijndaelEncrypt = rijndaelProvider.CreateEncryptor();
|
|
||||||
|
|
||||||
byte[] inputData = Encoding.UTF8.GetBytes(encryptString);
|
byte[] inputData = Encoding.UTF8.GetBytes(encryptString);
|
||||||
byte[] encryptedData = rijndaelEncrypt.TransformFinalBlock(inputData, 0, inputData.Length);
|
|
||||||
|
|
||||||
return Convert.ToBase64String(encryptedData);
|
using Aes aes = Aes.Create();
|
||||||
|
aes.Key = Encoding.UTF8.GetBytes(encryptKey.Substring(0, 32));
|
||||||
|
aes.IV = Keys;
|
||||||
|
|
||||||
|
using MemoryStream ms = new MemoryStream();
|
||||||
|
using CryptoStream cs = new CryptoStream(ms, aes.CreateEncryptor(), CryptoStreamMode.Write);
|
||||||
|
|
||||||
|
cs.Write(inputData, 0, inputData.Length);
|
||||||
|
cs.FlushFinalBlock();
|
||||||
|
return Convert.ToBase64String(ms.ToArray());
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 解密
|
/// 解密
|
||||||
@@ -46,15 +51,20 @@ namespace COMCMS.Common
|
|||||||
decryptKey = GetSubString(decryptKey, 0, 32, "");
|
decryptKey = GetSubString(decryptKey, 0, 32, "");
|
||||||
decryptKey = decryptKey.PadRight(32, ' ');
|
decryptKey = decryptKey.PadRight(32, ' ');
|
||||||
|
|
||||||
RijndaelManaged rijndaelProvider = new RijndaelManaged();
|
|
||||||
rijndaelProvider.Key = Encoding.UTF8.GetBytes(decryptKey);
|
|
||||||
rijndaelProvider.IV = Keys;
|
|
||||||
ICryptoTransform rijndaelDecrypt = rijndaelProvider.CreateDecryptor();
|
|
||||||
|
|
||||||
byte[] inputData = Convert.FromBase64String(decryptString);
|
byte[] inputData = Convert.FromBase64String(decryptString);
|
||||||
byte[] decryptedData = rijndaelDecrypt.TransformFinalBlock(inputData, 0, inputData.Length);
|
|
||||||
|
|
||||||
return Encoding.UTF8.GetString(decryptedData);
|
using Aes aes = Aes.Create();
|
||||||
|
aes.Key = Encoding.UTF8.GetBytes(decryptKey);
|
||||||
|
aes.IV = Keys;
|
||||||
|
|
||||||
|
using MemoryStream ms = new MemoryStream();
|
||||||
|
using CryptoStream cs = new CryptoStream(ms, aes.CreateDecryptor(), CryptoStreamMode.Write);
|
||||||
|
|
||||||
|
cs.Write(inputData, 0, inputData.Length);
|
||||||
|
cs.FlushFinalBlock();
|
||||||
|
|
||||||
|
|
||||||
|
return Encoding.UTF8.GetString(ms.ToArray());
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,18 +1,22 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net7.0</TargetFramework>
|
<<<<<<< HEAD
|
||||||
|
<TargetFramework>net10.0</TargetFramework>
|
||||||
|
=======
|
||||||
|
<TargetFramework>net9.0</TargetFramework>
|
||||||
|
>>>>>>> df478d351626c40c987712d66d991f327a698ff5
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<FrameworkReference Include="Microsoft.AspNetCore.App" />
|
<FrameworkReference Include="Microsoft.AspNetCore.App" />
|
||||||
<PackageReference Include="NewLife.Core" Version="10.2.2023.301" />
|
<PackageReference Include="NewLife.Core" Version="11.9.2025.1112" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
<PackageReference Include="Newtonsoft.Json" Version="13.0.4" />
|
||||||
<PackageReference Include="PinYinConverterCore" Version="1.0.2" />
|
<PackageReference Include="PinYinConverterCore" Version="1.0.2" />
|
||||||
<PackageReference Include="SkiaSharp" Version="2.88.3" />
|
<PackageReference Include="SkiaSharp" Version="3.119.1" />
|
||||||
<PackageReference Include="SkiaSharp.NativeAssets.Linux" Version="2.88.3" />
|
<PackageReference Include="SkiaSharp.NativeAssets.Linux" Version="3.119.1" />
|
||||||
<PackageReference Include="SkiaSharp.QrCode" Version="0.6.0" />
|
<PackageReference Include="SkiaSharp.QrCode" Version="0.9.0" />
|
||||||
<PackageReference Include="System.Configuration.ConfigurationManager" Version="7.0.0" />
|
<PackageReference Include="System.Configuration.ConfigurationManager" Version="10.0.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
+25
-2
@@ -209,6 +209,10 @@ namespace COMCMS.Common
|
|||||||
{
|
{
|
||||||
http = "https://";
|
http = "https://";
|
||||||
}
|
}
|
||||||
|
if (MyHttpContext.Current.Request.Headers["X-Scheme"].ToString() == "https")//增加判断反向代理
|
||||||
|
{
|
||||||
|
http = "https://";
|
||||||
|
}
|
||||||
string port = MyHttpContext.Current.Request.Host.Port.ToString();
|
string port = MyHttpContext.Current.Request.Host.Port.ToString();
|
||||||
if (string.IsNullOrEmpty(port) || port == "80" || port == "443")
|
if (string.IsNullOrEmpty(port) || port == "80" || port == "443")
|
||||||
return http + MyHttpContext.Current.Request.Host.Host;
|
return http + MyHttpContext.Current.Request.Host.Host;
|
||||||
@@ -383,7 +387,15 @@ namespace COMCMS.Common
|
|||||||
{
|
{
|
||||||
return Regex.IsMatch(StrSource, @"^((((1[6-9]|[2-9]\d)\d{2})-(0?[13578]|1[02])-(0?[1-9]|[12]\d|3[01]))|(((1[6-9]|[2-9]\d)\d{2})-(0?[13456789]|1[012])-(0?[1-9]|[12]\d|30))|(((1[6-9]|[2-9]\d)\d{2})-0?2-(0?[1-9]|1\d|2[0-9]))|(((1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00))-0?2-29-))$");
|
return Regex.IsMatch(StrSource, @"^((((1[6-9]|[2-9]\d)\d{2})-(0?[13578]|1[02])-(0?[1-9]|[12]\d|3[01]))|(((1[6-9]|[2-9]\d)\d{2})-(0?[13456789]|1[012])-(0?[1-9]|[12]\d|30))|(((1[6-9]|[2-9]\d)\d{2})-0?2-(0?[1-9]|1\d|2[0-9]))|(((1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00))-0?2-29-))$");
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 是否为日期+时间型字符串
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="source"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static bool IsDateTime(string StrSource)
|
||||||
|
{
|
||||||
|
return Regex.IsMatch(StrSource, @"^((([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]{1}|[0-9]{1}[1-9][0-9]{2}|[1-9][0-9]{3})-(((0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)-(0[1-9]|[12][0-9]|30))|(02-(0[1-9]|[1][0-9]|2[0-8]))))|((([0-9]{2})(0[48]|[2468][048]|[13579][26])|((0[48]|[2468][048]|[3579][26])00))-02-29))\s([0-1][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])$");
|
||||||
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 正则手机型号
|
/// 正则手机型号
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -753,7 +765,18 @@ namespace COMCMS.Common
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
string extname = filename.Substring(filename.LastIndexOf(".") + 1).ToLower();
|
string extname = filename.Substring(filename.LastIndexOf(".") + 1).ToLower();
|
||||||
return (extname == "jpg" || extname == "jpeg" || extname == "png" || extname == "bmp" || extname == "gif");
|
|
||||||
|
// 从配置中获取图片扩展名列表
|
||||||
|
string imageExtensions = Configuration["SystemSetting:ImageExtensions"];
|
||||||
|
if (string.IsNullOrEmpty(imageExtensions))
|
||||||
|
{
|
||||||
|
// 如果配置中没有设置,则使用默认值
|
||||||
|
imageExtensions = "jpg,jpeg,png,bmp,gif";
|
||||||
|
}
|
||||||
|
|
||||||
|
// 将扩展名列表分割成数组并检查
|
||||||
|
string[] extensions = imageExtensions.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
|
||||||
|
return extensions.Contains(extname);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ using System.ComponentModel;
|
|||||||
using XCode;
|
using XCode;
|
||||||
using XCode.Configuration;
|
using XCode.Configuration;
|
||||||
using XCode.DataAccessLayer;
|
using XCode.DataAccessLayer;
|
||||||
|
using NewLife;
|
||||||
|
|
||||||
namespace COMCMS.Core
|
namespace COMCMS.Core
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ using System.Xml.Serialization;
|
|||||||
using XCode;
|
using XCode;
|
||||||
using XCode.Configuration;
|
using XCode.Configuration;
|
||||||
using XCode.DataAccessLayer;
|
using XCode.DataAccessLayer;
|
||||||
|
using NewLife;
|
||||||
|
|
||||||
namespace COMCMS.Core
|
namespace COMCMS.Core
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,12 +1,16 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net7.0</TargetFramework>
|
<<<<<<< HEAD
|
||||||
|
<TargetFramework>net10.0</TargetFramework>
|
||||||
|
=======
|
||||||
|
<TargetFramework>net9.0</TargetFramework>
|
||||||
|
>>>>>>> df478d351626c40c987712d66d991f327a698ff5
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="NewLife.XCode" Version="11.6.2023.302" />
|
<PackageReference Include="NewLife.XCode" Version="11.22.2025.1112" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
<PackageReference Include="Newtonsoft.Json" Version="13.0.4" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ using System.Xml.Serialization;
|
|||||||
using XCode;
|
using XCode;
|
||||||
using XCode.Configuration;
|
using XCode.Configuration;
|
||||||
using XCode.DataAccessLayer;
|
using XCode.DataAccessLayer;
|
||||||
|
using NewLife;
|
||||||
|
|
||||||
namespace COMCMS.Core
|
namespace COMCMS.Core
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ using System.Xml.Serialization;
|
|||||||
using XCode;
|
using XCode;
|
||||||
using XCode.Configuration;
|
using XCode.Configuration;
|
||||||
using XCode.DataAccessLayer;
|
using XCode.DataAccessLayer;
|
||||||
|
using NewLife;
|
||||||
|
|
||||||
namespace COMCMS.Core
|
namespace COMCMS.Core
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -75,6 +75,21 @@ namespace COMCMS.Core
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static string EchoURL(Product model)
|
public static string EchoURL(Product model)
|
||||||
{
|
{
|
||||||
|
if (model == null)
|
||||||
|
return "javascript:;";
|
||||||
|
|
||||||
|
Category categoty = Category.FindById(model.KId);
|
||||||
|
|
||||||
|
if (categoty != null && !string.IsNullOrEmpty(categoty.FilePath))
|
||||||
|
{
|
||||||
|
string url = $"{categoty.FilePath}/{model.Id}.html";
|
||||||
|
if (!string.IsNullOrEmpty(model.FileName))
|
||||||
|
{
|
||||||
|
url = $"{categoty.FilePath}/{model.FileName}";
|
||||||
|
}
|
||||||
|
return url;
|
||||||
|
}
|
||||||
|
else
|
||||||
return $"/product/detail/{model.Id}";
|
return $"/product/detail/{model.Id}";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -149,5 +164,28 @@ namespace COMCMS.Core
|
|||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region 生成商品地址
|
||||||
|
/// <summary>
|
||||||
|
/// 生成商品分类地址
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static string EchoCategoryURL(int id)
|
||||||
|
{
|
||||||
|
Category model = Category.FindById(id);
|
||||||
|
return EchoURL(model);
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 生成商品详情地址
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static string EchoProductURL(int id)
|
||||||
|
{
|
||||||
|
Product model = Product.FindById(id);
|
||||||
|
return EchoURL(model);
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ using System.ComponentModel;
|
|||||||
using XCode;
|
using XCode;
|
||||||
using XCode.Configuration;
|
using XCode.Configuration;
|
||||||
using XCode.DataAccessLayer;
|
using XCode.DataAccessLayer;
|
||||||
|
using NewLife;
|
||||||
|
|
||||||
namespace COMCMS.Core
|
namespace COMCMS.Core
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ using System.ComponentModel;
|
|||||||
using XCode;
|
using XCode;
|
||||||
using XCode.Configuration;
|
using XCode.Configuration;
|
||||||
using XCode.DataAccessLayer;
|
using XCode.DataAccessLayer;
|
||||||
|
using NewLife;
|
||||||
|
|
||||||
namespace COMCMS.Core
|
namespace COMCMS.Core
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ using System.ComponentModel;
|
|||||||
using XCode;
|
using XCode;
|
||||||
using XCode.Configuration;
|
using XCode.Configuration;
|
||||||
using XCode.DataAccessLayer;
|
using XCode.DataAccessLayer;
|
||||||
|
using NewLife;
|
||||||
|
|
||||||
namespace COMCMS.Core
|
namespace COMCMS.Core
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ using System.ComponentModel;
|
|||||||
using XCode;
|
using XCode;
|
||||||
using XCode.Configuration;
|
using XCode.Configuration;
|
||||||
using XCode.DataAccessLayer;
|
using XCode.DataAccessLayer;
|
||||||
|
using NewLife;
|
||||||
|
|
||||||
namespace COMCMS.Core
|
namespace COMCMS.Core
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ using System.ComponentModel;
|
|||||||
using XCode;
|
using XCode;
|
||||||
using XCode.Configuration;
|
using XCode.Configuration;
|
||||||
using XCode.DataAccessLayer;
|
using XCode.DataAccessLayer;
|
||||||
|
using NewLife;
|
||||||
|
|
||||||
namespace COMCMS.Core
|
namespace COMCMS.Core
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,112 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.ComponentModel;
|
|
||||||
using System.IO;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Reflection;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Web;
|
|
||||||
using System.Xml.Serialization;
|
|
||||||
using NewLife;
|
|
||||||
using NewLife.Data;
|
|
||||||
using NewLife.Log;
|
|
||||||
using NewLife.Model;
|
|
||||||
using NewLife.Reflection;
|
|
||||||
using NewLife.Threading;
|
|
||||||
using NewLife.Web;
|
|
||||||
using XCode;
|
|
||||||
using XCode.Cache;
|
|
||||||
using XCode.Configuration;
|
|
||||||
using XCode.DataAccessLayer;
|
|
||||||
using XCode.Membership;
|
|
||||||
|
|
||||||
namespace COMCMS.Core
|
|
||||||
{
|
|
||||||
/// <summary>小程序Session</summary>
|
|
||||||
public partial class WXAppSession : Entity<WXAppSession>
|
|
||||||
{
|
|
||||||
#region 对象操作
|
|
||||||
static WXAppSession()
|
|
||||||
{
|
|
||||||
// 累加字段
|
|
||||||
//Meta.Factory.AdditionalFields.Add(__.Logins);
|
|
||||||
|
|
||||||
// 过滤器 UserModule、TimeModule、IPModule
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>验证数据,通过抛出异常的方式提示验证失败。</summary>
|
|
||||||
/// <param name="isNew">是否插入</param>
|
|
||||||
public override void Valid(Boolean isNew)
|
|
||||||
{
|
|
||||||
// 如果没有脏数据,则不需要进行任何处理
|
|
||||||
if (!HasDirty) return;
|
|
||||||
|
|
||||||
// 在新插入数据或者修改了指定字段时进行修正
|
|
||||||
}
|
|
||||||
|
|
||||||
///// <summary>首次连接数据库时初始化数据,仅用于实体类重载,用户不应该调用该方法</summary>
|
|
||||||
//[EditorBrowsable(EditorBrowsableState.Never)]
|
|
||||||
//protected override void InitData()
|
|
||||||
//{
|
|
||||||
// // InitData一般用于当数据表没有数据时添加一些默认数据,该实体类的任何第一次数据库操作都会触发该方法,默认异步调用
|
|
||||||
// if (Meta.Count > 0) return;
|
|
||||||
|
|
||||||
// if (XTrace.Debug) XTrace.WriteLine("开始初始化WXAppSession[小程序Session]数据……");
|
|
||||||
|
|
||||||
// var entity = new WXAppSession();
|
|
||||||
// entity.Id = 0;
|
|
||||||
// entity.UId = 0;
|
|
||||||
// entity.IP = "abc";
|
|
||||||
// entity.Key = "abc";
|
|
||||||
// entity.SessionKey = "abc";
|
|
||||||
// entity.OpenId = "abc";
|
|
||||||
// entity.AddTime = DateTime.Now;
|
|
||||||
// entity.Insert();
|
|
||||||
|
|
||||||
// if (XTrace.Debug) XTrace.WriteLine("完成初始化WXAppSession[小程序Session]数据!");
|
|
||||||
//}
|
|
||||||
|
|
||||||
///// <summary>已重载。基类先调用Valid(true)验证数据,然后在事务保护内调用OnInsert</summary>
|
|
||||||
///// <returns></returns>
|
|
||||||
//public override Int32 Insert()
|
|
||||||
//{
|
|
||||||
// return base.Insert();
|
|
||||||
//}
|
|
||||||
|
|
||||||
///// <summary>已重载。在事务保护范围内处理业务,位于Valid之后</summary>
|
|
||||||
///// <returns></returns>
|
|
||||||
//protected override Int32 OnDelete()
|
|
||||||
//{
|
|
||||||
// return base.OnDelete();
|
|
||||||
//}
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region 扩展属性
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region 扩展查询
|
|
||||||
/// <summary>根据编号查找</summary>
|
|
||||||
/// <param name="id">编号</param>
|
|
||||||
/// <returns>实体对象</returns>
|
|
||||||
public static WXAppSession FindById(Int32 id)
|
|
||||||
{
|
|
||||||
if (id <= 0) return null;
|
|
||||||
|
|
||||||
// 实体缓存
|
|
||||||
if (Meta.Count < 1000) return Meta.Cache.Find(e => e.Id == id);
|
|
||||||
|
|
||||||
// 单对象缓存
|
|
||||||
//return Meta.SingleCache[id];
|
|
||||||
|
|
||||||
return Find(_.Id == id);
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region 高级查询
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region 业务操作
|
|
||||||
#endregion
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,200 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.ComponentModel;
|
|
||||||
using XCode;
|
|
||||||
using XCode.Configuration;
|
|
||||||
using XCode.DataAccessLayer;
|
|
||||||
|
|
||||||
namespace COMCMS.Core
|
|
||||||
{
|
|
||||||
/// <summary>小程序Session</summary>
|
|
||||||
[Serializable]
|
|
||||||
[DataObject]
|
|
||||||
[Description("小程序Session")]
|
|
||||||
[BindTable("WXAppSession", Description = "小程序Session", ConnName = "dbconn", DbType = DatabaseType.SqlServer)]
|
|
||||||
public partial class WXAppSession : IWXAppSession
|
|
||||||
{
|
|
||||||
#region 属性
|
|
||||||
private Int32 _Id;
|
|
||||||
/// <summary>编号</summary>
|
|
||||||
[DisplayName("编号")]
|
|
||||||
[Description("编号")]
|
|
||||||
[DataObjectField(true, true, false, 0)]
|
|
||||||
[BindColumn("Id", "编号", "int")]
|
|
||||||
public Int32 Id { get { return _Id; } set { if (OnPropertyChanging(__.Id, value)) { _Id = value; OnPropertyChanged(__.Id); } } }
|
|
||||||
|
|
||||||
private Int32 _UId;
|
|
||||||
/// <summary>用户ID</summary>
|
|
||||||
[DisplayName("用户ID")]
|
|
||||||
[Description("用户ID")]
|
|
||||||
[DataObjectField(false, false, false, 0)]
|
|
||||||
[BindColumn("UId", "用户ID", "int")]
|
|
||||||
public Int32 UId { get { return _UId; } set { if (OnPropertyChanging(__.UId, value)) { _UId = value; OnPropertyChanged(__.UId); } } }
|
|
||||||
|
|
||||||
private String _IP;
|
|
||||||
/// <summary>登录IP</summary>
|
|
||||||
[DisplayName("登录IP")]
|
|
||||||
[Description("登录IP")]
|
|
||||||
[DataObjectField(false, false, true, 20)]
|
|
||||||
[BindColumn("IP", "登录IP", "nvarchar(20)")]
|
|
||||||
public String IP { get { return _IP; } set { if (OnPropertyChanging(__.IP, value)) { _IP = value; OnPropertyChanged(__.IP); } } }
|
|
||||||
|
|
||||||
private String _Key;
|
|
||||||
/// <summary>系统生成Key</summary>
|
|
||||||
[DisplayName("系统生成Key")]
|
|
||||||
[Description("系统生成Key")]
|
|
||||||
[DataObjectField(false, false, true, 50)]
|
|
||||||
[BindColumn("Key", "系统生成Key", "nvarchar(50)")]
|
|
||||||
public String Key { get { return _Key; } set { if (OnPropertyChanging(__.Key, value)) { _Key = value; OnPropertyChanged(__.Key); } } }
|
|
||||||
|
|
||||||
private String _SessionKey;
|
|
||||||
/// <summary>微信SessionKey</summary>
|
|
||||||
[DisplayName("微信SessionKey")]
|
|
||||||
[Description("微信SessionKey")]
|
|
||||||
[DataObjectField(false, false, true, 50)]
|
|
||||||
[BindColumn("SessionKey", "微信SessionKey", "nvarchar(50)")]
|
|
||||||
public String SessionKey { get { return _SessionKey; } set { if (OnPropertyChanging(__.SessionKey, value)) { _SessionKey = value; OnPropertyChanged(__.SessionKey); } } }
|
|
||||||
|
|
||||||
private String _OpenId;
|
|
||||||
/// <summary>微信小程序OpenId</summary>
|
|
||||||
[DisplayName("微信小程序OpenId")]
|
|
||||||
[Description("微信小程序OpenId")]
|
|
||||||
[DataObjectField(false, false, true, 50)]
|
|
||||||
[BindColumn("OpenId", "微信小程序OpenId", "nvarchar(50)")]
|
|
||||||
public String OpenId { get { return _OpenId; } set { if (OnPropertyChanging(__.OpenId, value)) { _OpenId = value; OnPropertyChanged(__.OpenId); } } }
|
|
||||||
|
|
||||||
private DateTime _AddTime;
|
|
||||||
/// <summary>添加时间</summary>
|
|
||||||
[DisplayName("添加时间")]
|
|
||||||
[Description("添加时间")]
|
|
||||||
[DataObjectField(false, false, true, 0)]
|
|
||||||
[BindColumn("AddTime", "添加时间", "datetime")]
|
|
||||||
public DateTime AddTime { get { return _AddTime; } set { if (OnPropertyChanging(__.AddTime, value)) { _AddTime = value; OnPropertyChanged(__.AddTime); } } }
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region 获取/设置 字段值
|
|
||||||
/// <summary>获取/设置 字段值</summary>
|
|
||||||
/// <param name="name">字段名</param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public override Object this[String name]
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
switch (name)
|
|
||||||
{
|
|
||||||
case __.Id : return _Id;
|
|
||||||
case __.UId : return _UId;
|
|
||||||
case __.IP : return _IP;
|
|
||||||
case __.Key : return _Key;
|
|
||||||
case __.SessionKey : return _SessionKey;
|
|
||||||
case __.OpenId : return _OpenId;
|
|
||||||
case __.AddTime : return _AddTime;
|
|
||||||
default: return base[name];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
switch (name)
|
|
||||||
{
|
|
||||||
case __.Id : _Id = Convert.ToInt32(value); break;
|
|
||||||
case __.UId : _UId = Convert.ToInt32(value); break;
|
|
||||||
case __.IP : _IP = Convert.ToString(value); break;
|
|
||||||
case __.Key : _Key = Convert.ToString(value); break;
|
|
||||||
case __.SessionKey : _SessionKey = Convert.ToString(value); break;
|
|
||||||
case __.OpenId : _OpenId = Convert.ToString(value); break;
|
|
||||||
case __.AddTime : _AddTime = Convert.ToDateTime(value); break;
|
|
||||||
default: base[name] = value; break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region 字段名
|
|
||||||
/// <summary>取得小程序Session字段信息的快捷方式</summary>
|
|
||||||
public partial class _
|
|
||||||
{
|
|
||||||
/// <summary>编号</summary>
|
|
||||||
public static readonly Field Id = FindByName(__.Id);
|
|
||||||
|
|
||||||
/// <summary>用户ID</summary>
|
|
||||||
public static readonly Field UId = FindByName(__.UId);
|
|
||||||
|
|
||||||
/// <summary>登录IP</summary>
|
|
||||||
public static readonly Field IP = FindByName(__.IP);
|
|
||||||
|
|
||||||
/// <summary>系统生成Key</summary>
|
|
||||||
public static readonly Field Key = FindByName(__.Key);
|
|
||||||
|
|
||||||
/// <summary>微信SessionKey</summary>
|
|
||||||
public static readonly Field SessionKey = FindByName(__.SessionKey);
|
|
||||||
|
|
||||||
/// <summary>微信小程序OpenId</summary>
|
|
||||||
public static readonly Field OpenId = FindByName(__.OpenId);
|
|
||||||
|
|
||||||
/// <summary>添加时间</summary>
|
|
||||||
public static readonly Field AddTime = FindByName(__.AddTime);
|
|
||||||
|
|
||||||
static Field FindByName(String name) { return Meta.Table.FindByName(name); }
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>取得小程序Session字段名称的快捷方式</summary>
|
|
||||||
public partial class __
|
|
||||||
{
|
|
||||||
/// <summary>编号</summary>
|
|
||||||
public const String Id = "Id";
|
|
||||||
|
|
||||||
/// <summary>用户ID</summary>
|
|
||||||
public const String UId = "UId";
|
|
||||||
|
|
||||||
/// <summary>登录IP</summary>
|
|
||||||
public const String IP = "IP";
|
|
||||||
|
|
||||||
/// <summary>系统生成Key</summary>
|
|
||||||
public const String Key = "Key";
|
|
||||||
|
|
||||||
/// <summary>微信SessionKey</summary>
|
|
||||||
public const String SessionKey = "SessionKey";
|
|
||||||
|
|
||||||
/// <summary>微信小程序OpenId</summary>
|
|
||||||
public const String OpenId = "OpenId";
|
|
||||||
|
|
||||||
/// <summary>添加时间</summary>
|
|
||||||
public const String AddTime = "AddTime";
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>小程序Session接口</summary>
|
|
||||||
public partial interface IWXAppSession
|
|
||||||
{
|
|
||||||
#region 属性
|
|
||||||
/// <summary>编号</summary>
|
|
||||||
Int32 Id { get; set; }
|
|
||||||
|
|
||||||
/// <summary>用户ID</summary>
|
|
||||||
Int32 UId { get; set; }
|
|
||||||
|
|
||||||
/// <summary>登录IP</summary>
|
|
||||||
String IP { get; set; }
|
|
||||||
|
|
||||||
/// <summary>系统生成Key</summary>
|
|
||||||
String Key { get; set; }
|
|
||||||
|
|
||||||
/// <summary>微信SessionKey</summary>
|
|
||||||
String SessionKey { get; set; }
|
|
||||||
|
|
||||||
/// <summary>微信小程序OpenId</summary>
|
|
||||||
String OpenId { get; set; }
|
|
||||||
|
|
||||||
/// <summary>添加时间</summary>
|
|
||||||
DateTime AddTime { get; set; }
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region 获取/设置 字段值
|
|
||||||
/// <summary>获取/设置 字段值</summary>
|
|
||||||
/// <param name="name">字段名</param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Object this[String name] { get; set; }
|
|
||||||
#endregion
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -4,6 +4,7 @@ using System.ComponentModel;
|
|||||||
using XCode;
|
using XCode;
|
||||||
using XCode.Configuration;
|
using XCode.Configuration;
|
||||||
using XCode.DataAccessLayer;
|
using XCode.DataAccessLayer;
|
||||||
|
using NewLife;
|
||||||
|
|
||||||
namespace COMCMS.Core
|
namespace COMCMS.Core
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ using System.ComponentModel;
|
|||||||
using XCode;
|
using XCode;
|
||||||
using XCode.Configuration;
|
using XCode.Configuration;
|
||||||
using XCode.DataAccessLayer;
|
using XCode.DataAccessLayer;
|
||||||
|
using NewLife;
|
||||||
|
|
||||||
namespace COMCMS.Core
|
namespace COMCMS.Core
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ using System.ComponentModel;
|
|||||||
using XCode;
|
using XCode;
|
||||||
using XCode.Configuration;
|
using XCode.Configuration;
|
||||||
using XCode.DataAccessLayer;
|
using XCode.DataAccessLayer;
|
||||||
|
using NewLife;
|
||||||
|
|
||||||
namespace COMCMS.Core
|
namespace COMCMS.Core
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ using System.ComponentModel;
|
|||||||
using XCode;
|
using XCode;
|
||||||
using XCode.Configuration;
|
using XCode.Configuration;
|
||||||
using XCode.DataAccessLayer;
|
using XCode.DataAccessLayer;
|
||||||
|
using NewLife;
|
||||||
|
|
||||||
namespace COMCMS.Core
|
namespace COMCMS.Core
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ using System.ComponentModel;
|
|||||||
using XCode;
|
using XCode;
|
||||||
using XCode.Configuration;
|
using XCode.Configuration;
|
||||||
using XCode.DataAccessLayer;
|
using XCode.DataAccessLayer;
|
||||||
|
using NewLife;
|
||||||
|
|
||||||
namespace COMCMS.Core
|
namespace COMCMS.Core
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ using System.ComponentModel;
|
|||||||
using XCode;
|
using XCode;
|
||||||
using XCode.Configuration;
|
using XCode.Configuration;
|
||||||
using XCode.DataAccessLayer;
|
using XCode.DataAccessLayer;
|
||||||
|
using NewLife;
|
||||||
|
|
||||||
namespace COMCMS.Core
|
namespace COMCMS.Core
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ using System.ComponentModel;
|
|||||||
using XCode;
|
using XCode;
|
||||||
using XCode.Configuration;
|
using XCode.Configuration;
|
||||||
using XCode.DataAccessLayer;
|
using XCode.DataAccessLayer;
|
||||||
|
using NewLife;
|
||||||
|
|
||||||
namespace COMCMS.Core
|
namespace COMCMS.Core
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ using System.ComponentModel;
|
|||||||
using XCode;
|
using XCode;
|
||||||
using XCode.Configuration;
|
using XCode.Configuration;
|
||||||
using XCode.DataAccessLayer;
|
using XCode.DataAccessLayer;
|
||||||
|
using NewLife;
|
||||||
|
|
||||||
namespace COMCMS.Core
|
namespace COMCMS.Core
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ using System.ComponentModel;
|
|||||||
using XCode;
|
using XCode;
|
||||||
using XCode.Configuration;
|
using XCode.Configuration;
|
||||||
using XCode.DataAccessLayer;
|
using XCode.DataAccessLayer;
|
||||||
|
using NewLife;
|
||||||
|
|
||||||
namespace COMCMS.Core
|
namespace COMCMS.Core
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ using System.ComponentModel;
|
|||||||
using XCode;
|
using XCode;
|
||||||
using XCode.Configuration;
|
using XCode.Configuration;
|
||||||
using XCode.DataAccessLayer;
|
using XCode.DataAccessLayer;
|
||||||
|
using NewLife;
|
||||||
|
|
||||||
namespace COMCMS.Core
|
namespace COMCMS.Core
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ using System.ComponentModel;
|
|||||||
using XCode;
|
using XCode;
|
||||||
using XCode.Configuration;
|
using XCode.Configuration;
|
||||||
using XCode.DataAccessLayer;
|
using XCode.DataAccessLayer;
|
||||||
|
using NewLife;
|
||||||
|
|
||||||
namespace COMCMS.Core
|
namespace COMCMS.Core
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ using System.ComponentModel;
|
|||||||
using XCode;
|
using XCode;
|
||||||
using XCode.Configuration;
|
using XCode.Configuration;
|
||||||
using XCode.DataAccessLayer;
|
using XCode.DataAccessLayer;
|
||||||
|
using NewLife;
|
||||||
|
|
||||||
namespace COMCMS.Core
|
namespace COMCMS.Core
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ using System.ComponentModel;
|
|||||||
using XCode;
|
using XCode;
|
||||||
using XCode.Configuration;
|
using XCode.Configuration;
|
||||||
using XCode.DataAccessLayer;
|
using XCode.DataAccessLayer;
|
||||||
|
using NewLife;
|
||||||
|
|
||||||
namespace COMCMS.Core
|
namespace COMCMS.Core
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ using System.ComponentModel;
|
|||||||
using XCode;
|
using XCode;
|
||||||
using XCode.Configuration;
|
using XCode.Configuration;
|
||||||
using XCode.DataAccessLayer;
|
using XCode.DataAccessLayer;
|
||||||
|
using NewLife;
|
||||||
|
|
||||||
namespace COMCMS.Core
|
namespace COMCMS.Core
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ using System.ComponentModel;
|
|||||||
using XCode;
|
using XCode;
|
||||||
using XCode.Configuration;
|
using XCode.Configuration;
|
||||||
using XCode.DataAccessLayer;
|
using XCode.DataAccessLayer;
|
||||||
|
using NewLife;
|
||||||
|
|
||||||
namespace COMCMS.Core
|
namespace COMCMS.Core
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ using System.ComponentModel;
|
|||||||
using XCode;
|
using XCode;
|
||||||
using XCode.Configuration;
|
using XCode.Configuration;
|
||||||
using XCode.DataAccessLayer;
|
using XCode.DataAccessLayer;
|
||||||
|
using NewLife;
|
||||||
|
|
||||||
namespace COMCMS.Core
|
namespace COMCMS.Core
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ using System.Xml.Serialization;
|
|||||||
using XCode;
|
using XCode;
|
||||||
using XCode.Configuration;
|
using XCode.Configuration;
|
||||||
using XCode.DataAccessLayer;
|
using XCode.DataAccessLayer;
|
||||||
|
using NewLife;
|
||||||
|
|
||||||
namespace COMCMS.Core
|
namespace COMCMS.Core
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ using System.ComponentModel;
|
|||||||
using XCode;
|
using XCode;
|
||||||
using XCode.Configuration;
|
using XCode.Configuration;
|
||||||
using XCode.DataAccessLayer;
|
using XCode.DataAccessLayer;
|
||||||
|
using NewLife;
|
||||||
|
|
||||||
namespace COMCMS.Core
|
namespace COMCMS.Core
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ using System.Xml.Serialization;
|
|||||||
using XCode;
|
using XCode;
|
||||||
using XCode.Configuration;
|
using XCode.Configuration;
|
||||||
using XCode.DataAccessLayer;
|
using XCode.DataAccessLayer;
|
||||||
|
using NewLife;
|
||||||
|
|
||||||
namespace COMCMS.Core
|
namespace COMCMS.Core
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ using System.ComponentModel;
|
|||||||
using XCode;
|
using XCode;
|
||||||
using XCode.Configuration;
|
using XCode.Configuration;
|
||||||
using XCode.DataAccessLayer;
|
using XCode.DataAccessLayer;
|
||||||
|
using NewLife;
|
||||||
|
|
||||||
namespace COMCMS.Core
|
namespace COMCMS.Core
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ using System.ComponentModel;
|
|||||||
using XCode;
|
using XCode;
|
||||||
using XCode.Configuration;
|
using XCode.Configuration;
|
||||||
using XCode.DataAccessLayer;
|
using XCode.DataAccessLayer;
|
||||||
|
using NewLife;
|
||||||
|
|
||||||
namespace COMCMS.Core
|
namespace COMCMS.Core
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ using System.ComponentModel;
|
|||||||
using XCode;
|
using XCode;
|
||||||
using XCode.Configuration;
|
using XCode.Configuration;
|
||||||
using XCode.DataAccessLayer;
|
using XCode.DataAccessLayer;
|
||||||
|
using NewLife;
|
||||||
|
|
||||||
namespace COMCMS.Core
|
namespace COMCMS.Core
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -198,6 +198,34 @@ namespace COMCMS.Core
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 业务操作
|
#region 业务操作
|
||||||
|
/// <summary>
|
||||||
|
/// 获取前几条数据
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="kid">栏目id</param>
|
||||||
|
/// <param name="records">条数</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static IList<Product> FindTopList(int kid, int records, bool isShowSub = false)
|
||||||
|
{
|
||||||
|
if (!isShowSub)
|
||||||
|
return FindAll(_.KId == kid & _.IsHide == 0, _.Id.Desc(), null, 0, records);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Expression ex = _.IsHide == 0;
|
||||||
|
List<int> kids = new List<int>();
|
||||||
|
kids.Add(kid);
|
||||||
|
IList<Category> subkinds = Category.FindByParentID(kid);
|
||||||
|
if (subkinds != null && subkinds.Count > 0)
|
||||||
|
{
|
||||||
|
foreach (var item in subkinds)
|
||||||
|
{
|
||||||
|
kids.Add(item.Id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ex &= _.KId.In(kids);
|
||||||
|
|
||||||
|
return FindAll(ex, _.Id.Desc(), null, 0, records);
|
||||||
|
}
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4,6 +4,7 @@ using System.ComponentModel;
|
|||||||
using XCode;
|
using XCode;
|
||||||
using XCode.Configuration;
|
using XCode.Configuration;
|
||||||
using XCode.DataAccessLayer;
|
using XCode.DataAccessLayer;
|
||||||
|
using NewLife;
|
||||||
|
|
||||||
namespace COMCMS.Core
|
namespace COMCMS.Core
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ using System.ComponentModel;
|
|||||||
using XCode;
|
using XCode;
|
||||||
using XCode.Configuration;
|
using XCode.Configuration;
|
||||||
using XCode.DataAccessLayer;
|
using XCode.DataAccessLayer;
|
||||||
|
using NewLife;
|
||||||
|
|
||||||
namespace COMCMS.Core
|
namespace COMCMS.Core
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ using System.ComponentModel;
|
|||||||
using XCode;
|
using XCode;
|
||||||
using XCode.Configuration;
|
using XCode.Configuration;
|
||||||
using XCode.DataAccessLayer;
|
using XCode.DataAccessLayer;
|
||||||
|
using NewLife;
|
||||||
|
|
||||||
namespace COMCMS.Core
|
namespace COMCMS.Core
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ using System.ComponentModel;
|
|||||||
using XCode;
|
using XCode;
|
||||||
using XCode.Configuration;
|
using XCode.Configuration;
|
||||||
using XCode.DataAccessLayer;
|
using XCode.DataAccessLayer;
|
||||||
|
using NewLife;
|
||||||
|
|
||||||
namespace COMCMS.Core
|
namespace COMCMS.Core
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ using System.ComponentModel;
|
|||||||
using XCode;
|
using XCode;
|
||||||
using XCode.Configuration;
|
using XCode.Configuration;
|
||||||
using XCode.DataAccessLayer;
|
using XCode.DataAccessLayer;
|
||||||
|
using NewLife;
|
||||||
|
|
||||||
namespace COMCMS.Core
|
namespace COMCMS.Core
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,178 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.ComponentModel;
|
|
||||||
using System.IO;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Reflection;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Web;
|
|
||||||
using System.Xml.Serialization;
|
|
||||||
using NewLife;
|
|
||||||
using NewLife.Data;
|
|
||||||
using NewLife.Log;
|
|
||||||
using NewLife.Model;
|
|
||||||
using NewLife.Reflection;
|
|
||||||
using NewLife.Threading;
|
|
||||||
using NewLife.Web;
|
|
||||||
using XCode;
|
|
||||||
using XCode.Cache;
|
|
||||||
using XCode.Configuration;
|
|
||||||
using XCode.DataAccessLayer;
|
|
||||||
using XCode.Membership;
|
|
||||||
|
|
||||||
namespace COMCMS.Core
|
|
||||||
{
|
|
||||||
/// <summary>快餐</summary>
|
|
||||||
public partial class Food : Entity<Food>
|
|
||||||
{
|
|
||||||
#region 对象操作
|
|
||||||
static Food()
|
|
||||||
{
|
|
||||||
// 累加字段
|
|
||||||
//Meta.Factory.AdditionalFields.Add(__.Logins);
|
|
||||||
|
|
||||||
// 过滤器 UserModule、TimeModule、IPModule
|
|
||||||
Meta.Modules.Add<TimeModule>();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>验证数据,通过抛出异常的方式提示验证失败。</summary>
|
|
||||||
/// <param name="isNew">是否插入</param>
|
|
||||||
public override void Valid(Boolean isNew)
|
|
||||||
{
|
|
||||||
// 如果没有脏数据,则不需要进行任何处理
|
|
||||||
if (!HasDirty) return;
|
|
||||||
|
|
||||||
// 在新插入数据或者修改了指定字段时进行修正
|
|
||||||
// 货币保留6位小数
|
|
||||||
Price = Math.Round(Price, 6);
|
|
||||||
MarketPrice = Math.Round(MarketPrice, 6);
|
|
||||||
SpecialPrice = Math.Round(SpecialPrice, 6);
|
|
||||||
Fare = Math.Round(Fare, 6);
|
|
||||||
Discount = Math.Round(Discount, 6);
|
|
||||||
//if (!Dirtys[nameof(UpdateTime)]) nameof(UpdateTime) = DateTime.Now;
|
|
||||||
}
|
|
||||||
|
|
||||||
///// <summary>首次连接数据库时初始化数据,仅用于实体类重载,用户不应该调用该方法</summary>
|
|
||||||
//[EditorBrowsable(EditorBrowsableState.Never)]
|
|
||||||
//protected override void InitData()
|
|
||||||
//{
|
|
||||||
// // InitData一般用于当数据表没有数据时添加一些默认数据,该实体类的任何第一次数据库操作都会触发该方法,默认异步调用
|
|
||||||
// if (Meta.Count > 0) return;
|
|
||||||
|
|
||||||
// if (XTrace.Debug) XTrace.WriteLine("开始初始化Food[快餐]数据……");
|
|
||||||
|
|
||||||
// var entity = new Food();
|
|
||||||
// entity.Id = 0;
|
|
||||||
// entity.KId = 0;
|
|
||||||
// entity.BId = 0;
|
|
||||||
// entity.ShopId = 0;
|
|
||||||
// entity.CId = 0;
|
|
||||||
// entity.SupportId = 0;
|
|
||||||
// entity.Title = "abc";
|
|
||||||
// entity.ItemNO = "abc";
|
|
||||||
// entity.SubTitle = "abc";
|
|
||||||
// entity.Unit = "abc";
|
|
||||||
// entity.Spec = "abc";
|
|
||||||
// entity.Color = "abc";
|
|
||||||
// entity.Weight = "abc";
|
|
||||||
// entity.Price = 0.0;
|
|
||||||
// entity.MarketPrice = 0.0;
|
|
||||||
// entity.SpecialPrice = 0.0;
|
|
||||||
// entity.Fare = 0.0;
|
|
||||||
// entity.Discount = 0.0;
|
|
||||||
// entity.Material = "abc";
|
|
||||||
// entity.Front = "abc";
|
|
||||||
// entity.Credits = 0;
|
|
||||||
// entity.Stock = 0;
|
|
||||||
// entity.WarnStock = 0;
|
|
||||||
// entity.IsSubProduct = 0;
|
|
||||||
// entity.PPId = 0;
|
|
||||||
// entity.Content = "abc";
|
|
||||||
// entity.Parameters = "abc";
|
|
||||||
// entity.Keyword = "abc";
|
|
||||||
// entity.Description = "abc";
|
|
||||||
// entity.LinkURL = "abc";
|
|
||||||
// entity.TitleColor = "abc";
|
|
||||||
// entity.TemplateFile = "abc";
|
|
||||||
// entity.IsRecommend = 0;
|
|
||||||
// entity.IsHide = 0;
|
|
||||||
// entity.IsLock = 0;
|
|
||||||
// entity.IsDel = 0;
|
|
||||||
// entity.IsTop = 0;
|
|
||||||
// entity.IsBest = 0;
|
|
||||||
// entity.IsComment = 0;
|
|
||||||
// entity.IsMember = 0;
|
|
||||||
// entity.IsNew = 0;
|
|
||||||
// entity.IsSpecial = 0;
|
|
||||||
// entity.IsPromote = 0;
|
|
||||||
// entity.IsHotSales = 0;
|
|
||||||
// entity.IsBreakup = 0;
|
|
||||||
// entity.IsShelves = 0;
|
|
||||||
// entity.IsVerify = 0;
|
|
||||||
// entity.Hits = 0;
|
|
||||||
// entity.IsGift = 0;
|
|
||||||
// entity.IsPart = 0;
|
|
||||||
// entity.Sequence = 0;
|
|
||||||
// entity.CommentCount = 0;
|
|
||||||
// entity.Icon = "abc";
|
|
||||||
// entity.ClassName = "abc";
|
|
||||||
// entity.BannerImg = "abc";
|
|
||||||
// entity.Pic = "abc";
|
|
||||||
// entity.AdsId = 0;
|
|
||||||
// entity.Tags = "abc";
|
|
||||||
// entity.ItemImg = "abc";
|
|
||||||
// entity.Service = "abc";
|
|
||||||
// entity.AuthorId = 0;
|
|
||||||
// entity.AddTime = DateTime.Now;
|
|
||||||
// entity.UpdateTime = DateTime.Now;
|
|
||||||
// entity.Location = "abc";
|
|
||||||
// entity.FilePath = "abc";
|
|
||||||
// entity.Insert();
|
|
||||||
|
|
||||||
// if (XTrace.Debug) XTrace.WriteLine("完成初始化Food[快餐]数据!");
|
|
||||||
//}
|
|
||||||
|
|
||||||
///// <summary>已重载。基类先调用Valid(true)验证数据,然后在事务保护内调用OnInsert</summary>
|
|
||||||
///// <returns></returns>
|
|
||||||
//public override Int32 Insert()
|
|
||||||
//{
|
|
||||||
// return base.Insert();
|
|
||||||
//}
|
|
||||||
|
|
||||||
///// <summary>已重载。在事务保护范围内处理业务,位于Valid之后</summary>
|
|
||||||
///// <returns></returns>
|
|
||||||
//protected override Int32 OnDelete()
|
|
||||||
//{
|
|
||||||
// return base.OnDelete();
|
|
||||||
//}
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region 扩展属性
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region 扩展查询
|
|
||||||
/// <summary>根据编号查找</summary>
|
|
||||||
/// <param name="id">编号</param>
|
|
||||||
/// <returns>实体对象</returns>
|
|
||||||
public static Food FindById(Int32 id)
|
|
||||||
{
|
|
||||||
if (id <= 0) return null;
|
|
||||||
|
|
||||||
// 实体缓存
|
|
||||||
if (Meta.Count < 1000) return Meta.Cache.Find(e => e.Id == id);
|
|
||||||
|
|
||||||
// 单对象缓存
|
|
||||||
//return Meta.SingleCache[id];
|
|
||||||
|
|
||||||
return Find(_.Id == id);
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region 高级查询
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region 业务操作
|
|
||||||
#endregion
|
|
||||||
}
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -4,6 +4,7 @@ using System.ComponentModel;
|
|||||||
using XCode;
|
using XCode;
|
||||||
using XCode.Configuration;
|
using XCode.Configuration;
|
||||||
using XCode.DataAccessLayer;
|
using XCode.DataAccessLayer;
|
||||||
|
using NewLife;
|
||||||
|
|
||||||
namespace COMCMS.Core
|
namespace COMCMS.Core
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ using System.ComponentModel;
|
|||||||
using XCode;
|
using XCode;
|
||||||
using XCode.Configuration;
|
using XCode.Configuration;
|
||||||
using XCode.DataAccessLayer;
|
using XCode.DataAccessLayer;
|
||||||
|
using NewLife;
|
||||||
|
|
||||||
namespace COMCMS.Core
|
namespace COMCMS.Core
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ using System.ComponentModel;
|
|||||||
using XCode;
|
using XCode;
|
||||||
using XCode.Configuration;
|
using XCode.Configuration;
|
||||||
using XCode.DataAccessLayer;
|
using XCode.DataAccessLayer;
|
||||||
|
using NewLife;
|
||||||
|
|
||||||
namespace COMCMS.Core
|
namespace COMCMS.Core
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ using System.ComponentModel;
|
|||||||
using XCode;
|
using XCode;
|
||||||
using XCode.Configuration;
|
using XCode.Configuration;
|
||||||
using XCode.DataAccessLayer;
|
using XCode.DataAccessLayer;
|
||||||
|
using NewLife;
|
||||||
|
|
||||||
namespace COMCMS.Core
|
namespace COMCMS.Core
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ using System.ComponentModel;
|
|||||||
using XCode;
|
using XCode;
|
||||||
using XCode.Configuration;
|
using XCode.Configuration;
|
||||||
using XCode.DataAccessLayer;
|
using XCode.DataAccessLayer;
|
||||||
|
using NewLife;
|
||||||
|
|
||||||
namespace COMCMS.Core
|
namespace COMCMS.Core
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,180 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.ComponentModel;
|
|
||||||
using System.IO;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Reflection;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Web;
|
|
||||||
using System.Xml.Serialization;
|
|
||||||
using NewLife;
|
|
||||||
using NewLife.Data;
|
|
||||||
using NewLife.Log;
|
|
||||||
using NewLife.Model;
|
|
||||||
using NewLife.Reflection;
|
|
||||||
using NewLife.Threading;
|
|
||||||
using NewLife.Web;
|
|
||||||
using XCode;
|
|
||||||
using XCode.Cache;
|
|
||||||
using XCode.Configuration;
|
|
||||||
using XCode.DataAccessLayer;
|
|
||||||
using XCode.Membership;
|
|
||||||
|
|
||||||
namespace COMCMS.Core
|
|
||||||
{
|
|
||||||
/// <summary>酒店房间</summary>
|
|
||||||
public partial class HotelRoom : Entity<HotelRoom>
|
|
||||||
{
|
|
||||||
#region 对象操作
|
|
||||||
static HotelRoom()
|
|
||||||
{
|
|
||||||
// 累加字段
|
|
||||||
//Meta.Factory.AdditionalFields.Add(__.Logins);
|
|
||||||
|
|
||||||
// 过滤器 UserModule、TimeModule、IPModule
|
|
||||||
Meta.Modules.Add<TimeModule>();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>验证数据,通过抛出异常的方式提示验证失败。</summary>
|
|
||||||
/// <param name="isNew">是否插入</param>
|
|
||||||
public override void Valid(Boolean isNew)
|
|
||||||
{
|
|
||||||
// 如果没有脏数据,则不需要进行任何处理
|
|
||||||
if (!HasDirty) return;
|
|
||||||
|
|
||||||
// 在新插入数据或者修改了指定字段时进行修正
|
|
||||||
// 货币保留6位小数
|
|
||||||
Price = Math.Round(Price, 6);
|
|
||||||
MarketPrice = Math.Round(MarketPrice, 6);
|
|
||||||
SpecialPrice = Math.Round(SpecialPrice, 6);
|
|
||||||
Fare = Math.Round(Fare, 6);
|
|
||||||
Discount = Math.Round(Discount, 6);
|
|
||||||
//if (!Dirtys[nameof(UpdateTime)]) nameof(UpdateTime) = DateTime.Now;
|
|
||||||
}
|
|
||||||
|
|
||||||
///// <summary>首次连接数据库时初始化数据,仅用于实体类重载,用户不应该调用该方法</summary>
|
|
||||||
//[EditorBrowsable(EditorBrowsableState.Never)]
|
|
||||||
//protected override void InitData()
|
|
||||||
//{
|
|
||||||
// // InitData一般用于当数据表没有数据时添加一些默认数据,该实体类的任何第一次数据库操作都会触发该方法,默认异步调用
|
|
||||||
// if (Meta.Count > 0) return;
|
|
||||||
|
|
||||||
// if (XTrace.Debug) XTrace.WriteLine("开始初始化HotelRoom[酒店房间]数据……");
|
|
||||||
|
|
||||||
// var entity = new HotelRoom();
|
|
||||||
// entity.Id = 0;
|
|
||||||
// entity.KId = 0;
|
|
||||||
// entity.BId = 0;
|
|
||||||
// entity.ShopId = 0;
|
|
||||||
// entity.CId = 0;
|
|
||||||
// entity.SupportId = 0;
|
|
||||||
// entity.Title = "abc";
|
|
||||||
// entity.ItemNO = "abc";
|
|
||||||
// entity.SubTitle = "abc";
|
|
||||||
// entity.Unit = "abc";
|
|
||||||
// entity.Spec = "abc";
|
|
||||||
// entity.Color = "abc";
|
|
||||||
// entity.Weight = "abc";
|
|
||||||
// entity.Price = 0.0;
|
|
||||||
// entity.MarketPrice = 0.0;
|
|
||||||
// entity.SpecialPrice = 0.0;
|
|
||||||
// entity.Fare = 0.0;
|
|
||||||
// entity.Discount = 0.0;
|
|
||||||
// entity.Material = "abc";
|
|
||||||
// entity.Front = "abc";
|
|
||||||
// entity.Credits = 0;
|
|
||||||
// entity.Stock = 0;
|
|
||||||
// entity.WarnStock = 0;
|
|
||||||
// entity.IsSubProduct = 0;
|
|
||||||
// entity.PPId = 0;
|
|
||||||
// entity.Content = "abc";
|
|
||||||
// entity.Parameters = "abc";
|
|
||||||
// entity.Keyword = "abc";
|
|
||||||
// entity.Description = "abc";
|
|
||||||
// entity.LinkURL = "abc";
|
|
||||||
// entity.TitleColor = "abc";
|
|
||||||
// entity.TemplateFile = "abc";
|
|
||||||
// entity.IsRecommend = 0;
|
|
||||||
// entity.IsHide = 0;
|
|
||||||
// entity.IsLock = 0;
|
|
||||||
// entity.IsDel = 0;
|
|
||||||
// entity.IsTop = 0;
|
|
||||||
// entity.IsBest = 0;
|
|
||||||
// entity.IsComment = 0;
|
|
||||||
// entity.IsMember = 0;
|
|
||||||
// entity.IsNew = 0;
|
|
||||||
// entity.IsSpecial = 0;
|
|
||||||
// entity.IsPromote = 0;
|
|
||||||
// entity.IsHotSales = 0;
|
|
||||||
// entity.IsBreakup = 0;
|
|
||||||
// entity.IsShelves = 0;
|
|
||||||
// entity.IsVerify = 0;
|
|
||||||
// entity.Hits = 0;
|
|
||||||
// entity.IsGift = 0;
|
|
||||||
// entity.IsPart = 0;
|
|
||||||
// entity.Sequence = 0;
|
|
||||||
// entity.CommentCount = 0;
|
|
||||||
// entity.Icon = "abc";
|
|
||||||
// entity.ClassName = "abc";
|
|
||||||
// entity.BannerImg = "abc";
|
|
||||||
// entity.Pic = "abc";
|
|
||||||
// entity.AdsId = 0;
|
|
||||||
// entity.Tags = "abc";
|
|
||||||
// entity.ItemImg = "abc";
|
|
||||||
// entity.Service = "abc";
|
|
||||||
// entity.AuthorId = 0;
|
|
||||||
// entity.AddTime = DateTime.Now;
|
|
||||||
// entity.UpdateTime = DateTime.Now;
|
|
||||||
// entity.Location = "abc";
|
|
||||||
// entity.FilePath = "abc";
|
|
||||||
// entity.PriceList = "abc";
|
|
||||||
// entity.Insert();
|
|
||||||
|
|
||||||
// if (XTrace.Debug) XTrace.WriteLine("完成初始化HotelRoom[酒店房间]数据!");
|
|
||||||
//}
|
|
||||||
|
|
||||||
///// <summary>已重载。基类先调用Valid(true)验证数据,然后在事务保护内调用OnInsert</summary>
|
|
||||||
///// <returns></returns>
|
|
||||||
//public override Int32 Insert()
|
|
||||||
//{
|
|
||||||
// return base.Insert();
|
|
||||||
//}
|
|
||||||
|
|
||||||
///// <summary>已重载。在事务保护范围内处理业务,位于Valid之后</summary>
|
|
||||||
///// <returns></returns>
|
|
||||||
//protected override Int32 OnDelete()
|
|
||||||
//{
|
|
||||||
// return base.OnDelete();
|
|
||||||
//}
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region 扩展属性
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region 扩展查询
|
|
||||||
/// <summary>根据编号查找</summary>
|
|
||||||
/// <param name="id">编号</param>
|
|
||||||
/// <returns>实体对象</returns>
|
|
||||||
public static HotelRoom FindById(Int32 id)
|
|
||||||
{
|
|
||||||
if (id <= 0) return null;
|
|
||||||
|
|
||||||
// 实体缓存
|
|
||||||
if (Meta.Count < 1000) return Meta.Cache.Find(e => e.Id == id);
|
|
||||||
|
|
||||||
// 单对象缓存
|
|
||||||
//return Meta.SingleCache[id];
|
|
||||||
|
|
||||||
return Find(_.Id == id);
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region 高级查询
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region 业务操作
|
|
||||||
#endregion
|
|
||||||
}
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -4,6 +4,7 @@ using System.ComponentModel;
|
|||||||
using XCode;
|
using XCode;
|
||||||
using XCode.Configuration;
|
using XCode.Configuration;
|
||||||
using XCode.DataAccessLayer;
|
using XCode.DataAccessLayer;
|
||||||
|
using NewLife;
|
||||||
|
|
||||||
namespace COMCMS.Core
|
namespace COMCMS.Core
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ using System.ComponentModel;
|
|||||||
using XCode;
|
using XCode;
|
||||||
using XCode.Configuration;
|
using XCode.Configuration;
|
||||||
using XCode.DataAccessLayer;
|
using XCode.DataAccessLayer;
|
||||||
|
using NewLife;
|
||||||
|
|
||||||
namespace COMCMS.Core
|
namespace COMCMS.Core
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ using System.ComponentModel;
|
|||||||
using XCode;
|
using XCode;
|
||||||
using XCode.Configuration;
|
using XCode.Configuration;
|
||||||
using XCode.DataAccessLayer;
|
using XCode.DataAccessLayer;
|
||||||
|
using NewLife;
|
||||||
|
|
||||||
namespace COMCMS.Core
|
namespace COMCMS.Core
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers
|
|||||||
foreach (var asmItem in asms)
|
foreach (var asmItem in asms)
|
||||||
{
|
{
|
||||||
string fullName = asmItem.GetName().ToString();
|
string fullName = asmItem.GetName().ToString();
|
||||||
if (fullName.IndexOf("COMCMS.Web.Views") > -1)
|
if (fullName.IndexOf("COMCMS.Web") > -1)
|
||||||
{
|
{
|
||||||
var types = asmItem.GetTypes().Where(e => e.Name.StartsWith("Views_Article")).ToList();
|
var types = asmItem.GetTypes().Where(e => e.Name.StartsWith("Views_Article")).ToList();
|
||||||
if (types.Count == 0) continue;
|
if (types.Count == 0) continue;
|
||||||
@@ -174,7 +174,7 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers
|
|||||||
foreach (var asmItem in asms)
|
foreach (var asmItem in asms)
|
||||||
{
|
{
|
||||||
string fullName = asmItem.GetName().ToString();
|
string fullName = asmItem.GetName().ToString();
|
||||||
if (fullName.IndexOf("COMCMS.Web.Views") > -1)
|
if (fullName.IndexOf("COMCMS.Web") > -1)
|
||||||
{
|
{
|
||||||
var types = asmItem.GetTypes().Where(e => e.Name.StartsWith("Views_Article")).ToList();
|
var types = asmItem.GetTypes().Where(e => e.Name.StartsWith("Views_Article")).ToList();
|
||||||
if (types.Count == 0) continue;
|
if (types.Count == 0) continue;
|
||||||
@@ -251,7 +251,7 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers
|
|||||||
entity.Location = ArticleCategory.GetNewLocation(model.PId);
|
entity.Location = ArticleCategory.GetNewLocation(model.PId);
|
||||||
entity.Level = ArticleCategory.GetNewLevel(model.PId);
|
entity.Level = ArticleCategory.GetNewLevel(model.PId);
|
||||||
//修改文章的location
|
//修改文章的location
|
||||||
IList<Article> alist = Article.FindAll(Article._.KId == model.Id, null, null, 0, 0);
|
IList<Article> alist = Article.FindAll(Article._.KId == model.Id, Article._.Id.Desc(), null, 0, 0);
|
||||||
if (alist != null && alist.Count > 0)
|
if (alist != null && alist.Count > 0)
|
||||||
{
|
{
|
||||||
foreach (var a in alist)
|
foreach (var a in alist)
|
||||||
@@ -347,7 +347,7 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers
|
|||||||
//修改所有文章的路径
|
//修改所有文章的路径
|
||||||
if (idNeedUpdateAllArticleFilePath)
|
if (idNeedUpdateAllArticleFilePath)
|
||||||
{
|
{
|
||||||
IList<Article> listArticles = Article.FindAll(Article._.KId == entity.Id, null, null, 0, 0);
|
IList<Article> listArticles = Article.FindAll(Article._.KId == entity.Id, Article._.Id.Desc(), null, 0, 0);
|
||||||
if(listArticles !=null && listArticles.Count > 0)
|
if(listArticles !=null && listArticles.Count > 0)
|
||||||
{
|
{
|
||||||
foreach (var item in listArticles)
|
foreach (var item in listArticles)
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers
|
|||||||
public IndexController(IWebHostEnvironment env)
|
public IndexController(IWebHostEnvironment env)
|
||||||
{
|
{
|
||||||
_env = env;
|
_env = env;
|
||||||
|
MachineInfo.RegisterAsync();
|
||||||
}
|
}
|
||||||
#region 后台首页
|
#region 后台首页
|
||||||
[AllowAnonymous]
|
[AllowAnonymous]
|
||||||
@@ -55,7 +56,7 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers
|
|||||||
#region 后台主界面
|
#region 后台主界面
|
||||||
public IActionResult Main()
|
public IActionResult Main()
|
||||||
{
|
{
|
||||||
string remoteip = Request.HttpContext.Connection.RemoteIpAddress.ToString();
|
string remoteip = Utils.GetIP();
|
||||||
string host = Request.HttpContext.Request.Host.Host;
|
string host = Request.HttpContext.Request.Host.Host;
|
||||||
string port = Request.HttpContext.Connection.RemotePort.ToString();
|
string port = Request.HttpContext.Connection.RemotePort.ToString();
|
||||||
|
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers
|
|||||||
{
|
{
|
||||||
string strUserName = Request.Form["username"];
|
string strUserName = Request.Form["username"];
|
||||||
string strPassWord = Request.Form["password"];
|
string strPassWord = Request.Form["password"];
|
||||||
|
string code = Request.Form["code"];
|
||||||
|
|
||||||
if (strUserName.Length % 8 != 0)
|
if (strUserName.Length % 8 != 0)
|
||||||
{
|
{
|
||||||
@@ -69,6 +70,21 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers
|
|||||||
tip.Other = "reload";
|
tip.Other = "reload";
|
||||||
return Json(tip);
|
return Json(tip);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Utils.GetSetting("SystemSetting:AdminLoginWithCode") == "1")
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(code))
|
||||||
|
{
|
||||||
|
tip.Message = "请输入验证码!";
|
||||||
|
return Json(tip);
|
||||||
|
}
|
||||||
|
if (!VerifyCodeHelper.GetSingleObj().VerifyCodeIsOK(code))
|
||||||
|
{
|
||||||
|
tip.Message = "验证码错误!";
|
||||||
|
return Json(tip);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//解密
|
//解密
|
||||||
string username = "";
|
string username = "";
|
||||||
string password = "";
|
string password = "";
|
||||||
|
|||||||
@@ -502,7 +502,7 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers
|
|||||||
if (!string.IsNullOrWhiteSpace(keyword))
|
if (!string.IsNullOrWhiteSpace(keyword))
|
||||||
ex &= Core.Admin._.UserName.Contains(keyword);
|
ex &= Core.Admin._.UserName.Contains(keyword);
|
||||||
|
|
||||||
IList<Core.Admin> list = Core.Admin.FindAll(ex, null, null, startRowIndex, numPerPage);
|
IList<Core.Admin> list = Core.Admin.FindAll(ex, Admin._.Id.Desc(), null, startRowIndex, numPerPage);
|
||||||
totalCount = Core.Admin.FindCount(ex, null, null, startRowIndex, numPerPage);
|
totalCount = Core.Admin.FindCount(ex, null, null, startRowIndex, numPerPage);
|
||||||
return Content(JsonConvert.SerializeObject(new { total = totalCount, rows = list }), "text/plain");
|
return Content(JsonConvert.SerializeObject(new { total = totalCount, rows = list }), "text/plain");
|
||||||
}
|
}
|
||||||
@@ -948,7 +948,7 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
IList<Member> list = Member.FindAll(ex, null, null, startRowIndex, numPerPage);
|
IList<Member> list = Member.FindAll(ex, Member._.Id.Desc(), null, startRowIndex, numPerPage);
|
||||||
totalCount = Member.FindCount(ex, null, null, startRowIndex, numPerPage);
|
totalCount = Member.FindCount(ex, null, null, startRowIndex, numPerPage);
|
||||||
return Content(JsonConvert.SerializeObject(new { total = totalCount, rows = list }), "text/plain");
|
return Content(JsonConvert.SerializeObject(new { total = totalCount, rows = list }), "text/plain");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers
|
|||||||
if (!string.IsNullOrWhiteSpace(keyword))
|
if (!string.IsNullOrWhiteSpace(keyword))
|
||||||
ex &= (Order._.Title.Contains(keyword) | Order._.OrderNum.Contains(keyword) | Order._.RealName.Contains(keyword) | Order._.Address.Contains(keyword));
|
ex &= (Order._.Title.Contains(keyword) | Order._.OrderNum.Contains(keyword) | Order._.RealName.Contains(keyword) | Order._.Address.Contains(keyword));
|
||||||
|
|
||||||
IList<Order> list = Order.FindAll(ex, null, null, startRowIndex, numPerPage);
|
IList<Order> list = Order.FindAll(ex, Order._.Id.Desc(), null, startRowIndex, numPerPage);
|
||||||
long totalCount = Order.FindCount(ex, null, null, startRowIndex, numPerPage);
|
long totalCount = Order.FindCount(ex, null, null, startRowIndex, numPerPage);
|
||||||
return Content(Newtonsoft.Json.JsonConvert.SerializeObject(new { total = totalCount, rows = list }), "text/plain");
|
return Content(Newtonsoft.Json.JsonConvert.SerializeObject(new { total = totalCount, rows = list }), "text/plain");
|
||||||
//return Json(new { total = totalCount, rows = list }, JsonRequestBehavior.AllowGet);
|
//return Json(new { total = totalCount, rows = list }, JsonRequestBehavior.AllowGet);
|
||||||
@@ -327,7 +327,7 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers
|
|||||||
if (!string.IsNullOrWhiteSpace(keyword))
|
if (!string.IsNullOrWhiteSpace(keyword))
|
||||||
ex &= OnlinePayOrder._.Title.Contains(keyword);
|
ex &= OnlinePayOrder._.Title.Contains(keyword);
|
||||||
|
|
||||||
IList<OnlinePayOrder> list = OnlinePayOrder.FindAll(ex, null, null, startRowIndex, numPerPage);
|
IList<OnlinePayOrder> list = OnlinePayOrder.FindAll(ex, OnlinePayOrder._.Id.Desc(), null, startRowIndex, numPerPage);
|
||||||
long totalCount = OnlinePayOrder.FindCount(ex, null, null, startRowIndex, numPerPage);
|
long totalCount = OnlinePayOrder.FindCount(ex, null, null, startRowIndex, numPerPage);
|
||||||
return Content(Newtonsoft.Json.JsonConvert.SerializeObject(new { total = totalCount, rows = list }), "text/plain");
|
return Content(Newtonsoft.Json.JsonConvert.SerializeObject(new { total = totalCount, rows = list }), "text/plain");
|
||||||
//return Json(new { total = totalCount, rows = list }, JsonRequestBehavior.AllowGet);
|
//return Json(new { total = totalCount, rows = list }, JsonRequestBehavior.AllowGet);
|
||||||
|
|||||||
@@ -115,6 +115,85 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers
|
|||||||
|
|
||||||
return Json(tip);
|
return Json(tip);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#region 编辑事件详情
|
||||||
|
[HttpGet]
|
||||||
|
[MyAuthorize("add", "eventkey")]
|
||||||
|
public IActionResult EditEventKey(int id)
|
||||||
|
{
|
||||||
|
TargetEvent entity = TargetEvent.Find(TargetEvent._.Id == id);
|
||||||
|
if (entity == null)
|
||||||
|
{
|
||||||
|
return EchoTipPage("系统找不到本记录!");
|
||||||
|
}
|
||||||
|
Admin.WriteLogActions("查看/编辑事件详情(id:" + entity.Id + ");");
|
||||||
|
return View(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpPost]
|
||||||
|
[MyAuthorize("add", "eventkey","JSON")]
|
||||||
|
public IActionResult EditEventKey(TargetEvent model)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrWhiteSpace(model.EventKey))
|
||||||
|
{
|
||||||
|
tip.Message = "请填写事件KEY";
|
||||||
|
return Json(tip);
|
||||||
|
}
|
||||||
|
if (string.IsNullOrWhiteSpace(model.EventName))
|
||||||
|
{
|
||||||
|
tip.Message = "请填写事件名称";
|
||||||
|
return Json(tip);
|
||||||
|
}
|
||||||
|
TargetEvent entity = TargetEvent.Find(TargetEvent._.Id == model.Id);
|
||||||
|
if (entity == null)
|
||||||
|
{
|
||||||
|
tip.Message = "系统找不到本记录!";
|
||||||
|
return Json(tip);
|
||||||
|
}
|
||||||
|
if (entity.EventKey != model.EventKey)
|
||||||
|
{
|
||||||
|
if (TargetEvent.FindCount(TargetEvent._.EventKey == model.EventKey, null, null, 0, 0) > 0)
|
||||||
|
{
|
||||||
|
tip.Message = "事件key已经存在,请重新填写一个";
|
||||||
|
return Json(tip);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
entity.EventKey = model.EventKey;
|
||||||
|
entity.EventName = model.EventName;
|
||||||
|
entity.Rank = model.Rank;
|
||||||
|
if (string.IsNullOrWhiteSpace(Request.Form["IsDisable"]) || Request.Form["IsDisable"] != "1")
|
||||||
|
entity.IsDisable = 0;
|
||||||
|
else
|
||||||
|
entity.IsDisable = 1;
|
||||||
|
entity.Update();
|
||||||
|
Admin.WriteLogActions("编辑事件详情(id:" + entity.Id + ");");
|
||||||
|
tip.Status = JsonTip.SUCCESS;
|
||||||
|
tip.Message = "编辑事件权限详情成功";
|
||||||
|
tip.ReturnUrl = "close";
|
||||||
|
return Json(tip);
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 删除事件权限
|
||||||
|
[HttpPost]
|
||||||
|
[MyAuthorize("del", "eventkey", "JSON")]
|
||||||
|
public JsonResult DelEventKey(int id)
|
||||||
|
{
|
||||||
|
TargetEvent entity = TargetEvent.Find(TargetEvent._.Id == id);
|
||||||
|
if (entity == null)
|
||||||
|
{
|
||||||
|
tip.Message = "系统找不到本记录!";
|
||||||
|
return Json(tip);
|
||||||
|
}
|
||||||
|
Admin.WriteLogActions("删除事件详情(" + JsonConvert.SerializeObject(entity) + ");");
|
||||||
|
entity.Delete();
|
||||||
|
tip.Status = JsonTip.SUCCESS;
|
||||||
|
tip.Message = "删除事件权限详情成功";
|
||||||
|
return Json(tip);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 后台栏目管理
|
#region 后台栏目管理
|
||||||
@@ -339,6 +418,27 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers
|
|||||||
tip.Message = "删除后台菜单成功";
|
tip.Message = "删除后台菜单成功";
|
||||||
return Json(tip);
|
return Json(tip);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//修改栏目是否隐藏
|
||||||
|
[HttpPost]
|
||||||
|
[MyAuthorize("edit", "adminmenu", "JSON")]
|
||||||
|
public IActionResult DoChangeAdminMenuHide(int id)
|
||||||
|
{
|
||||||
|
AdminMenu entity = AdminMenu.Find(AdminMenu._.Id == id);
|
||||||
|
if (entity == null)
|
||||||
|
{
|
||||||
|
tip.Message = "系统找不到本记录!";
|
||||||
|
return Json(tip);
|
||||||
|
}
|
||||||
|
if (entity.IsHide == 1)
|
||||||
|
entity.IsHide = 0;
|
||||||
|
else
|
||||||
|
entity.IsHide = 1;
|
||||||
|
entity.Update();
|
||||||
|
tip.Status = JsonTip.SUCCESS;
|
||||||
|
tip.Message = "修改菜单隐藏状态成功";
|
||||||
|
return Json(tip);
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 系统运行日志
|
#region 系统运行日志
|
||||||
|
|||||||
@@ -36,6 +36,24 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers
|
|||||||
//获取上级栏目
|
//获取上级栏目
|
||||||
IList<Category> list = Category.GetListTree(0, -1, true, false);
|
IList<Category> list = Category.GetListTree(0, -1, true, false);
|
||||||
ViewBag.ListTree = list;
|
ViewBag.ListTree = list;
|
||||||
|
//获取模板 模板规则,以Index_开头的,为栏目列表,以Detial_开头的为文章详情
|
||||||
|
List<string> listTpls = new List<string>();
|
||||||
|
var asms = AppDomain.CurrentDomain.GetAssemblies();
|
||||||
|
foreach (var asmItem in asms)
|
||||||
|
{
|
||||||
|
string fullName = asmItem.GetName().ToString();
|
||||||
|
if (fullName.IndexOf("COMCMS.Web") > -1)
|
||||||
|
{
|
||||||
|
var types = asmItem.GetTypes().Where(e => e.Name.StartsWith("Views_Product")).ToList();
|
||||||
|
if (types.Count == 0) continue;
|
||||||
|
foreach (var type in types)
|
||||||
|
{
|
||||||
|
string viewName = type.Name.Replace("Views_Product_", "") + ".cshtml";
|
||||||
|
listTpls.Add(viewName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ViewBag.ListTpl = listTpls;
|
||||||
//获取模板
|
//获取模板
|
||||||
//List<string> listtpl = COMCMS.Common.IOHelper.GetDirFiles(new DirectoryInfo(Server.MapPath("~/Views/article")));
|
//List<string> listtpl = COMCMS.Common.IOHelper.GetDirFiles(new DirectoryInfo(Server.MapPath("~/Views/article")));
|
||||||
//ViewBag.ListTpl = listtpl;
|
//ViewBag.ListTpl = listtpl;
|
||||||
@@ -53,6 +71,33 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers
|
|||||||
tip.Message = "商品栏目标题不能为空!";
|
tip.Message = "商品栏目标题不能为空!";
|
||||||
return Json(tip);
|
return Json(tip);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(model.FilePath))
|
||||||
|
{
|
||||||
|
if (!model.FilePath.StartsWith("/"))
|
||||||
|
{
|
||||||
|
tip.Message = "栏目路径请以/开头!";
|
||||||
|
return Json(tip);
|
||||||
|
}
|
||||||
|
if (model.FilePath.EndsWith("/"))
|
||||||
|
{
|
||||||
|
tip.Message = "栏目路径结尾不用加上/";
|
||||||
|
return Json(tip);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (model.FilePath.Count(x => x == '/') > 4)
|
||||||
|
{
|
||||||
|
tip.Message = "最多只能四级路径!";
|
||||||
|
return Json(tip);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(model.FilePath) && !AdminUtils.CheckFilePathIsOK(model.FilePath, 0, 1))
|
||||||
|
{
|
||||||
|
tip.Message = "栏目路径不可用,请重新填写!";
|
||||||
|
return Json(tip);
|
||||||
|
}
|
||||||
|
|
||||||
model.Insert();
|
model.Insert();
|
||||||
Core.Admin.WriteLogActions("添加商品栏目(id:" + model.Id + ");");
|
Core.Admin.WriteLogActions("添加商品栏目(id:" + model.Id + ");");
|
||||||
tip.Status = JsonTip.SUCCESS;
|
tip.Status = JsonTip.SUCCESS;
|
||||||
@@ -74,9 +119,25 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers
|
|||||||
//获取上级栏目
|
//获取上级栏目
|
||||||
IList<Category> list = Category.GetListTree(0, -1, true, false);
|
IList<Category> list = Category.GetListTree(0, -1, true, false);
|
||||||
ViewBag.ListTree = list;
|
ViewBag.ListTree = list;
|
||||||
//获取模板
|
//获取模板 模板规则,以Index_开头的,为栏目列表,以Detial_开头的为文章详情
|
||||||
//List<string> listtpl = COMCMS.Common.IOHelper.GetDirFiles(new DirectoryInfo(Server.MapPath("~/Views/article")));
|
List<string> listTpls = new List<string>();
|
||||||
//ViewBag.ListTpl = listtpl;
|
var asms = AppDomain.CurrentDomain.GetAssemblies();
|
||||||
|
foreach (var asmItem in asms)
|
||||||
|
{
|
||||||
|
string fullName = asmItem.GetName().ToString();
|
||||||
|
if (fullName.IndexOf("COMCMS.Web") > -1)
|
||||||
|
{
|
||||||
|
var types = asmItem.GetTypes().Where(e => e.Name.StartsWith("Views_Product")).ToList();
|
||||||
|
if (types.Count == 0) continue;
|
||||||
|
foreach (var type in types)
|
||||||
|
{
|
||||||
|
string viewName = type.Name.Replace("Views_Product_", "") + ".cshtml";
|
||||||
|
listTpls.Add(viewName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ViewBag.ListTpl = listTpls;
|
||||||
|
|
||||||
Core.Admin.WriteLogActions("查看/编辑商品栏目(id:" + id + ")页面;");
|
Core.Admin.WriteLogActions("查看/编辑商品栏目(id:" + id + ")页面;");
|
||||||
return View(entity);
|
return View(entity);
|
||||||
}
|
}
|
||||||
@@ -102,6 +163,30 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers
|
|||||||
tip.Message = "系统找不到本记录!";
|
tip.Message = "系统找不到本记录!";
|
||||||
Json(tip);
|
Json(tip);
|
||||||
}
|
}
|
||||||
|
if (!string.IsNullOrEmpty(model.FilePath))
|
||||||
|
{
|
||||||
|
if (!model.FilePath.StartsWith("/"))
|
||||||
|
{
|
||||||
|
tip.Message = "栏目路径请以/开头!";
|
||||||
|
return Json(tip);
|
||||||
|
}
|
||||||
|
if (model.FilePath.EndsWith("/"))
|
||||||
|
{
|
||||||
|
tip.Message = "栏目路径结尾不用加上/";
|
||||||
|
return Json(tip);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (model.FilePath.Count(x => x == '/') > 4)
|
||||||
|
{
|
||||||
|
tip.Message = "最多只能四级路径!";
|
||||||
|
return Json(tip);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!string.IsNullOrEmpty(model.FilePath) && !AdminUtils.CheckFilePathIsOK(model.FilePath, entity.Id, 1))
|
||||||
|
{
|
||||||
|
tip.Message = "栏目路径不可用,请重新填写!";
|
||||||
|
return Json(tip);
|
||||||
|
}
|
||||||
|
|
||||||
if (entity.PId != model.PId)
|
if (entity.PId != model.PId)
|
||||||
{
|
{
|
||||||
@@ -147,6 +232,7 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers
|
|||||||
entity.KindDomain = model.KindDomain;
|
entity.KindDomain = model.KindDomain;
|
||||||
entity.Rank = model.Rank;
|
entity.Rank = model.Rank;
|
||||||
entity.Pic = model.Pic;
|
entity.Pic = model.Pic;
|
||||||
|
entity.FilePath = model.FilePath;
|
||||||
|
|
||||||
|
|
||||||
entity.Save();
|
entity.Save();
|
||||||
|
|||||||
@@ -28,6 +28,14 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers
|
|||||||
pinyin = pcategory.FilePath+"/";
|
pinyin = pcategory.FilePath+"/";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if(t == "category" && pid > 0)
|
||||||
|
{
|
||||||
|
Category pcategory = Category.FindById(pid);
|
||||||
|
if (pcategory != null && !string.IsNullOrEmpty(pcategory.FilePath))
|
||||||
|
{
|
||||||
|
pinyin = pcategory.FilePath + "/";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(name))
|
if (!string.IsNullOrEmpty(name))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -221,9 +221,17 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers
|
|||||||
string file = Path.Combine(_env.WebRootPath, "robots.txt");
|
string file = Path.Combine(_env.WebRootPath, "robots.txt");
|
||||||
string content = "";
|
string content = "";
|
||||||
if (System.IO.File.Exists(file))
|
if (System.IO.File.Exists(file))
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
content = System.IO.File.ReadAllText(file);
|
content = System.IO.File.ReadAllText(file);
|
||||||
}
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
NewLife.Log.XTrace.WriteException(ex);
|
||||||
|
// 如果读取文件失败,继续使用空内容
|
||||||
|
}
|
||||||
|
}
|
||||||
ViewBag.content = content;
|
ViewBag.content = content;
|
||||||
Admin.WriteLogActions("查看Robots.txt;");
|
Admin.WriteLogActions("查看Robots.txt;");
|
||||||
return View();
|
return View();
|
||||||
@@ -233,15 +241,18 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers
|
|||||||
public IActionResult Robots(string content)
|
public IActionResult Robots(string content)
|
||||||
{
|
{
|
||||||
string file = Path.Combine(_env.WebRootPath, "robots.txt");
|
string file = Path.Combine(_env.WebRootPath, "robots.txt");
|
||||||
if (System.IO.File.Exists(file))
|
try
|
||||||
{
|
{
|
||||||
//写入覆盖
|
//写入覆盖
|
||||||
System.IO.File.WriteAllText(file, content);
|
System.IO.File.WriteAllText(file, content);
|
||||||
}
|
}
|
||||||
else
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
System.IO.File.WriteAllText(file, content);
|
NewLife.Log.XTrace.WriteException(ex);
|
||||||
|
tip.Message = "修改Robots.txt失败:" + ex.Message;
|
||||||
|
return Json(tip);
|
||||||
}
|
}
|
||||||
|
|
||||||
tip.Status = JsonTip.SUCCESS;
|
tip.Status = JsonTip.SUCCESS;
|
||||||
tip.Message = "修改Robots.txt成功";
|
tip.Message = "修改Robots.txt成功";
|
||||||
Admin.WriteLogActions("修改Robots.txt成功;");
|
Admin.WriteLogActions("修改Robots.txt成功;");
|
||||||
|
|||||||
@@ -326,7 +326,7 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
IList<WeixinRequestRule> list = WeixinRequestRule.FindAll(ex, null, null, startRowIndex, numPerPage);
|
IList<WeixinRequestRule> list = WeixinRequestRule.FindAll(ex, WeixinRequestRule._.Id.Desc(), null, startRowIndex, numPerPage);
|
||||||
long totalCount = WeixinRequestRule.FindCount(ex, null, null, startRowIndex, numPerPage);
|
long totalCount = WeixinRequestRule.FindCount(ex, null, null, startRowIndex, numPerPage);
|
||||||
Admin.WriteLogActions($"查看公众号自定义回复规则({page});");
|
Admin.WriteLogActions($"查看公众号自定义回复规则({page});");
|
||||||
return Content(JsonConvert.SerializeObject(new { total = totalCount, rows = list }), "text/plain");
|
return Content(JsonConvert.SerializeObject(new { total = totalCount, rows = list }), "text/plain");
|
||||||
@@ -670,7 +670,7 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers
|
|||||||
ex &= WeixinRequestRule._.Keywords.Contains(keyword);
|
ex &= WeixinRequestRule._.Keywords.Contains(keyword);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
IList<WeixinRequestRule> list = WeixinRequestRule.FindAll(ex, null, null, startRowIndex, numPerPage);
|
IList<WeixinRequestRule> list = WeixinRequestRule.FindAll(ex, WeixinRequestRule._.Id.Desc(), null, startRowIndex, numPerPage);
|
||||||
long totalCount = WeixinRequestRule.FindCount(ex, null, null, startRowIndex, numPerPage);
|
long totalCount = WeixinRequestRule.FindCount(ex, null, null, startRowIndex, numPerPage);
|
||||||
Admin.WriteLogActions($"查看公众号点击事件自定义回复规则({page});");
|
Admin.WriteLogActions($"查看公众号点击事件自定义回复规则({page});");
|
||||||
return Content(JsonConvert.SerializeObject(new { total = totalCount, rows = list }), "text/plain");
|
return Content(JsonConvert.SerializeObject(new { total = totalCount, rows = list }), "text/plain");
|
||||||
|
|||||||
@@ -5,9 +5,6 @@
|
|||||||
|
|
||||||
<div class="wrapper wrapper-content">
|
<div class="wrapper wrapper-content">
|
||||||
<div class="ibox float-e-margins">
|
<div class="ibox float-e-margins">
|
||||||
<div class="ibox-title">
|
|
||||||
<h5>@ViewBag.Title</h5>
|
|
||||||
</div>
|
|
||||||
<div class="ibox-content">
|
<div class="ibox-content">
|
||||||
<div id="toolbar" class="btn-group">
|
<div id="toolbar" class="btn-group">
|
||||||
<button id="btn_add" type="button" class="btn btn-outline btn-default" onclick="showDialog('addarticlekind','添加文章栏目','/AdminCP/Article/AddArticleCategory',0,0);">
|
<button id="btn_add" type="button" class="btn btn-outline btn-default" onclick="showDialog('addarticlekind','添加文章栏目','/AdminCP/Article/AddArticleCategory',0,0);">
|
||||||
@@ -38,12 +35,12 @@
|
|||||||
@foreach (var m in Model)
|
@foreach (var m in Model)
|
||||||
{
|
{
|
||||||
<tr class="treegrid-@m.Id @(m.PId !=0?"treegrid-parent-"+m.PId:"") ">
|
<tr class="treegrid-@m.Id @(m.PId !=0?"treegrid-parent-"+m.PId:"") ">
|
||||||
<td>@m.KindName</td>
|
<td><a href="@ViewsHelper.EchoURL(m)" target="_blank" title="新窗口打开栏目">@m.KindName</a></td>
|
||||||
<td>
|
<td>
|
||||||
@m.Id
|
@m.Id
|
||||||
</td>
|
</td>
|
||||||
<td class="text-center">
|
<td class="text-center">
|
||||||
<div class="input-group"><input type="number" class="form-control" id="ac_rank_@(m.Id)" name="ac_rank_@(m.Id)" value="@m.Rank" placeholder="请输入一个数字,越小排越前"><a class="input-group-addon btn btn-primary" title="修改保存" href="javascript:;" onclick="doSaveRank(@(m.Id))"><i class="fa fa-save"></i></a></div>
|
<div class="input-group"><input type="number" class="form-control input-sm" id="ac_rank_@(m.Id)" name="ac_rank_@(m.Id)" value="@m.Rank" placeholder="请输入一个数字,越小排越前"><a class="input-group-addon btn btn-primary" title="修改保存" href="javascript:;" onclick="doSaveRank(@(m.Id))"><i class="fa fa-save"></i></a></div>
|
||||||
</td>
|
</td>
|
||||||
<td class="text-center">@m.Counts</td>
|
<td class="text-center">@m.Counts</td>
|
||||||
<td class="text-center">
|
<td class="text-center">
|
||||||
|
|||||||
@@ -9,25 +9,17 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
<div class="wrapper wrapper-content ">
|
<div class="wrapper wrapper-content ">
|
||||||
<div class="ibox float-e-margins">
|
<div class="row">
|
||||||
<div class="ibox-title">
|
<div class="search-collapse">
|
||||||
<h5>@ViewBag.Title</h5>
|
<form id="formSearch" onsubmit="return doSearch(); return false;">
|
||||||
<div class="ibox-tools">
|
<div class="select-list">
|
||||||
</div>
|
<ul>
|
||||||
</div>
|
<li>
|
||||||
<div class="ibox-content">
|
文章栏目:<select name="kid" id="kid">
|
||||||
<div class="panel panel-default">
|
|
||||||
<div class="panel-heading">筛选条件</div>
|
|
||||||
<div class="panel-body">
|
|
||||||
<form id="formSearch" class="form-horizontal form-inline" onsubmit="return doSearch(); return false;">
|
|
||||||
<div>
|
|
||||||
<label class="control-label">文章栏目:</label>
|
|
||||||
|
|
||||||
<select class="form-control" name="kid" id="kid">
|
|
||||||
<option value="0">所有栏目</option>
|
<option value="0">所有栏目</option>
|
||||||
@foreach (var m in ViewBag.ListKinds)
|
@foreach (var m in ViewBag.ListKinds)
|
||||||
{
|
{
|
||||||
if (my.Roles.IsSuperAdmin != 1 && aclist.Count>0)
|
if (my.Roles.IsSuperAdmin != 1 && aclist.Count > 0)
|
||||||
{
|
{
|
||||||
if (aclist.FindIndex(x => x == m.Id) > -1)
|
if (aclist.FindIndex(x => x == m.Id) > -1)
|
||||||
{
|
{
|
||||||
@@ -40,16 +32,26 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
</select>
|
</select>
|
||||||
<label class="checkbox-inline i-checks">
|
</li>
|
||||||
|
<li>
|
||||||
|
<label class="checkbox-inline i-checks" for="isshowsub">
|
||||||
<input type="checkbox" value="1" name="isshowsub" id="isshowsub" /> 显示下级栏目文章
|
<input type="checkbox" value="1" name="isshowsub" id="isshowsub" /> 显示下级栏目文章
|
||||||
</label>
|
</label>
|
||||||
<label class="control-label">关键字:</label>
|
</li>
|
||||||
<input type="text" placeholder="标题关键字" name="keyword" id="keyword" class="form-control">
|
<li>
|
||||||
<button type="button" style="margin-left:50px" id="btn_query" class="btn btn-primary" onclick="doSearch();">查询</button>
|
关键字:
|
||||||
|
<input type="text" placeholder="标题关键字" name="keyword" id="keyword">
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<button type="button" id="btn_query" class="btn btn-primary btn-sm" onclick="doSearch();">查询</button>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="ibox float-e-margins">
|
||||||
|
<div class="ibox-content">
|
||||||
<div id="toolbar" class="btn-group">
|
<div id="toolbar" class="btn-group">
|
||||||
@if (AdminUtils.CheckAdminPower("add", "article"))
|
@if (AdminUtils.CheckAdminPower("add", "article"))
|
||||||
{
|
{
|
||||||
@@ -151,7 +153,7 @@
|
|||||||
title: '排序',
|
title: '排序',
|
||||||
width: 130,
|
width: 130,
|
||||||
formatter: function (value, row, index) {
|
formatter: function (value, row, index) {
|
||||||
return '<div class="input-group"><input type="number" class="form-control" id="ac_rank_' + row["id"] + '" name="ac_rank_' + row["id"] + '" value="' + value + '" placeholder="请输入一个数字,越小排越前"><a class="input-group-addon btn btn-primary" title="修改保存" href="javascript:;" onclick="doSaveSequence(' + row["id"] + ')"><i class="fa fa-save"></i></a></div>'
|
return '<div class="input-group"><input type="number" class="form-control input-sm" id="ac_rank_' + row["id"] + '" name="ac_rank_' + row["id"] + '" value="' + value + '" placeholder="请输入一个数字,越小排越前"><a class="input-group-addon btn btn-primary" title="修改保存" href="javascript:;" onclick="doSaveSequence(' + row["id"] + ')"><i class="fa fa-save"></i></a></div>'
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
field: 'addTime',
|
field: 'addTime',
|
||||||
|
|||||||
@@ -2,8 +2,9 @@
|
|||||||
ViewBag.title = "数据字典管理";
|
ViewBag.title = "数据字典管理";
|
||||||
}
|
}
|
||||||
<script src="~/js/vue/vue.min.js"></script>
|
<script src="~/js/vue/vue.min.js"></script>
|
||||||
<div class="wrapper wrapper-content ">
|
<div class="wrapper wrapper-content " id="app">
|
||||||
<div class="row" id="app">
|
|
||||||
|
<div class="row">
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<div class="ibox float-e-margins">
|
<div class="ibox float-e-margins">
|
||||||
<div class="ibox-title">
|
<div class="ibox-title">
|
||||||
|
|||||||
@@ -5,9 +5,6 @@
|
|||||||
|
|
||||||
<div class="wrapper wrapper-content">
|
<div class="wrapper wrapper-content">
|
||||||
<div class="ibox float-e-margins">
|
<div class="ibox float-e-margins">
|
||||||
<div class="ibox-title">
|
|
||||||
<h5>@ViewBag.Title</h5>
|
|
||||||
</div>
|
|
||||||
<div class="ibox-content">
|
<div class="ibox-content">
|
||||||
<div id="toolbar" class="btn-group">
|
<div id="toolbar" class="btn-group">
|
||||||
<button id="btn_add" type="button" class="btn btn-outline btn-default" onclick="showDialog('adddepartment','添加部门','/AdminCP/Department/AddDepartment',0,0);">
|
<button id="btn_add" type="button" class="btn btn-outline btn-default" onclick="showDialog('adddepartment','添加部门','/AdminCP/Department/AddDepartment',0,0);">
|
||||||
|
|||||||
@@ -5,9 +5,6 @@
|
|||||||
|
|
||||||
<div class="wrapper wrapper-content ">
|
<div class="wrapper wrapper-content ">
|
||||||
<div class="ibox float-e-margins">
|
<div class="ibox float-e-margins">
|
||||||
<div class="ibox-title">
|
|
||||||
<h5>@ViewBag.title</h5>
|
|
||||||
</div>
|
|
||||||
<div class="ibox-content">
|
<div class="ibox-content">
|
||||||
<div id="toolbar" class="btn-group">
|
<div id="toolbar" class="btn-group">
|
||||||
<button id="btn_add" type="button" class="btn btn-outline btn-default" onclick="showAddRow();">
|
<button id="btn_add" type="button" class="btn btn-outline btn-default" onclick="showAddRow();">
|
||||||
|
|||||||
@@ -3,36 +3,37 @@
|
|||||||
ViewBag.title = "留言管理";
|
ViewBag.title = "留言管理";
|
||||||
}
|
}
|
||||||
<div class="wrapper wrapper-content ">
|
<div class="wrapper wrapper-content ">
|
||||||
<div class="ibox float-e-margins">
|
<div class="row">
|
||||||
<div class="ibox-title">
|
<div class="search-collapse">
|
||||||
<h5>@ViewBag.title</h5>
|
<form id="formSearch" onsubmit="return doSearch(); return false;">
|
||||||
<div class="ibox-tools">
|
<div class="select-list">
|
||||||
</div>
|
<ul>
|
||||||
</div>
|
<li>
|
||||||
<div class="ibox-content">
|
留言分类:
|
||||||
<div class="panel panel-default">
|
<select name="kid" id="kid">
|
||||||
<div class="panel-heading">筛选条件</div>
|
|
||||||
<div class="panel-body">
|
|
||||||
<form id="formSearch" class="form-horizontal form-inline" onsubmit="doSearch(); return false; ">
|
|
||||||
<div>
|
|
||||||
<label class="control-label">留言分类:</label>
|
|
||||||
|
|
||||||
<select class="form-control" name="kid" id="kid">
|
|
||||||
<option value="0">所有分类</option>
|
<option value="0">所有分类</option>
|
||||||
@foreach (var m in ViewBag.ListKinds)
|
@foreach (var m in ViewBag.ListKinds)
|
||||||
{
|
{
|
||||||
<option value="@m.Id">@m.KindName</option>
|
<option value="@m.Id">@m.KindName</option>
|
||||||
}
|
}
|
||||||
</select>
|
</select>
|
||||||
<label class="control-label">关键字:</label>
|
</li>
|
||||||
<input type="text" placeholder="标题关键字" name="keyword" id="keyword" class="form-control">
|
<li>
|
||||||
<button type="button" style="margin-left:50px" id="btn_query" class="btn btn-primary" onclick="doSearch();">查询</button>
|
关键字:
|
||||||
|
<input type="text" placeholder="标题关键字" name="keyword" id="keyword">
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<button type="button" id="btn_query" class="btn btn-primary btn-sm" onclick="doSearch();">查询</button>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<table id="tb_departments"></table>
|
<div class="ibox float-e-margins">
|
||||||
|
|
||||||
|
<div class="ibox-content">
|
||||||
|
<table id="tb_departments"></table>
|
||||||
<script>
|
<script>
|
||||||
$(function () {
|
$(function () {
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
<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.css" rel="stylesheet" />
|
<link href="~/hplus/css/animate.css" rel="stylesheet" />
|
||||||
|
<link href="~/hplus/js/plugins/metisMenu/metisMenu.min.css" rel="stylesheet" />
|
||||||
<script>if (window.top !== window.self) { window.top.location = window.location; }</script>
|
<script>if (window.top !== window.self) { window.top.location = window.location; }</script>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
@@ -77,7 +78,7 @@
|
|||||||
{
|
{
|
||||||
var l2 = Model.FindAll(s => s.PId == m1.Id && s.IsHide != 1);
|
var l2 = Model.FindAll(s => s.PId == m1.Id && s.IsHide != 1);
|
||||||
<li>
|
<li>
|
||||||
<a href="/AdminCP/@(m1.Link)" id="@m1.MenuKey" @(m1.Link != "#" ? "class=J_menuItem" : "")>
|
<a href="@(m1.Link=="#"?"javascript:;":"/AdminCP/"+m1.Link)" id="@m1.MenuKey" @(m1.Link != "#" ? "class=J_menuItem" : "")>
|
||||||
@if (!string.IsNullOrWhiteSpace(m1.ClassName))
|
@if (!string.IsNullOrWhiteSpace(m1.ClassName))
|
||||||
{
|
{
|
||||||
<i class="fa @m1.ClassName"></i>
|
<i class="fa @m1.ClassName"></i>
|
||||||
|
|||||||
@@ -176,7 +176,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td class="text-center small">客户端IP地址</td>
|
<td class="text-center small">客户端IP地址</td>
|
||||||
<td>
|
<td>
|
||||||
@ViewBag.remoteip
|
@(Utils.GetIP())
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|||||||
@@ -35,6 +35,15 @@
|
|||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<input type="password" name="password" id="password" class="form-control" placeholder="密码" required="">
|
<input type="password" name="password" id="password" class="form-control" placeholder="密码" required="">
|
||||||
</div>
|
</div>
|
||||||
|
@if (Utils.GetSetting("SystemSetting:AdminLoginWithCode") == "1")
|
||||||
|
{
|
||||||
|
<div class="form-group input-group">
|
||||||
|
<input type="text" name="code" id="code" class="form-control" placeholder="验证码" required="">
|
||||||
|
<span class="input-group-addon" style="padding:0px;">
|
||||||
|
<img src="~/VerifyCode/MixVerifyCode" onclick="this.src='/VerifyCode/MixVerifyCode?'+Math.random()" style="cursor:pointer;" />
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
<button type="submit" class="btn btn-primary block full-width m-b">登 录</button>
|
<button type="submit" class="btn btn-primary block full-width m-b">登 录</button>
|
||||||
<p class="text-muted text-center">
|
<p class="text-muted text-center">
|
||||||
COMCMS © 2014-@DateTime.Now.Year
|
COMCMS © 2014-@DateTime.Now.Year
|
||||||
|
|||||||
@@ -3,30 +3,25 @@
|
|||||||
ViewBag.title = "后台管理日志";
|
ViewBag.title = "后台管理日志";
|
||||||
}
|
}
|
||||||
<div class="wrapper wrapper-content ">
|
<div class="wrapper wrapper-content ">
|
||||||
<div class="ibox float-e-margins">
|
<div class="row">
|
||||||
<div class="ibox-title">
|
<div class="search-collapse">
|
||||||
<h5>@ViewBag.title</h5>
|
<form id="formSearch" onsubmit="return doSearch(); return false;">
|
||||||
<div class="ibox-tools">
|
<div class="select-list">
|
||||||
</div>
|
<ul>
|
||||||
</div>
|
<li>
|
||||||
<div class="ibox-content">
|
关键字:
|
||||||
<div class="panel panel-default">
|
<input type="text" placeholder="标题关键字" name="keyword" id="keyword">
|
||||||
<div class="panel-heading">筛选条件</div>
|
</li>
|
||||||
<div class="panel-body">
|
<li>
|
||||||
<form id="formSearch" class="form-horizontal form-inline" onsubmit="doSearch(); return false; ">
|
<button type="button" id="btn_query" class="btn btn-primary btn-sm" onclick="doSearch();">查询</button>
|
||||||
<div>
|
</li>
|
||||||
@*<label class="control-label">留言分类:</label>
|
</ul>
|
||||||
|
|
||||||
<select class="form-control" name="kid" id="kid">
|
|
||||||
<option value="0">所有分类</option>
|
|
||||||
</select>*@
|
|
||||||
<label class="control-label">关键字:</label>
|
|
||||||
<input type="text" placeholder="标题关键字" name="keyword" id="keyword" class="form-control">
|
|
||||||
<button type="button" style="margin-left:50px" id="btn_query" class="btn btn-primary" onclick="doSearch();">查询</button>
|
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="ibox float-e-margins">
|
||||||
|
<div class="ibox-content">
|
||||||
<table id="tb_departments"></table>
|
<table id="tb_departments"></table>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|||||||
@@ -4,9 +4,6 @@
|
|||||||
}
|
}
|
||||||
<div class="wrapper wrapper-content">
|
<div class="wrapper wrapper-content">
|
||||||
<div class="ibox float-e-margins">
|
<div class="ibox float-e-margins">
|
||||||
<div class="ibox-title">
|
|
||||||
<h5>@ViewBag.title</h5>
|
|
||||||
</div>
|
|
||||||
<div class="ibox-content">
|
<div class="ibox-content">
|
||||||
<div id="toolbar" class="btn-group">
|
<div id="toolbar" class="btn-group">
|
||||||
<button id="btn_add" type="button" class="btn btn-outline btn-default" onclick="top.showDialog('addadminrole', '添加管理组', '/AdminCP/Member/AddAdminRole', 0, 0)">
|
<button id="btn_add" type="button" class="btn btn-outline btn-default" onclick="top.showDialog('addadminrole', '添加管理组', '/AdminCP/Member/AddAdminRole', 0, 0)">
|
||||||
|
|||||||
@@ -3,34 +3,36 @@
|
|||||||
ViewBag.title = "管理员管理";
|
ViewBag.title = "管理员管理";
|
||||||
}
|
}
|
||||||
<div class="wrapper wrapper-content ">
|
<div class="wrapper wrapper-content ">
|
||||||
<div class="ibox float-e-margins">
|
<div class="row">
|
||||||
<div class="ibox-title">
|
<div class="search-collapse">
|
||||||
<h5>@ViewBag.title</h5>
|
<form id="formSearch" onsubmit="return doSearch(); return false;">
|
||||||
<div class="ibox-tools">
|
<div class="select-list">
|
||||||
</div>
|
<ul>
|
||||||
</div>
|
<li>
|
||||||
<div class="ibox-content">
|
管理组:
|
||||||
<div class="panel panel-default">
|
<select name="roleid" id="roleid">
|
||||||
<div class="panel-heading">筛选条件</div>
|
|
||||||
<div class="panel-body">
|
|
||||||
<form id="formSearch" class="form-horizontal form-inline">
|
|
||||||
<div>
|
|
||||||
<label class="control-label">管理组:</label>
|
|
||||||
|
|
||||||
<select class="form-control" name="roleid" id="roleid">
|
|
||||||
<option value="0">所有管理组</option>
|
<option value="0">所有管理组</option>
|
||||||
@foreach (var m in ViewBag.RoleList)
|
@foreach (var m in ViewBag.RoleList)
|
||||||
{
|
{
|
||||||
<option value="@m.Id">@m.RoleName</option>
|
<option value="@m.Id">@m.RoleName</option>
|
||||||
}
|
}
|
||||||
</select>
|
</select>
|
||||||
<label class="control-label">关键字:</label>
|
</li>
|
||||||
<input type="text" placeholder="用户名关键字" name="keyword" id="keyword" class="form-control">
|
<li>
|
||||||
<button type="button" style="margin-left:50px" id="btn_query" class="btn btn-primary" onclick="doSearch();">查询</button>
|
关键字:
|
||||||
|
<input type="text" placeholder="标题关键字" name="keyword" id="keyword">
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<button type="button" id="btn_query" class="btn btn-primary btn-sm" onclick="doSearch();">查询</button>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="ibox float-e-margins">
|
||||||
|
|
||||||
|
<div class="ibox-content">
|
||||||
<div id="toolbar" class="btn-group">
|
<div id="toolbar" class="btn-group">
|
||||||
<button id="btn_add" type="button" class="btn btn-outline btn-default" onclick="top.showDialog('addadmins', '添加管理员', '/AdminCP/Member/AddAdmin', 0, 0)">
|
<button id="btn_add" type="button" class="btn btn-outline btn-default" onclick="top.showDialog('addadmins', '添加管理员', '/AdminCP/Member/AddAdmin', 0, 0)">
|
||||||
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>新增
|
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>新增
|
||||||
|
|||||||
@@ -4,9 +4,6 @@
|
|||||||
}
|
}
|
||||||
<div class="wrapper wrapper-content ">
|
<div class="wrapper wrapper-content ">
|
||||||
<div class="ibox float-e-margins">
|
<div class="ibox float-e-margins">
|
||||||
<div class="ibox-title">
|
|
||||||
<h5>@ViewBag.Title</h5>
|
|
||||||
</div>
|
|
||||||
<div class="ibox-content">
|
<div class="ibox-content">
|
||||||
<div id="toolbar" class="btn-group">
|
<div id="toolbar" class="btn-group">
|
||||||
<button id="btn_add" type="button" class="btn btn-outline btn-default" onclick="top.showDialog('addmemberrole', '添加用户组', '/AdminCP/Member/AddMemberRole', 0, 0)">
|
<button id="btn_add" type="button" class="btn btn-outline btn-default" onclick="top.showDialog('addmemberrole', '添加用户组', '/AdminCP/Member/AddMemberRole', 0, 0)">
|
||||||
|
|||||||
@@ -3,34 +3,36 @@
|
|||||||
ViewBag.title = "用户管理";
|
ViewBag.title = "用户管理";
|
||||||
}
|
}
|
||||||
<div class="wrapper wrapper-content">
|
<div class="wrapper wrapper-content">
|
||||||
<div class="ibox float-e-margins">
|
<div class="row">
|
||||||
<div class="ibox-title">
|
<div class="search-collapse">
|
||||||
<h5>@ViewBag.Title</h5>
|
<form id="formSearch" onsubmit="return doSearch(); return false;">
|
||||||
<div class="ibox-tools">
|
<div class="select-list">
|
||||||
</div>
|
<ul>
|
||||||
</div>
|
<li>
|
||||||
<div class="ibox-content">
|
用户组:
|
||||||
<div class="panel panel-default">
|
<select name="roleid" id="roleid">
|
||||||
<div class="panel-heading">筛选条件</div>
|
|
||||||
<div class="panel-body">
|
|
||||||
<form id="formSearch" class="form-horizontal form-inline">
|
|
||||||
<div>
|
|
||||||
<label class="control-label">用户组:</label>
|
|
||||||
|
|
||||||
<select class="form-control" name="roleid" id="roleid">
|
|
||||||
<option value="0">所有用户组</option>
|
<option value="0">所有用户组</option>
|
||||||
@foreach (var m in ViewBag.RoleList)
|
@foreach (var m in ViewBag.RoleList)
|
||||||
{
|
{
|
||||||
<option value="@m.Id">@m.RoleName</option>
|
<option value="@m.Id">@m.RoleName</option>
|
||||||
}
|
}
|
||||||
</select>
|
</select>
|
||||||
<label class="control-label">关键字:</label>
|
</li>
|
||||||
<input type="text" placeholder="用户名关键字" name="keyword" id="keyword" class="form-control">
|
<li>
|
||||||
<button type="button" style="margin-left:50px" id="btn_query" class="btn btn-primary" onclick="doSearch();">查询</button>
|
关键字:
|
||||||
|
<input type="text" placeholder="标题关键字" name="keyword" id="keyword">
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<button type="button" id="btn_query" class="btn btn-primary btn-sm" onclick="doSearch();">查询</button>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="ibox float-e-margins">
|
||||||
|
|
||||||
|
<div class="ibox-content">
|
||||||
@*<div id="toolbar" class="btn-group">
|
@*<div id="toolbar" class="btn-group">
|
||||||
<button id="btn_add" type="button" class="btn btn-outline btn-default" onclick="top.showDialog('addads', '添加用户', '/AdminCP/Member/AddMember', 0, 0)">
|
<button id="btn_add" type="button" class="btn btn-outline btn-default" onclick="top.showDialog('addads', '添加用户', '/AdminCP/Member/AddMember', 0, 0)">
|
||||||
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>新增
|
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>新增
|
||||||
|
|||||||
@@ -4,38 +4,43 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
<div class="wrapper wrapper-content">
|
<div class="wrapper wrapper-content">
|
||||||
<div class="ibox float-e-margins">
|
<div class="row">
|
||||||
<div class="ibox-title">
|
<div class="search-collapse">
|
||||||
<h5>@ViewBag.Title</h5>
|
<form id="formSearch" onsubmit="return doSearch(); return false;">
|
||||||
<div class="ibox-tools">
|
<div class="select-list">
|
||||||
</div>
|
<ul>
|
||||||
</div>
|
<li>
|
||||||
<div class="ibox-content">
|
订单状态:
|
||||||
<div class="panel panel-default">
|
<select name="status" id="status">
|
||||||
<div class="panel-heading">筛选条件</div>
|
|
||||||
<div class="panel-body">
|
|
||||||
<form id="formSearch" class="form-horizontal form-inline" onsubmit="return doSearch();">
|
|
||||||
<div>
|
|
||||||
<label class="control-label">订单状态:</label>
|
|
||||||
<select class="form-control" name="status" id="status">
|
|
||||||
<option value="">不限状态</option>
|
<option value="">不限状态</option>
|
||||||
<option value="未确认">未确认</option>
|
<option value="未确认">未确认</option>
|
||||||
<option value="已确认">已确认</option>
|
<option value="已确认">已确认</option>
|
||||||
<option value="已完成">已完成</option>
|
<option value="已完成">已完成</option>
|
||||||
</select>
|
</select>
|
||||||
<label class="control-label">支付状态:</label>
|
</li>
|
||||||
<select class="form-control" name="paystatus" id="paystatus">
|
<li>
|
||||||
|
支付状态:
|
||||||
|
<select name="paystatus" id="paystatus">
|
||||||
<option value="">不限状态</option>
|
<option value="">不限状态</option>
|
||||||
<option value="未支付">未支付</option>
|
<option value="未支付">未支付</option>
|
||||||
<option value="已支付">已支付</option>
|
<option value="已支付">已支付</option>
|
||||||
</select>
|
</select>
|
||||||
<label class="control-label">关键字:</label>
|
</li>
|
||||||
<input type="text" placeholder="标题关键字" name="keyword" id="keyword" class="form-control">
|
<li>
|
||||||
<button type="button" style="margin-left:50px" id="btn_query" class="btn btn-primary" onclick="doSearch();">查询</button>
|
关键字:
|
||||||
|
<input type="text" placeholder="标题关键字" name="keyword" id="keyword">
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<button type="button" id="btn_query" class="btn btn-primary btn-sm" onclick="doSearch();">查询</button>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="ibox float-e-margins">
|
||||||
|
<div class="ibox-content">
|
||||||
<table id="tb_departments"></table>
|
<table id="tb_departments"></table>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|||||||
@@ -4,33 +4,45 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
<div class="wrapper wrapper-content">
|
<div class="wrapper wrapper-content">
|
||||||
<div class="ibox float-e-margins">
|
<div class="row">
|
||||||
<div class="ibox-title">
|
<div class="search-collapse">
|
||||||
<h5>@ViewBag.Title</h5>
|
<form id="formSearch" onsubmit="return doSearch(); return false;">
|
||||||
<div class="ibox-tools">
|
<div class="select-list">
|
||||||
</div>
|
<ul>
|
||||||
</div>
|
<li>
|
||||||
<div class="ibox-content">
|
支付类型:
|
||||||
<div class="panel panel-default">
|
<select name="mytype" id="mytype">
|
||||||
<div class="panel-heading">筛选条件</div>
|
|
||||||
<div class="panel-body">
|
|
||||||
<form id="formSearch" class="form-horizontal form-inline" onsubmit="return doSearch();">
|
|
||||||
<div>
|
|
||||||
<label class="control-label">支付类型:</label>
|
|
||||||
<select class="form-control" name="mytype" id="mytype">
|
|
||||||
<option value="0">不限状态</option>
|
<option value="0">不限状态</option>
|
||||||
<option value="1">商品订单</option>
|
<option value="1">商品订单</option>
|
||||||
<option value="2">快餐订单</option>
|
<option value="2">快餐订单</option>
|
||||||
<option value="3">酒店预定</option>
|
<option value="3">酒店预定</option>
|
||||||
<option value="99" selected>代理商认证费订单</option>
|
<option value="99" selected>代理商认证费订单</option>
|
||||||
</select>
|
</select>
|
||||||
<label class="control-label">关键字:</label>
|
</li>
|
||||||
<input type="text" placeholder="标题关键字" name="keyword" id="keyword" class="form-control">
|
<li>
|
||||||
<button type="button" style="margin-left:50px" id="btn_query" class="btn btn-primary" onclick="doSearch();">查询</button>
|
支付状态:
|
||||||
|
<select name="paystatus" id="paystatus">
|
||||||
|
<option value="">不限状态</option>
|
||||||
|
<option value="未支付">未支付</option>
|
||||||
|
<option value="已支付">已支付</option>
|
||||||
|
</select>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
关键字:
|
||||||
|
<input type="text" placeholder="标题关键字" name="keyword" id="keyword">
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<button type="button" id="btn_query" class="btn btn-primary btn-sm" onclick="doSearch();">查询</button>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="ibox float-e-margins">
|
||||||
|
|
||||||
|
<div class="ibox-content">
|
||||||
<table id="tb_departments"></table>
|
<table id="tb_departments"></table>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@@ -54,7 +66,8 @@
|
|||||||
limit: params.limit, //页面大小
|
limit: params.limit, //页面大小
|
||||||
page: (params.offset / params.limit) + 1, //页码
|
page: (params.offset / params.limit) + 1, //页码
|
||||||
mytype: $("#mytype").val(),
|
mytype: $("#mytype").val(),
|
||||||
keyword: $("#keyword").val()
|
keyword: $("#keyword").val(),
|
||||||
|
paystatus: $("#paystatus").val()
|
||||||
};
|
};
|
||||||
return temp;
|
return temp;
|
||||||
}
|
}
|
||||||
@@ -165,7 +178,7 @@
|
|||||||
limit: params.limit, //页面大小
|
limit: params.limit, //页面大小
|
||||||
page: (params.offset / params.limit) + 1, //页码
|
page: (params.offset / params.limit) + 1, //页码
|
||||||
mytype: $("#mytype").val(),
|
mytype: $("#mytype").val(),
|
||||||
departmentname: $("#keyword").val()
|
paystatus: $("#paystatus").val()
|
||||||
};
|
};
|
||||||
return temp;
|
return temp;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -4,9 +4,6 @@
|
|||||||
}
|
}
|
||||||
<div class="wrapper wrapper-content ">
|
<div class="wrapper wrapper-content ">
|
||||||
<div class="ibox float-e-margins">
|
<div class="ibox float-e-margins">
|
||||||
<div class="ibox-title">
|
|
||||||
<h5>@ViewBag.title</h5>
|
|
||||||
</div>
|
|
||||||
<div class="ibox-content">
|
<div class="ibox-content">
|
||||||
<div id="toolbar" class="btn-group">
|
<div id="toolbar" class="btn-group">
|
||||||
<button id="btn_add" type="button" class="btn btn-outline btn-default" onclick="showAddRow();">
|
<button id="btn_add" type="button" class="btn btn-outline btn-default" onclick="showAddRow();">
|
||||||
|
|||||||
@@ -3,34 +3,36 @@
|
|||||||
ViewBag.title = "广告管理";
|
ViewBag.title = "广告管理";
|
||||||
}
|
}
|
||||||
<div class="wrapper wrapper-content ">
|
<div class="wrapper wrapper-content ">
|
||||||
<div class="ibox float-e-margins">
|
<div class="row">
|
||||||
<div class="ibox-title">
|
<div class="search-collapse">
|
||||||
<h5>@ViewBag.title</h5>
|
<form id="formSearch" onsubmit="return doSearch(); return false;">
|
||||||
<div class="ibox-tools">
|
<div class="select-list">
|
||||||
</div>
|
<ul>
|
||||||
</div>
|
<li>
|
||||||
<div class="ibox-content">
|
广告分类:
|
||||||
<div class="panel panel-default">
|
<select name="kid" id="kid">
|
||||||
<div class="panel-heading">筛选条件</div>
|
|
||||||
<div class="panel-body">
|
|
||||||
<form id="formSearch" class="form-horizontal form-inline">
|
|
||||||
<div>
|
|
||||||
<label class="control-label">广告分类:</label>
|
|
||||||
|
|
||||||
<select class="form-control" name="kid" id="kid">
|
|
||||||
<option value="0">所有栏目</option>
|
<option value="0">所有栏目</option>
|
||||||
@foreach (var m in ViewBag.ListKinds)
|
@foreach (var m in ViewBag.ListKinds)
|
||||||
{
|
{
|
||||||
<option value="@m.Id">@m.KindName</option>
|
<option value="@m.Id">@m.KindName</option>
|
||||||
}
|
}
|
||||||
</select>
|
</select>
|
||||||
<label class="control-label">关键字:</label>
|
</li>
|
||||||
<input type="text" placeholder="标题关键字" name="keyword" id="keyword" class="form-control">
|
<li>
|
||||||
<button type="button" style="margin-left:50px" id="btn_query" class="btn btn-primary" onclick="doSearch();">查询</button>
|
关键字:
|
||||||
|
<input type="text" placeholder="标题关键字" name="keyword" id="keyword">
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<button type="button" id="btn_query" class="btn btn-primary btn-sm" onclick="doSearch();">查询</button>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="ibox float-e-margins">
|
||||||
|
<div class="ibox-content">
|
||||||
|
|
||||||
<div id="toolbar" class="btn-group">
|
<div id="toolbar" class="btn-group">
|
||||||
<button id="btn_add" type="button" class="btn btn-outline btn-default" onclick="top.showDialog('addads','添加广告','/AdminCP/Other/AddAds',0,0)">
|
<button id="btn_add" type="button" class="btn btn-outline btn-default" onclick="top.showDialog('addads','添加广告','/AdminCP/Other/AddAds',0,0)">
|
||||||
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>新增
|
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>新增
|
||||||
|
|||||||
@@ -5,9 +5,6 @@
|
|||||||
}
|
}
|
||||||
<div class="wrapper wrapper-content">
|
<div class="wrapper wrapper-content">
|
||||||
<div class="ibox float-e-margins">
|
<div class="ibox float-e-margins">
|
||||||
<div class="ibox-title">
|
|
||||||
<h5>@ViewBag.title</h5>
|
|
||||||
</div>
|
|
||||||
<div class="ibox-content">
|
<div class="ibox-content">
|
||||||
<div id="toolbar" class="btn-group">
|
<div id="toolbar" class="btn-group">
|
||||||
<button id="btn_add" type="button" class="btn btn-outline btn-default" onclick="showAddRow();">
|
<button id="btn_add" type="button" class="btn btn-outline btn-default" onclick="showAddRow();">
|
||||||
|
|||||||
@@ -3,34 +3,36 @@
|
|||||||
ViewBag.title = "友情链接管理";
|
ViewBag.title = "友情链接管理";
|
||||||
}
|
}
|
||||||
<div class="wrapper wrapper-content">
|
<div class="wrapper wrapper-content">
|
||||||
<div class="ibox float-e-margins">
|
<div class="row">
|
||||||
<div class="ibox-title">
|
<div class="search-collapse">
|
||||||
<h5>@ViewBag.title</h5>
|
<form id="formSearch" onsubmit="return doSearch(); return false;">
|
||||||
<div class="ibox-tools">
|
<div class="select-list">
|
||||||
</div>
|
<ul>
|
||||||
</div>
|
<li>
|
||||||
<div class="ibox-content">
|
友情链接分类:
|
||||||
<div class="panel panel-default">
|
<select name="kid" id="kid">
|
||||||
<div class="panel-heading">筛选条件</div>
|
|
||||||
<div class="panel-body">
|
|
||||||
<form id="formSearch" class="form-horizontal form-inline">
|
|
||||||
<div>
|
|
||||||
<label class="control-label">友情链接分类:</label>
|
|
||||||
|
|
||||||
<select class="form-control" name="kid" id="kid">
|
|
||||||
<option value="0">所有分类</option>
|
<option value="0">所有分类</option>
|
||||||
@foreach (var m in ViewBag.ListKinds)
|
@foreach (var m in ViewBag.ListKinds)
|
||||||
{
|
{
|
||||||
<option value="@m.Id">@m.KindName</option>
|
<option value="@m.Id">@m.KindName</option>
|
||||||
}
|
}
|
||||||
</select>
|
</select>
|
||||||
<label class="control-label">关键字:</label>
|
</li>
|
||||||
<input type="text" placeholder="标题关键字" name="keyword" id="keyword" class="form-control">
|
<li>
|
||||||
<button type="button" style="margin-left:50px" id="btn_query" class="btn btn-primary">查询</button>
|
关键字:
|
||||||
|
<input type="text" placeholder="标题关键字" name="keyword" id="keyword">
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<button type="button" id="btn_query" class="btn btn-primary btn-sm" onclick="doSearch();">查询</button>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="ibox float-e-margins">
|
||||||
|
<div class="ibox-content">
|
||||||
|
|
||||||
<div id="toolbar" class="btn-group">
|
<div id="toolbar" class="btn-group">
|
||||||
<button id="btn_add" type="button" class="btn btn-outline btn-default" onclick="top.showDialog('addads', '添加友情链接', '/AdminCP/Other/AddLink', 0, 0)">
|
<button id="btn_add" type="button" class="btn btn-outline btn-default" onclick="top.showDialog('addads', '添加友情链接', '/AdminCP/Other/AddLink', 0, 0)">
|
||||||
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>新增
|
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>新增
|
||||||
@@ -50,6 +52,21 @@
|
|||||||
oButtonInit.Init();
|
oButtonInit.Init();
|
||||||
|
|
||||||
});
|
});
|
||||||
|
function doSearch() {
|
||||||
|
var params = $('#tb_departments').bootstrapTable('getOptions');
|
||||||
|
//console.log(params);
|
||||||
|
params.queryParams = function (params) {
|
||||||
|
|
||||||
|
var temp = { //这里的键的名字和控制器的变量名必须一直,这边改动,控制器也需要改成一样的
|
||||||
|
limit: params.limit, //页面大小
|
||||||
|
page: (params.offset / params.limit) + 1, //页码
|
||||||
|
kid: $("#kid").val(),
|
||||||
|
keyword: $("#keyword").val(),
|
||||||
|
};
|
||||||
|
return temp;
|
||||||
|
}
|
||||||
|
$('#tb_departments').bootstrapTable('refresh', params);
|
||||||
|
}
|
||||||
var TableInit = function () {
|
var TableInit = function () {
|
||||||
var oTableInit = new Object();
|
var oTableInit = new Object();
|
||||||
//初始化Table
|
//初始化Table
|
||||||
@@ -68,7 +85,7 @@
|
|||||||
pageNumber: 1, //初始化加载第一页,默认第一页
|
pageNumber: 1, //初始化加载第一页,默认第一页
|
||||||
pageSize: 25, //每页的记录行数(*)
|
pageSize: 25, //每页的记录行数(*)
|
||||||
pageList: [10, 25, 50, 100], //可供选择的每页的行数(*)
|
pageList: [10, 25, 50, 100], //可供选择的每页的行数(*)
|
||||||
search: true, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
|
search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
|
||||||
strictSearch: true,
|
strictSearch: true,
|
||||||
showColumns: true, //是否显示所有的列
|
showColumns: true, //是否显示所有的列
|
||||||
showRefresh: true, //是否显示刷新按钮
|
showRefresh: true, //是否显示刷新按钮
|
||||||
@@ -113,7 +130,7 @@
|
|||||||
limit: params.limit, //页面大小
|
limit: params.limit, //页面大小
|
||||||
page: (params.offset / params.limit) + 1, //页码
|
page: (params.offset / params.limit) + 1, //页码
|
||||||
kid:$("#kid").val(),
|
kid:$("#kid").val(),
|
||||||
departmentname: $("#keyword").val()
|
keyword: $("#keyword").val()
|
||||||
};
|
};
|
||||||
return temp;
|
return temp;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">禁用:</label>
|
<label class="col-sm-3 control-label">禁用:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<label>
|
<label class="checkbox-inline i-checks">
|
||||||
<input type="checkbox" value="1" name="IsDisable" id="IsDisable"> 禁用
|
<input type="checkbox" value="1" name="IsDisable" id="IsDisable"> 禁用
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -4,9 +4,6 @@
|
|||||||
}
|
}
|
||||||
<div class="wrapper wrapper-content">
|
<div class="wrapper wrapper-content">
|
||||||
<div class="ibox float-e-margins">
|
<div class="ibox float-e-margins">
|
||||||
<div class="ibox-title">
|
|
||||||
<h5>@ViewBag.title</h5>
|
|
||||||
</div>
|
|
||||||
<div class="ibox-content">
|
<div class="ibox-content">
|
||||||
<div id="toolbar" class="btn-group">
|
<div id="toolbar" class="btn-group">
|
||||||
<button id="btn_add" type="button" class="btn btn-outline btn-default" onclick="showDialog('addadminmenu','添加后台菜单','/AdminCP/Permission/AddAdminMenu',0,0);">
|
<button id="btn_add" type="button" class="btn btn-outline btn-default" onclick="showDialog('addadminmenu','添加后台菜单','/AdminCP/Permission/AddAdminMenu',0,0);">
|
||||||
@@ -19,7 +16,7 @@
|
|||||||
<span class="fa fa-refresh" aria-hidden="true"></span>刷新
|
<span class="fa fa-refresh" aria-hidden="true"></span>刷新
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<table class="tree table table-striped table-bordered">
|
<table class="tree table table-striped table-bordered table-hover">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>菜单名称</th>
|
<th>菜单名称</th>
|
||||||
@@ -51,7 +48,11 @@
|
|||||||
<td class="text-center">
|
<td class="text-center">
|
||||||
@if (m.IsHide == 1)
|
@if (m.IsHide == 1)
|
||||||
{
|
{
|
||||||
<i class="fa fa-eye-slash"></i>
|
<i class="fa fa-eye-slash text-danger" style="cursor:pointer" onclick="doChangeHide(@(m.Id))" title="点击取消隐藏该菜单"></i>
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<i class="fa fa-eye text-success" style="cursor:pointer" onclick="doChangeHide(@(m.Id))" title="点击隐藏该菜单"></i>
|
||||||
}
|
}
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
@@ -72,6 +73,30 @@
|
|||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
$('.tree').treegrid();
|
$('.tree').treegrid();
|
||||||
});
|
});
|
||||||
|
function doChangeHide(id) {
|
||||||
|
var loading = layer.load(0, {
|
||||||
|
shade: [0.2, '#000'] //0.1透明度的背景
|
||||||
|
});
|
||||||
|
$.ajax({
|
||||||
|
type: "POST",
|
||||||
|
url: "/AdminCP/Permission/DoChangeAdminMenuHide",
|
||||||
|
data: { id: id },
|
||||||
|
dataType: "JSON",
|
||||||
|
success: function (data) {
|
||||||
|
if (data.status == "success") {
|
||||||
|
layer.close(loading);
|
||||||
|
window.location.href = window.location.href;
|
||||||
|
} else {
|
||||||
|
layer.close(loading);
|
||||||
|
layer.alert(data.message, { icon: 2 });
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error: function () {
|
||||||
|
layer.close(loading);
|
||||||
|
layer.alert('执行错误,请联系管理员!', { icon: 2 });
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -0,0 +1,56 @@
|
|||||||
|
@model TargetEvent
|
||||||
|
@{
|
||||||
|
ViewBag.title = "查看/编辑权限事件";
|
||||||
|
}
|
||||||
|
|
||||||
|
<div class="wrapper wrapper-content">
|
||||||
|
<div class="ibox float-e-margins">
|
||||||
|
<div class="ibox-title">
|
||||||
|
<h5>@(ViewBag.title)</h5>
|
||||||
|
<div class="ibox-tools">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="ibox-content">
|
||||||
|
@using (Html.BeginForm(null, null, FormMethod.Post, new { id = "editEventKeyForm", @class = "form-horizontal m-t" }))
|
||||||
|
{
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">事件key:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input id="EventKey" name="EventKey" minlength="2" maxlength="50" type="text" class="form-control" required aria-required="true" value="@Model.EventKey">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">事件名称:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input id="EventName" type="text" class="form-control" name="EventName" required aria-required="true" value="@Model.EventName">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">排序:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input id="Rank" type="number" class="form-control" name="Rank" value="@Model.Rank" required aria-required="true">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">禁用:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<label class="checkbox-inline i-checks">
|
||||||
|
<input type="checkbox" value="1" name="IsDisable" id="IsDisable" @(Model.IsDisable == 1 ? "checked" : "")> 禁用
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<div class="col-sm-4 col-sm-offset-3">
|
||||||
|
<button class="btn btn-primary" type="submit"><i class="fa fa-save"></i> 提交 </button>
|
||||||
|
<button class="btn btn-default" type="button" onclick="closethisdialog();"><i class="fa fa-close"></i> 取消 </button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script>
|
||||||
|
$(function () {
|
||||||
|
DoPost("editEventKeyForm");
|
||||||
|
})
|
||||||
|
</script>
|
||||||
@@ -1,25 +1,24 @@
|
|||||||
<div class="wrapper wrapper-content">
|
<div class="wrapper wrapper-content">
|
||||||
<div class="ibox float-e-margins">
|
<div class="row">
|
||||||
<div class="ibox-title">
|
<div class="search-collapse">
|
||||||
<h5>权限事件管理</h5>
|
<form id="formSearch" onsubmit="return doSearch(); return false;">
|
||||||
</div>
|
<div class="select-list">
|
||||||
<div class="ibox-content">
|
<ul>
|
||||||
<div class="panel panel-default">
|
<li>
|
||||||
<div class="panel-heading">查询条件</div>
|
关键字:
|
||||||
<div class="panel-body">
|
<input type="text" placeholder="标题关键字" name="keyword" id="keyword">
|
||||||
<form id="formSearch" class="form-horizontal">
|
</li>
|
||||||
<div class="form-group" style="margin-top:15px">
|
<li>
|
||||||
<label class="control-label col-sm-1" for="txt_search_departmentname">权限名称</label>
|
<button type="button" id="btn_query" class="btn btn-primary btn-sm" onclick="doSearch();">查询</button>
|
||||||
<div class="col-sm-3">
|
</li>
|
||||||
<input type="text" class="form-control" id="keyword">
|
</ul>
|
||||||
</div>
|
|
||||||
<div class="col-sm-4" style="text-align:left;">
|
|
||||||
<button type="button" style="margin-left:50px" id="btn_query" class="btn btn-primary">查询</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="ibox float-e-margins">
|
||||||
|
|
||||||
|
<div class="ibox-content">
|
||||||
<div id="toolbar" class="btn-group">
|
<div id="toolbar" class="btn-group">
|
||||||
<button id="btn_add" type="button" class="btn btn-outline btn-default" onclick="top.showDialog('addventkey','添加权限','/AdminCP/Permission/AddEventKey',0,0)">
|
<button id="btn_add" type="button" class="btn btn-outline btn-default" onclick="top.showDialog('addventkey','添加权限','/AdminCP/Permission/AddEventKey',0,0)">
|
||||||
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>新增
|
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>新增
|
||||||
@@ -69,8 +68,6 @@
|
|||||||
cardView: false, //是否显示详细视图
|
cardView: false, //是否显示详细视图
|
||||||
detailView: false, //是否显示父子表
|
detailView: false, //是否显示父子表
|
||||||
columns: [{
|
columns: [{
|
||||||
checkbox: true
|
|
||||||
}, {
|
|
||||||
field: 'EventName',
|
field: 'EventName',
|
||||||
title: '事件名称'
|
title: '事件名称'
|
||||||
}, {
|
}, {
|
||||||
@@ -81,8 +78,22 @@
|
|||||||
title: '排序'
|
title: '排序'
|
||||||
}, {
|
}, {
|
||||||
field: 'IsDisable',
|
field: 'IsDisable',
|
||||||
title: '是否禁用'
|
title: '是否禁用',
|
||||||
}, ]
|
formatter: function (value, row, index) {
|
||||||
|
if (value == 0) {
|
||||||
|
return '<span class="label label-primary">启用</span>';
|
||||||
|
} else {
|
||||||
|
return '<span class="label label-danger">禁用</span>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'Id',
|
||||||
|
title: '操作',
|
||||||
|
formatter: 'actionFormatter',
|
||||||
|
width: 140
|
||||||
|
}
|
||||||
|
]
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -97,7 +108,12 @@
|
|||||||
};
|
};
|
||||||
return oTableInit;
|
return oTableInit;
|
||||||
};
|
};
|
||||||
|
function actionFormatter(value, row, index) {
|
||||||
|
return [
|
||||||
|
'<a href="javascript:;" class="btn btn-xs btn-primary" title="编辑" onclick="top.showDialog(\'eidtEventKey\', \'编辑事件权限详情\', \'/AdminCP/Permission/EditEventKey/' + value + '\', 0, 0)"><i class="fa fa-edit"></i> 编辑</a>',
|
||||||
|
'<a href="javascript:;" class="btn btn-xs btn-danger m-l-xs" title="删除" onclick="doDel(\'/AdminCP/Permission/DelEventKey\',' + value + ');"><i class="fa fa-close"></i> 删除</a>',
|
||||||
|
].join('');
|
||||||
|
}
|
||||||
|
|
||||||
var ButtonInit = function () {
|
var ButtonInit = function () {
|
||||||
var oInit = new Object();
|
var oInit = new Object();
|
||||||
|
|||||||
@@ -27,7 +27,13 @@
|
|||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">栏目名称:</label>
|
<label class="col-sm-3 control-label">栏目名称:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input id="KindName" name="KindName" maxlength="200" type="text" class="form-control" required aria-required="true" placeholder="填写栏目名称">
|
<input id="KindName" name="KindName" maxlength="200" type="text" class="form-control" required aria-required="true" placeholder="填写栏目名称" onblur="aoutoTransform()">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">栏目路径:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input id="FilePath" name="FilePath" maxlength="100" type="text" class="form-control" aria-required="true" placeholder="填写栏目路径,SEO优化使用,最多支持4级目录,可以输入字母、数字和-">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
@@ -69,29 +75,34 @@
|
|||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
@*<div class="form-group">
|
|
||||||
<label class="col-sm-3 control-label">栏目模板:</label>
|
<label class="col-sm-3 control-label">栏目模板:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<select class="form-control" name="TemplateFile" id="TemplateFile">
|
<select class="form-control" name="TemplateFile" id="TemplateFile">
|
||||||
@foreach (var s in ViewBag.ListTpl)
|
@foreach (var s in ViewBag.ListTpl)
|
||||||
{
|
{
|
||||||
<option value="@s" >@s</option>
|
if (s.ToLower().StartsWith("index"))
|
||||||
|
{
|
||||||
|
<option value="@s">@s</option>
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">商品模板:</label>
|
<label class="col-sm-3 control-label">商品详情模板:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<select class="form-control" name="DetailTemplateFile" id="DetailTemplateFile">
|
<select class="form-control" name="DetailTemplateFile" id="DetailTemplateFile">
|
||||||
@foreach (var s in ViewBag.ListTpl)
|
@foreach (var s in ViewBag.ListTpl)
|
||||||
|
{
|
||||||
|
if (s.ToLower().StartsWith("detail"))
|
||||||
{
|
{
|
||||||
<option value="@s">@s</option>
|
<option value="@s">@s</option>
|
||||||
}
|
}
|
||||||
|
}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>*@
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">隐藏栏目:</label>
|
<label class="col-sm-3 control-label">隐藏栏目:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
@@ -145,5 +156,30 @@
|
|||||||
DoPost("addArticleKindForm");
|
DoPost("addArticleKindForm");
|
||||||
CKEDITOR.replace('KindInfo');
|
CKEDITOR.replace('KindInfo');
|
||||||
})
|
})
|
||||||
|
function aoutoTransform() {
|
||||||
|
var title = $("#KindName").val();
|
||||||
|
var filePath = $("#FilePath").val();
|
||||||
|
var pid = $("#PId").val();
|
||||||
|
if (!filePath) {
|
||||||
|
$.ajax({
|
||||||
|
type: "POST",
|
||||||
|
url: "/AdminCP/Server/Hanzi2Pinyin",
|
||||||
|
data: { name: title, pid: pid, t: "category" },
|
||||||
|
dataType: "JSON",
|
||||||
|
success: function (data) {
|
||||||
|
if (data.status == "success") {
|
||||||
|
if (data.message) {
|
||||||
|
$("#FilePath").val(data.message);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
layer.alert(data.message, { icon: 2 });
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error: function () {
|
||||||
|
layer.alert('执行错误,请联系管理员!', { icon: 2 });
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -4,9 +4,6 @@
|
|||||||
}
|
}
|
||||||
<div class="wrapper wrapper-content ">
|
<div class="wrapper wrapper-content ">
|
||||||
<div class="ibox float-e-margins">
|
<div class="ibox float-e-margins">
|
||||||
<div class="ibox-title">
|
|
||||||
<h5>@ViewBag.title</h5>
|
|
||||||
</div>
|
|
||||||
<div class="ibox-content">
|
<div class="ibox-content">
|
||||||
<div id="toolbar" class="btn-group">
|
<div id="toolbar" class="btn-group">
|
||||||
<button id="btn_add" type="button" class="btn btn-outline btn-default" onclick="showDialog('addarticlekind','添加商品栏目','/AdminCP/Product/AddCategory',0,0);">
|
<button id="btn_add" type="button" class="btn btn-outline btn-default" onclick="showDialog('addarticlekind','添加商品栏目','/AdminCP/Product/AddCategory',0,0);">
|
||||||
@@ -37,12 +34,12 @@
|
|||||||
@foreach (var m in Model)
|
@foreach (var m in Model)
|
||||||
{
|
{
|
||||||
<tr class="treegrid-@m.Id @(m.PId !=0?"treegrid-parent-"+m.PId:"") ">
|
<tr class="treegrid-@m.Id @(m.PId !=0?"treegrid-parent-"+m.PId:"") ">
|
||||||
<td>@m.KindName</td>
|
<td><a href="@ViewsHelper.EchoURL(m)" target="_blank" title="新窗口打开栏目">@m.KindName</a></td>
|
||||||
<td>
|
<td>
|
||||||
@m.Id
|
@m.Id
|
||||||
</td>
|
</td>
|
||||||
<td class="text-center">
|
<td class="text-center">
|
||||||
<div class="input-group"><input type="number" class="form-control" id="ac_rank_@(m.Id)" name="ac_rank_@(m.Id)" value="@m.Rank" placeholder="请输入一个数字,越小排越前"><a class="input-group-addon btn btn-primary" title="修改保存" href="javascript:;" onclick="doSaveRank(@(m.Id))"><i class="fa fa-save"></i></a></div>
|
<div class="input-group input-group-sm"><input type="number" class="form-control" id="ac_rank_@(m.Id)" name="ac_rank_@(m.Id)" value="@m.Rank" placeholder="请输入一个数字,越小排越前"><a class="input-group-addon btn btn-primary" title="修改保存" href="javascript:;" onclick="doSaveRank(@(m.Id))"><i class="fa fa-save"></i></a></div>
|
||||||
</td>
|
</td>
|
||||||
<td class="text-center">@m.Counts</td>
|
<td class="text-center">@m.Counts</td>
|
||||||
<td class="text-center">
|
<td class="text-center">
|
||||||
|
|||||||
@@ -28,7 +28,13 @@
|
|||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">栏目名称:</label>
|
<label class="col-sm-3 control-label">栏目名称:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input id="KindName" name="KindName" maxlength="200" type="text" class="form-control" value="@Model.KindName" required aria-required="true" placeholder="填写栏目名称">
|
<input id="KindName" name="KindName" maxlength="200" type="text" class="form-control" value="@Model.KindName" required aria-required="true" placeholder="填写栏目名称" onblur="aoutoTransform()">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">栏目路径:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input id="FilePath" name="FilePath" maxlength="100" type="text" class="form-control" aria-required="true" placeholder="填写栏目路径,SEO优化使用,最多支持4级目录,可以输入字母、数字和-" value="@Model.FilePath">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
@@ -86,28 +92,34 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@*<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">栏目模板:</label>
|
<label class="col-sm-3 control-label">栏目模板:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<select class="form-control" name="TemplateFile" id="TemplateFile">
|
<select class="form-control" asp-for="TemplateFile">
|
||||||
@foreach (var s in ViewBag.ListTpl)
|
@foreach (var s in ViewBag.ListTpl)
|
||||||
{
|
{
|
||||||
<option value="@s" @(Model.TemplateFile == s?"selected":"")>@s</option>
|
if (s.ToLower().StartsWith("index"))
|
||||||
|
{
|
||||||
|
<option value="@s">@s</option>
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">商品模板:</label>
|
<label class="col-sm-3 control-label">商品详情模板:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<select class="form-control" name="DetailTemplateFile" id="DetailTemplateFile">
|
<select class="form-control" asp-for="DetailTemplateFile">
|
||||||
@foreach (var s in ViewBag.ListTpl)
|
@foreach (var s in ViewBag.ListTpl)
|
||||||
{
|
{
|
||||||
<option value="@s" @(Model.DetailTemplateFile == s?"selected":"")>@s</option>
|
if (s.ToLower().StartsWith("detail"))
|
||||||
|
{
|
||||||
|
<option value="@s">@s</option>
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>*@
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">隐藏栏目:</label>
|
<label class="col-sm-3 control-label">隐藏栏目:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
@@ -162,4 +174,29 @@
|
|||||||
DoPost("editCategoryForm");
|
DoPost("editCategoryForm");
|
||||||
CKEDITOR.replace('KindInfo');
|
CKEDITOR.replace('KindInfo');
|
||||||
})
|
})
|
||||||
|
function aoutoTransform() {
|
||||||
|
var title = $("#KindName").val();
|
||||||
|
var filePath = $("#FilePath").val();
|
||||||
|
var pid = $("#PId").val();
|
||||||
|
if (!filePath) {
|
||||||
|
$.ajax({
|
||||||
|
type: "POST",
|
||||||
|
url: "/AdminCP/Server/Hanzi2Pinyin",
|
||||||
|
data: { name: title, pid: pid, t: "category" },
|
||||||
|
dataType: "JSON",
|
||||||
|
success: function (data) {
|
||||||
|
if (data.status == "success") {
|
||||||
|
if (data.message) {
|
||||||
|
$("#FilePath").val(data.message);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
layer.alert(data.message, { icon: 2 });
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error: function () {
|
||||||
|
layer.alert('执行错误,请联系管理员!', { icon: 2 });
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
@@ -9,21 +9,14 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
<div class="wrapper wrapper-content">
|
<div class="wrapper wrapper-content">
|
||||||
<div class="ibox float-e-margins">
|
<div class="row">
|
||||||
<div class="ibox-title">
|
<div class="search-collapse">
|
||||||
<h5>@ViewBag.title</h5>
|
<form id="formSearch" onsubmit="return doSearch(); return false;">
|
||||||
<div class="ibox-tools">
|
<div class="select-list">
|
||||||
</div>
|
<ul>
|
||||||
</div>
|
<li>
|
||||||
<div class="ibox-content">
|
商品分类:
|
||||||
<div class="panel panel-default">
|
<select name="kid" id="kid">
|
||||||
<div class="panel-heading">筛选条件</div>
|
|
||||||
<div class="panel-body">
|
|
||||||
<form id="formSearch" class="form-horizontal form-inline" onsubmit="return doSearch(); return false;">
|
|
||||||
<div>
|
|
||||||
<label class="control-label">商品分类:</label>
|
|
||||||
|
|
||||||
<select class="form-control" name="kid" id="kid">
|
|
||||||
<option value="0">所有分类</option>
|
<option value="0">所有分类</option>
|
||||||
@foreach (var m in ViewBag.ListKinds)
|
@foreach (var m in ViewBag.ListKinds)
|
||||||
{
|
{
|
||||||
@@ -41,16 +34,26 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
</select>
|
</select>
|
||||||
<label class="checkbox-inline i-checks">
|
</li>
|
||||||
|
<li>
|
||||||
|
<label class="checkbox-inline i-checks" for="isshowsub">
|
||||||
<input type="checkbox" value="1" name="isshowsub" id="isshowsub" /> 显示下级栏目商品
|
<input type="checkbox" value="1" name="isshowsub" id="isshowsub" /> 显示下级栏目商品
|
||||||
</label>
|
</label>
|
||||||
<label class="control-label">关键字:</label>
|
</li>
|
||||||
<input type="text" placeholder="标题关键字" name="keyword" id="keyword" class="form-control">
|
<li>
|
||||||
<button type="button" style="margin-left:50px" id="btn_query" class="btn btn-primary" onclick="doSearch();">查询</button>
|
关键字:
|
||||||
|
<input type="text" placeholder="标题关键字" name="keyword" id="keyword">
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<button type="button" id="btn_query" class="btn btn-primary btn-sm" onclick="doSearch();">查询</button>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="ibox float-e-margins">
|
||||||
|
<div class="ibox-content">
|
||||||
<div id="toolbar" class="btn-group">
|
<div id="toolbar" class="btn-group">
|
||||||
<button id="btn_add" type="button" class="btn btn-outline btn-default" onclick="top.showDialog('addarticle','添加商品','/AdminCP/Product/AddProduct',0,0)">
|
<button id="btn_add" type="button" class="btn btn-outline btn-default" onclick="top.showDialog('addarticle','添加商品','/AdminCP/Product/AddProduct',0,0)">
|
||||||
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>新增
|
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>新增
|
||||||
@@ -133,6 +136,9 @@
|
|||||||
}, {
|
}, {
|
||||||
field: 'Title',
|
field: 'Title',
|
||||||
title: '商品标题',
|
title: '商品标题',
|
||||||
|
formatter: function (value, row, index) {
|
||||||
|
return '<a href="/Product/Detail/' + row["id"] + '" target="_blank" title="新窗口打开预览商品">' + value + '</a>'
|
||||||
|
}
|
||||||
|
|
||||||
}, {
|
}, {
|
||||||
field: 'Price',
|
field: 'Price',
|
||||||
@@ -143,7 +149,7 @@
|
|||||||
title: '排序',
|
title: '排序',
|
||||||
width: 130,
|
width: 130,
|
||||||
formatter: function (value, row, index) {
|
formatter: function (value, row, index) {
|
||||||
return '<div class="input-group"><input type="number" class="form-control" id="ac_rank_' + row["Id"] + '" name="ac_rank_' + row["Id"] + '" value="' + value + '" placeholder="请输入一个数字,越小排越前"><a class="input-group-addon btn btn-primary" title="修改保存" href="javascript:;" onclick="doSaveSequence(' + row["Id"] + ')"><i class="fa fa-save"></i></a></div>'
|
return '<div class="input-group"><input type="number" class="form-control input-sm" id="ac_rank_' + row["Id"] + '" name="ac_rank_' + row["Id"] + '" value="' + value + '" placeholder="请输入一个数字,越小排越前"><a class="input-group-addon btn btn-primary" title="修改保存" href="javascript:;" onclick="doSaveSequence(' + row["Id"] + ')"><i class="fa fa-save"></i></a></div>'
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
field: 'AddTime',
|
field: 'AddTime',
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user