Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
Education
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄奎
Education
Commits
6cc95445
Commit
6cc95445
authored
Sep 24, 2020
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
25a131f7
Hide whitespace changes
Inline
Side-by-side
Showing
63 changed files
with
215 additions
and
279 deletions
+215
-279
RedisConnectionHelp.cs
Edu.Cache/Base/RedisConnectionHelp.cs
+1
-1
RedisHelper.cs
Edu.Cache/Base/RedisHelper.cs
+7
-8
UserReidsCache.cs
Edu.Cache/User/UserReidsCache.cs
+1
-1
RequestParm.cs
Edu.Common/API/RequestParm.cs
+1
-8
ResultCode.cs
Edu.Common/API/ResultCode.cs
+1
-7
CacheTimeEnum.cs
Edu.Common/Enum/CacheTimeEnum.cs
+1
-2
AccountStatusEnum.cs
Edu.Common/Enum/User/AccountStatusEnum.cs
+0
-3
AccountTypeEnum.cs
Edu.Common/Enum/User/AccountTypeEnum.cs
+0
-3
CommonHelper.cs
Edu.Common/Plugin/CommonHelper.cs
+1
-1
ConvertHelper.cs
Edu.Common/Plugin/ConvertHelper.cs
+3
-3
EnumHelper.cs
Edu.Common/Plugin/EnumHelper.cs
+2
-4
FileHelper.cs
Edu.Common/Plugin/FileHelper.cs
+2
-4
IPHelper.cs
Edu.Common/Plugin/IPHelper.cs
+1
-2
LogHelper.cs
Edu.Common/Plugin/LogHelper.cs
+6
-6
NPOIHelper.cs
Edu.Common/Plugin/NPOIHelper.cs
+1
-11
NetFileHelper.cs
Edu.Common/Plugin/NetFileHelper.cs
+9
-7
RSAHelper.cs
Edu.Common/Plugin/RSAHelper.cs
+3
-11
SecurityHelper.cs
Edu.Common/Plugin/SecurityHelper.cs
+20
-32
StopwatchHelper.cs
Edu.Common/Plugin/StopwatchHelper.cs
+1
-6
StringHelper.cs
Edu.Common/Plugin/StringHelper.cs
+3
-33
ValidateHepler.cs
Edu.Common/Plugin/ValidateHepler.cs
+5
-5
WeiXinHelper.cs
Edu.Common/Plugin/WeiXinHelper.cs
+11
-17
WordTemplateHelper.cs
Edu.Common/Plugin/WordTemplateHelper.cs
+9
-14
UserInfo.cs
Edu.Model/CacheModel/UserInfo.cs
+1
-3
RB_Course_Category.cs
Edu.Model/Entity/Course/RB_Course_Category.cs
+1
-3
RB_Account.cs
Edu.Model/Entity/User/RB_Account.cs
+0
-2
RB_Group.cs
Edu.Model/Entity/User/RB_Group.cs
+0
-2
RB_Manager.cs
Edu.Model/Entity/User/RB_Manager.cs
+0
-2
CourseCategoryTree_ViewModel.cs
Edu.Model/ViewModel/Course/CourseCategoryTree_ViewModel.cs
+30
-0
RB_Course_Category_ViewModel.cs
Edu.Model/ViewModel/Course/RB_Course_Category_ViewModel.cs
+0
-2
AreaTree_ViewModel.cs
Edu.Model/ViewModel/System/AreaTree_ViewModel.cs
+1
-3
MenuTree_ViewModel.cs
Edu.Model/ViewModel/System/MenuTree_ViewModel.cs
+1
-3
RB_Destination_ViewModel.cs
Edu.Model/ViewModel/System/RB_Destination_ViewModel.cs
+3
-7
RB_Menu_ViewModel.cs
Edu.Model/ViewModel/System/RB_Menu_ViewModel.cs
+1
-5
RB_Role_ViewModel.cs
Edu.Model/ViewModel/System/RB_Role_ViewModel.cs
+2
-5
RB_Account_ViewModel.cs
Edu.Model/ViewModel/User/RB_Account_ViewModel.cs
+0
-2
RB_Assist_ViewModel.cs
Edu.Model/ViewModel/User/RB_Assist_ViewModel.cs
+0
-2
RB_Group_ViewModel.cs
Edu.Model/ViewModel/User/RB_Group_ViewModel.cs
+0
-2
RB_Manager_ViewModel.cs
Edu.Model/ViewModel/User/RB_Manager_ViewModel.cs
+0
-2
RB_School_ViewModel.cs
Edu.Model/ViewModel/User/RB_School_ViewModel.cs
+0
-2
RB_Student_ViewModel.cs
Edu.Model/ViewModel/User/RB_Student_ViewModel.cs
+0
-2
RB_Teacher_ViewModel.cs
Edu.Model/ViewModel/User/RB_Teacher_ViewModel.cs
+0
-2
CourseCategoryModule.cs
Edu.Module.Course/CourseCategoryModule.cs
+55
-2
DestinationModule.cs
Edu.Module.System/DestinationModule.cs
+0
-2
MenuModule.cs
Edu.Module.System/MenuModule.cs
+0
-2
AccountModule.cs
Edu.Module.User/AccountModule.cs
+0
-2
StudentModule.cs
Edu.Module.User/StudentModule.cs
+0
-2
TeacherModule.cs
Edu.Module.User/TeacherModule.cs
+0
-1
RB_Course_CategoryRepository.cs
Edu.Repository/Course/RB_Course_CategoryRepository.cs
+0
-1
RB_DestinationRepository.cs
Edu.Repository/System/RB_DestinationRepository.cs
+1
-3
RB_MenuRepository.cs
Edu.Repository/System/RB_MenuRepository.cs
+0
-1
RB_RoleRepository.cs
Edu.Repository/System/RB_RoleRepository.cs
+0
-1
RB_AccountRepository.cs
Edu.Repository/User/RB_AccountRepository.cs
+0
-1
RB_AssistRepository.cs
Edu.Repository/User/RB_AssistRepository.cs
+0
-1
RB_GroupRepository.cs
Edu.Repository/User/RB_GroupRepository.cs
+0
-1
RB_ManagerRepository.cs
Edu.Repository/User/RB_ManagerRepository.cs
+0
-1
RB_SchoolRepository.cs
Edu.Repository/User/RB_SchoolRepository.cs
+0
-1
RB_StudentRepository.cs
Edu.Repository/User/RB_StudentRepository.cs
+0
-1
RB_TeacherRepository.cs
Edu.Repository/User/RB_TeacherRepository.cs
+0
-1
BaseController.cs
Edu.WebApi/Controllers/BaseController.cs
+1
-7
CourseController.cs
Edu.WebApi/Controllers/Course/CourseController.cs
+27
-4
ApiFilterAttribute.cs
Edu.WebApi/Filter/ApiFilterAttribute.cs
+2
-2
WebApiTokenHelper.cs
Edu.WebApi/Helper/WebApiTokenHelper.cs
+0
-2
No files found.
Edu.Cache/Base/RedisConnectionHelp.cs
View file @
6cc95445
...
@@ -75,7 +75,7 @@ namespace Edu.CacheManager.Base
...
@@ -75,7 +75,7 @@ namespace Edu.CacheManager.Base
/// <returns></returns>
/// <returns></returns>
private
static
ConnectionMultiplexer
GetManager
(
string
connectionString
=
null
)
private
static
ConnectionMultiplexer
GetManager
(
string
connectionString
=
null
)
{
{
connectionString
=
connectionString
??
RedisConnectionString
;
connectionString
??=
RedisConnectionString
;
var
connect
=
ConnectionMultiplexer
.
Connect
(
connectionString
);
var
connect
=
ConnectionMultiplexer
.
Connect
(
connectionString
);
//注册如下事件
//注册如下事件
...
...
Edu.Cache/Base/RedisHelper.cs
View file @
6cc95445
...
@@ -3,7 +3,6 @@ using StackExchange.Redis;
...
@@ -3,7 +3,6 @@ using StackExchange.Redis;
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Threading.Tasks
;
namespace
Edu.CacheManager.Base
namespace
Edu.CacheManager.Base
...
@@ -80,7 +79,7 @@ namespace Edu.CacheManager.Base
...
@@ -80,7 +79,7 @@ namespace Edu.CacheManager.Base
/// <param name="value">保存的值</param>
/// <param name="value">保存的值</param>
/// <param name="expiry">过期时间</param>
/// <param name="expiry">过期时间</param>
/// <returns></returns>
/// <returns></returns>
public
bool
StringSet
(
string
key
,
string
value
,
TimeSpan
?
expiry
=
default
(
TimeSpan
?)
)
public
bool
StringSet
(
string
key
,
string
value
,
TimeSpan
?
expiry
=
default
)
{
{
key
=
AddSysCustomKey
(
key
);
key
=
AddSysCustomKey
(
key
);
return
Do
(
db
=>
db
.
StringSet
(
key
,
value
,
expiry
));
return
Do
(
db
=>
db
.
StringSet
(
key
,
value
,
expiry
));
...
@@ -106,7 +105,7 @@ namespace Edu.CacheManager.Base
...
@@ -106,7 +105,7 @@ namespace Edu.CacheManager.Base
/// <param name="obj"></param>
/// <param name="obj"></param>
/// <param name="expiry"></param>
/// <param name="expiry"></param>
/// <returns></returns>
/// <returns></returns>
public
bool
StringSet
<
T
>(
string
key
,
T
obj
,
TimeSpan
?
expiry
=
default
(
TimeSpan
?)
)
public
bool
StringSet
<
T
>(
string
key
,
T
obj
,
TimeSpan
?
expiry
=
default
)
{
{
key
=
AddSysCustomKey
(
key
);
key
=
AddSysCustomKey
(
key
);
string
json
=
ConvertJson
(
obj
);
string
json
=
ConvertJson
(
obj
);
...
@@ -182,7 +181,7 @@ namespace Edu.CacheManager.Base
...
@@ -182,7 +181,7 @@ namespace Edu.CacheManager.Base
/// <param name="value">保存的值</param>
/// <param name="value">保存的值</param>
/// <param name="expiry">过期时间</param>
/// <param name="expiry">过期时间</param>
/// <returns></returns>
/// <returns></returns>
public
async
Task
<
bool
>
StringSetAsync
(
string
key
,
string
value
,
TimeSpan
?
expiry
=
default
(
TimeSpan
?)
)
public
async
Task
<
bool
>
StringSetAsync
(
string
key
,
string
value
,
TimeSpan
?
expiry
=
default
)
{
{
key
=
AddSysCustomKey
(
key
);
key
=
AddSysCustomKey
(
key
);
return
await
Do
(
db
=>
db
.
StringSetAsync
(
key
,
value
,
expiry
));
return
await
Do
(
db
=>
db
.
StringSetAsync
(
key
,
value
,
expiry
));
...
@@ -208,7 +207,7 @@ namespace Edu.CacheManager.Base
...
@@ -208,7 +207,7 @@ namespace Edu.CacheManager.Base
/// <param name="obj"></param>
/// <param name="obj"></param>
/// <param name="expiry"></param>
/// <param name="expiry"></param>
/// <returns></returns>
/// <returns></returns>
public
async
Task
<
bool
>
StringSetAsync
<
T
>(
string
key
,
T
obj
,
TimeSpan
?
expiry
=
default
(
TimeSpan
?)
)
public
async
Task
<
bool
>
StringSetAsync
<
T
>(
string
key
,
T
obj
,
TimeSpan
?
expiry
=
default
)
{
{
key
=
AddSysCustomKey
(
key
);
key
=
AddSysCustomKey
(
key
);
string
json
=
ConvertJson
(
obj
);
string
json
=
ConvertJson
(
obj
);
...
@@ -859,7 +858,7 @@ namespace Edu.CacheManager.Base
...
@@ -859,7 +858,7 @@ namespace Edu.CacheManager.Base
/// <param name="key">redis key</param>
/// <param name="key">redis key</param>
/// <param name="expiry"></param>
/// <param name="expiry"></param>
/// <returns></returns>
/// <returns></returns>
public
bool
KeyExpire
(
string
key
,
TimeSpan
?
expiry
=
default
(
TimeSpan
?)
)
public
bool
KeyExpire
(
string
key
,
TimeSpan
?
expiry
=
default
)
{
{
key
=
AddSysCustomKey
(
key
);
key
=
AddSysCustomKey
(
key
);
return
Do
(
db
=>
db
.
KeyExpire
(
key
,
expiry
));
return
Do
(
db
=>
db
.
KeyExpire
(
key
,
expiry
));
...
@@ -918,7 +917,7 @@ namespace Edu.CacheManager.Base
...
@@ -918,7 +917,7 @@ namespace Edu.CacheManager.Base
/// <param name="key">redis key</param>
/// <param name="key">redis key</param>
/// <param name="expiry"></param>
/// <param name="expiry"></param>
/// <returns></returns>
/// <returns></returns>
public
async
Task
<
bool
>
KeyExpireAsync
(
string
key
,
TimeSpan
?
expiry
=
default
(
TimeSpan
?)
)
public
async
Task
<
bool
>
KeyExpireAsync
(
string
key
,
TimeSpan
?
expiry
=
default
)
{
{
key
=
AddSysCustomKey
(
key
);
key
=
AddSysCustomKey
(
key
);
return
await
Do
(
db
=>
db
.
KeyExpireAsync
(
key
,
expiry
));
return
await
Do
(
db
=>
db
.
KeyExpireAsync
(
key
,
expiry
));
...
@@ -1108,7 +1107,7 @@ namespace Edu.CacheManager.Base
...
@@ -1108,7 +1107,7 @@ namespace Edu.CacheManager.Base
private
T
ConvertObj
<
T
>(
RedisValue
value
)
private
T
ConvertObj
<
T
>(
RedisValue
value
)
{
{
if
(
value
.
IsNullOrEmpty
)
if
(
value
.
IsNullOrEmpty
)
return
default
(
T
)
;
return
default
;
return
JsonConvert
.
DeserializeObject
<
T
>(
value
);
return
JsonConvert
.
DeserializeObject
<
T
>(
value
);
}
}
...
...
Edu.Cache/User/UserReidsCache.cs
View file @
6cc95445
...
@@ -81,7 +81,7 @@ namespace Edu.Cache.User
...
@@ -81,7 +81,7 @@ namespace Edu.Cache.User
/// <summary>
/// <summary>
/// 账号仓储层对象
/// 账号仓储层对象
/// </summary>
/// </summary>
private
static
RB_AccountRepository
accountRepository
=
new
RB_AccountRepository
();
private
static
readonly
RB_AccountRepository
accountRepository
=
new
RB_AccountRepository
();
/// <summary>
/// <summary>
/// 获取用户登录信息
/// 获取用户登录信息
...
...
Edu.Common/API/RequestParm.cs
View file @
6cc95445
using
Edu.Common.Enum
;
namespace
Edu.Common.API
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
Edu.Common.API
{
{
/// <summary>
/// <summary>
/// API请求参数
/// API请求参数
...
...
Edu.Common/API/ResultCode.cs
View file @
6cc95445
using
System
;
namespace
Edu.Common.API
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
Edu.Common.API
{
{
/// <summary>
/// <summary>
/// Api返回结果枚举
/// Api返回结果枚举
...
...
Edu.Common/Enum/CacheTimeEnum.cs
View file @
6cc95445
namespace
Edu.Common.Enum
namespace
Edu.Common.Enum
{
{
/// <summary>
/// <summary>
/// 缓存时间(秒)
/// 缓存时间(秒)
...
...
Edu.Common/Enum/User/AccountStatusEnum.cs
View file @
6cc95445
using
Edu.Common.Plugin
;
using
Edu.Common.Plugin
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Edu.Common.Enum.User
namespace
Edu.Common.Enum.User
{
{
...
...
Edu.Common/Enum/User/AccountTypeEnum.cs
View file @
6cc95445
using
Edu.Common.Plugin
;
using
Edu.Common.Plugin
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Edu.Common.Enum.User
namespace
Edu.Common.Enum.User
{
{
...
...
Edu.Common/Plugin/CommonHelper.cs
View file @
6cc95445
...
@@ -201,7 +201,7 @@ namespace Edu.Common.Plugin
...
@@ -201,7 +201,7 @@ namespace Edu.Common.Plugin
/// <returns></returns>
/// <returns></returns>
public
static
T
Clone
<
T
>(
T
obj
)
public
static
T
Clone
<
T
>(
T
obj
)
{
{
T
ret
=
default
(
T
)
;
T
ret
=
default
;
if
(
obj
!=
null
)
if
(
obj
!=
null
)
{
{
XmlSerializer
cloner
=
new
XmlSerializer
(
typeof
(
T
));
XmlSerializer
cloner
=
new
XmlSerializer
(
typeof
(
T
));
...
...
Edu.Common/Plugin/ConvertHelper.cs
View file @
6cc95445
...
@@ -56,7 +56,7 @@ namespace Edu.Common
...
@@ -56,7 +56,7 @@ namespace Edu.Common
/// <returns></returns>
/// <returns></returns>
public
static
T
ConvertTo
<
T
>(
object
obj
)
public
static
T
ConvertTo
<
T
>(
object
obj
)
{
{
if
(
obj
==
null
)
return
default
(
T
)
;
//返回默认值
if
(
obj
==
null
)
return
default
;
//返回默认值
Type
tp
=
typeof
(
T
);
Type
tp
=
typeof
(
T
);
//泛型Nullable判断,取其中的类型
//泛型Nullable判断,取其中的类型
if
(
tp
.
IsGenericType
)
if
(
tp
.
IsGenericType
)
...
@@ -81,11 +81,11 @@ namespace Edu.Common
...
@@ -81,11 +81,11 @@ namespace Edu.Common
{
{
return
(
T
)
parameters
[
1
];
return
(
T
)
parameters
[
1
];
}
}
return
default
(
T
)
;
return
default
;
}
}
catch
catch
{
{
return
default
(
T
)
;
return
default
;
}
}
}
}
...
...
Edu.Common/Plugin/EnumHelper.cs
View file @
6cc95445
...
@@ -67,8 +67,6 @@ namespace Edu.Common.Plugin
...
@@ -67,8 +67,6 @@ namespace Edu.Common.Plugin
}
}
//获取字段信息
//获取字段信息
System
.
Reflection
.
FieldInfo
[]
ms
=
e
.
GetType
().
GetFields
();
System
.
Reflection
.
FieldInfo
[]
ms
=
e
.
GetType
().
GetFields
();
Type
t
=
e
.
GetType
();
foreach
(
System
.
Reflection
.
FieldInfo
f
in
ms
)
foreach
(
System
.
Reflection
.
FieldInfo
f
in
ms
)
{
{
//判断名称是否相等
//判断名称是否相等
...
@@ -136,7 +134,7 @@ namespace Edu.Common.Plugin
...
@@ -136,7 +134,7 @@ namespace Edu.Common.Plugin
{
{
if
(
string
.
IsNullOrEmpty
(
obj
))
if
(
string
.
IsNullOrEmpty
(
obj
))
{
{
return
default
(
T
)
;
return
default
;
}
}
try
try
{
{
...
@@ -144,7 +142,7 @@ namespace Edu.Common.Plugin
...
@@ -144,7 +142,7 @@ namespace Edu.Common.Plugin
}
}
catch
(
Exception
)
catch
(
Exception
)
{
{
return
default
(
T
)
;
return
default
;
}
}
}
}
}
}
...
...
Edu.Common/Plugin/FileHelper.cs
View file @
6cc95445
...
@@ -74,9 +74,8 @@ namespace Edu.Common.Plugin
...
@@ -74,9 +74,8 @@ namespace Edu.Common.Plugin
FileSystemInfo
[]
files
=
theFolder
.
GetFileSystemInfos
();
FileSystemInfo
[]
files
=
theFolder
.
GetFileSystemInfos
();
for
(
int
i
=
0
;
i
<
files
.
Length
;
i
++)
for
(
int
i
=
0
;
i
<
files
.
Length
;
i
++)
{
{
FileInfo
file
=
files
[
i
]
as
FileInfo
;
//是文件
//是文件
if
(
file
!=
null
)
if
(
file
s
[
i
]
is
FileInfo
file
)
{
{
file
.
Delete
();
file
.
Delete
();
}
}
...
@@ -112,9 +111,8 @@ namespace Edu.Common.Plugin
...
@@ -112,9 +111,8 @@ namespace Edu.Common.Plugin
FileSystemInfo
[]
files
=
theFolder
.
GetFileSystemInfos
();
FileSystemInfo
[]
files
=
theFolder
.
GetFileSystemInfos
();
for
(
int
i
=
0
;
i
<
files
.
Length
;
i
++)
for
(
int
i
=
0
;
i
<
files
.
Length
;
i
++)
{
{
FileInfo
file
=
files
[
i
]
as
FileInfo
;
//是文件
//是文件
if
(
file
!=
null
)
if
(
file
s
[
i
]
is
FileInfo
file
)
{
{
fileList
.
Add
(
Config
.
ViewFileSiteUrl
+
"/Feature/"
+
TCID
+
"/"
+
file
.
Name
);
fileList
.
Add
(
Config
.
ViewFileSiteUrl
+
"/Feature/"
+
TCID
+
"/"
+
file
.
Name
);
}
}
...
...
Edu.Common/Plugin/IPHelper.cs
View file @
6cc95445
...
@@ -41,7 +41,6 @@ namespace Edu.Common.Plugin
...
@@ -41,7 +41,6 @@ namespace Edu.Common.Plugin
/// <returns></returns>
/// <returns></returns>
private
static
bool
IsInnerIP
(
String
ipAddress
)
private
static
bool
IsInnerIP
(
String
ipAddress
)
{
{
bool
isInnerIp
=
false
;
long
ipNum
=
GetIpNum
(
ipAddress
);
long
ipNum
=
GetIpNum
(
ipAddress
);
/***** ***** ***** ***** ***** *****
/***** ***** ***** ***** ***** *****
私有IP:
私有IP:
...
@@ -56,7 +55,7 @@ namespace Edu.Common.Plugin
...
@@ -56,7 +55,7 @@ namespace Edu.Common.Plugin
long
bEnd
=
GetIpNum
(
"172.31.255.255"
);
long
bEnd
=
GetIpNum
(
"172.31.255.255"
);
long
cBegin
=
GetIpNum
(
"192.168.0.0"
);
long
cBegin
=
GetIpNum
(
"192.168.0.0"
);
long
cEnd
=
GetIpNum
(
"192.168.255.255"
);
long
cEnd
=
GetIpNum
(
"192.168.255.255"
);
isInnerIp
=
IsInner
(
ipNum
,
aBegin
,
aEnd
)
||
IsInner
(
ipNum
,
bBegin
,
bEnd
)
||
IsInner
(
ipNum
,
cBegin
,
cEnd
)
||
ipAddress
.
Equals
(
"127.0.0.1"
);
bool
isInnerIp
=
IsInner
(
ipNum
,
aBegin
,
aEnd
)
||
IsInner
(
ipNum
,
bBegin
,
bEnd
)
||
IsInner
(
ipNum
,
cBegin
,
cEnd
)
||
ipAddress
.
Equals
(
"127.0.0.1"
);
return
isInnerIp
;
return
isInnerIp
;
}
}
...
...
Edu.Common/Plugin/LogHelper.cs
View file @
6cc95445
...
@@ -10,12 +10,12 @@ namespace Edu.Common.Plugin
...
@@ -10,12 +10,12 @@ namespace Edu.Common.Plugin
/// </summary>
/// </summary>
public
class
LogHelper
public
class
LogHelper
{
{
private
static
string
logDir
=
Config
.
LogPath
;
private
static
readonly
string
logDir
=
Config
.
LogPath
;
private
static
string
infoLogDir
=
Config
.
InofLogPath
;
private
static
readonly
string
infoLogDir
=
Config
.
InofLogPath
;
private
static
string
requestLogDir
=
Config
.
RequestLogPath
;
private
static
readonly
string
requestLogDir
=
Config
.
RequestLogPath
;
private
static
object
objError
=
new
object
();
private
static
readonly
object
objError
=
new
object
();
private
static
object
objInfo
=
new
object
();
private
static
readonly
object
objInfo
=
new
object
();
private
static
object
objRequest
=
new
object
();
private
static
readonly
object
objRequest
=
new
object
();
/// <summary>
/// <summary>
/// 构造函数
/// 构造函数
...
...
Edu.Common/Plugin/NPOIHelper.cs
View file @
6cc95445
using
NPOI.HPSF
;
using
NPOI.HSSF.UserModel
;
using
NPOI.HSSF.UserModel
;
using
NPOI.HSSF.Util
;
using
NPOI.SS.Formula.Eval
;
using
NPOI.SS.Formula.Eval
;
using
NPOI.SS.UserModel
;
using
NPOI.SS.UserModel
;
using
NPOI.SS.Util
;
using
NPOI.SS.Util
;
using
NPOI.XSSF.UserModel
;
using
NPOI.XSSF.UserModel
;
using
NPOI.XWPF.UserModel
;
using
System
;
using
System
;
using
System.Collections
;
using
System.Collections.Generic
;
using
System.Data
;
using
System.Data
;
using
System.Drawing
;
using
System.IO
;
using
System.IO
;
using
System.Linq
;
using
System.Reflection
;
using
System.Text
;
using
System.Text
;
using
System.Text.RegularExpressions
;
using
System.Text.RegularExpressions
;
using
System.Threading.Tasks
;
using
System.Web
;
namespace
Edu.Common.Plugin
namespace
Edu.Common.Plugin
{
{
...
...
Edu.Common/Plugin/NetFileHelper.cs
View file @
6cc95445
...
@@ -83,13 +83,15 @@ namespace Edu.Common.Plugin
...
@@ -83,13 +83,15 @@ namespace Edu.Common.Plugin
/// <returns></returns>
/// <returns></returns>
public
static
uint
WNetAddConnection
(
string
username
,
string
password
,
string
remoteName
,
string
localName
)
public
static
uint
WNetAddConnection
(
string
username
,
string
password
,
string
remoteName
,
string
localName
)
{
{
NetResource
netResource
=
new
NetResource
();
NetResource
netResource
=
new
NetResource
netResource
.
dwScope
=
2
;
{
netResource
.
dwType
=
1
;
dwScope
=
2
,
netResource
.
dwDisplayType
=
3
;
dwType
=
1
,
netResource
.
dwUsage
=
1
;
dwDisplayType
=
3
,
netResource
.
lpLocalName
=
localName
;
dwUsage
=
1
,
netResource
.
lpRemoteName
=
remoteName
.
TrimEnd
(
'\\'
);
lpLocalName
=
localName
,
lpRemoteName
=
remoteName
.
TrimEnd
(
'\\'
)
};
uint
result
=
WNetAddConnection2
(
netResource
,
password
,
username
,
0
);
uint
result
=
WNetAddConnection2
(
netResource
,
password
,
username
,
0
);
return
result
;
return
result
;
}
}
...
...
Edu.Common/Plugin/RSAHelper.cs
View file @
6cc95445
...
@@ -14,12 +14,11 @@ namespace Edu.Common.Plugin
...
@@ -14,12 +14,11 @@ namespace Edu.Common.Plugin
public
class
RSAHelper
public
class
RSAHelper
{
{
//Erp公钥
//Erp公钥
static
string
TargetPublicKey
=
@"<RSAKeyValue><Modulus>qr3Hipzvvn9dsFn1juGEM5vHiYl4whHnJ7DFqC4ZVAotL0bRCZd7vWvPl53AJY9p8u2hNgPP3J6/I5NairyCiizW++8kCPue1Lpq9qc9ueBwij1bo5Sqi1nswpJsKyd9kOD5aOzqrnuhKTLYMZN9fkHl3L4wjpuVz1xlTgpYdxc=</Modulus><Exponent>AQAB</Exponent></RSAKeyValue>"
;
static
readonly
string
TargetPublicKey
=
@"<RSAKeyValue><Modulus>qr3Hipzvvn9dsFn1juGEM5vHiYl4whHnJ7DFqC4ZVAotL0bRCZd7vWvPl53AJY9p8u2hNgPP3J6/I5NairyCiizW++8kCPue1Lpq9qc9ueBwij1bo5Sqi1nswpJsKyd9kOD5aOzqrnuhKTLYMZN9fkHl3L4wjpuVz1xlTgpYdxc=</Modulus><Exponent>AQAB</Exponent></RSAKeyValue>"
;
//小程序私钥
//小程序私钥
//static string PublicKey = @"<RSAKeyValue><Modulus>4W8WliHbSkVE20kIze0KvCIOJgwG4PSRHHb6LNjc3smttrU952pGFi7g7dly1tj+oNUpCB5Ba5a1EUQI9vlfCXUYRICdiNneW6T78BFED5x8HZp8JUCMeatD8wFrKPVV4twaj2QtqGsTw60ZVmVFzHi/eNLVBYvfnzKCGCp0dG8=</Modulus><Exponent>AQAB</Exponent></RSAKeyValue>";
//static string PublicKey = @"<RSAKeyValue><Modulus>4W8WliHbSkVE20kIze0KvCIOJgwG4PSRHHb6LNjc3smttrU952pGFi7g7dly1tj+oNUpCB5Ba5a1EUQI9vlfCXUYRICdiNneW6T78BFED5x8HZp8JUCMeatD8wFrKPVV4twaj2QtqGsTw60ZVmVFzHi/eNLVBYvfnzKCGCp0dG8=</Modulus><Exponent>AQAB</Exponent></RSAKeyValue>";
static
string
PrivateKey
=
@"<RSAKeyValue><Modulus>4W8WliHbSkVE20kIze0KvCIOJgwG4PSRHHb6LNjc3smttrU952pGFi7g7dly1tj+oNUpCB5Ba5a1EUQI9vlfCXUYRICdiNneW6T78BFED5x8HZp8JUCMeatD8wFrKPVV4twaj2QtqGsTw60ZVmVFzHi/eNLVBYvfnzKCGCp0dG8=</Modulus><Exponent>AQAB</Exponent><P>97qvHs/ptDJiw+FGvqvNLOJX1TJPbed9sfNNEhAZe+x/XPQfnzu0IxEkIxH/BL29gVryWExH8b/ZcgQuXCpUsw==</P><Q>6PXZPVntcKdo4ZlbQAU/+VI47rAZGkNtW/w25UVGrVC31Zc3GSqCVlKZgccRe6/PLrjOUBKDRYiYd3Yj+azXVQ==</Q><DP>ciyzW3Md1jRGutrQHT7XUHF9Y8BNRW0kzGhDRCjxZeEpDjFhhaUhr+vNiPBZZdkBR2YgPbviiLQQRvFQYKAN6w==</DP><DQ>AgBSrG9AVe5qPT3nBcbFxOuK56oFnS8lGlwxUIjm0YhW+/O/mmy+D+XHwdCm+swI2Jrn0tJF5GwG+0e9iWCNvQ==</DQ><InverseQ>WsKgSM0RiMFpXGoyL8bqZi2q1MAB+iz4WXPcL/OmHKluo8wuK/Pk+zOKkyjMO91tKXhjLOd7xpVb1AIsk/fAeQ==</InverseQ><D>daiCNFd1WZ0vo/fJZZkLWke39LmgOXbL6fxa9F83X/wI82xC4+4+qENNWDZ+zo2w0AaRBNCtulaNKHbG6wgaRh15yuOHkr90oydquHHPUqCjFWnIEYx2NnX85HtyBTwowCeePajCTsEi6vMRgKlBCIFWxqc6z5To1lTgfqtKb8k=</D></RSAKeyValue>"
;
static
readonly
string
PrivateKey
=
@"<RSAKeyValue><Modulus>4W8WliHbSkVE20kIze0KvCIOJgwG4PSRHHb6LNjc3smttrU952pGFi7g7dly1tj+oNUpCB5Ba5a1EUQI9vlfCXUYRICdiNneW6T78BFED5x8HZp8JUCMeatD8wFrKPVV4twaj2QtqGsTw60ZVmVFzHi/eNLVBYvfnzKCGCp0dG8=</Modulus><Exponent>AQAB</Exponent><P>97qvHs/ptDJiw+FGvqvNLOJX1TJPbed9sfNNEhAZe+x/XPQfnzu0IxEkIxH/BL29gVryWExH8b/ZcgQuXCpUsw==</P><Q>6PXZPVntcKdo4ZlbQAU/+VI47rAZGkNtW/w25UVGrVC31Zc3GSqCVlKZgccRe6/PLrjOUBKDRYiYd3Yj+azXVQ==</Q><DP>ciyzW3Md1jRGutrQHT7XUHF9Y8BNRW0kzGhDRCjxZeEpDjFhhaUhr+vNiPBZZdkBR2YgPbviiLQQRvFQYKAN6w==</DP><DQ>AgBSrG9AVe5qPT3nBcbFxOuK56oFnS8lGlwxUIjm0YhW+/O/mmy+D+XHwdCm+swI2Jrn0tJF5GwG+0e9iWCNvQ==</DQ><InverseQ>WsKgSM0RiMFpXGoyL8bqZi2q1MAB+iz4WXPcL/OmHKluo8wuK/Pk+zOKkyjMO91tKXhjLOd7xpVb1AIsk/fAeQ==</InverseQ><D>daiCNFd1WZ0vo/fJZZkLWke39LmgOXbL6fxa9F83X/wI82xC4+4+qENNWDZ+zo2w0AaRBNCtulaNKHbG6wgaRh15yuOHkr90oydquHHPUqCjFWnIEYx2NnX85HtyBTwowCeePajCTsEi6vMRgKlBCIFWxqc6z5To1lTgfqtKb8k=</D></RSAKeyValue>"
;
static
RSACryptoServiceProvider
rsaProvider
=
new
RSACryptoServiceProvider
(
1024
);
/// <summary>
/// <summary>
/// 加密
/// 加密
/// </summary>
/// </summary>
...
@@ -27,9 +26,7 @@ namespace Edu.Common.Plugin
...
@@ -27,9 +26,7 @@ namespace Edu.Common.Plugin
/// <returns></returns>
/// <returns></returns>
public
static
byte
[]
EncryptData
(
byte
[]
data
)
public
static
byte
[]
EncryptData
(
byte
[]
data
)
{
{
RSACryptoServiceProvider
rsa
=
new
RSACryptoServiceProvider
();
RSACryptoServiceProvider
rsa
=
new
RSACryptoServiceProvider
();
//将公钥导入到RSA对象中,准备加密;
//将公钥导入到RSA对象中,准备加密;
rsa
.
FromXmlString
(
TargetPublicKey
);
rsa
.
FromXmlString
(
TargetPublicKey
);
...
@@ -46,16 +43,11 @@ namespace Edu.Common.Plugin
...
@@ -46,16 +43,11 @@ namespace Edu.Common.Plugin
/// <returns></returns>
/// <returns></returns>
public
static
byte
[]
DecryptData
(
byte
[]
data
)
public
static
byte
[]
DecryptData
(
byte
[]
data
)
{
{
RSACryptoServiceProvider
rsa
=
new
RSACryptoServiceProvider
(
1024
);
RSACryptoServiceProvider
rsa
=
new
RSACryptoServiceProvider
(
1024
);
//将私钥导入RSA中,准备解密;
//将私钥导入RSA中,准备解密;
rsa
.
FromXmlString
(
PrivateKey
);
rsa
.
FromXmlString
(
PrivateKey
);
//对数据进行解密,并返回解密结果;
//对数据进行解密,并返回解密结果;
return
rsa
.
Decrypt
(
data
,
false
);
return
rsa
.
Decrypt
(
data
,
false
);
}
}
}
}
}
}
Edu.Common/Plugin/SecurityHelper.cs
View file @
6cc95445
...
@@ -84,22 +84,12 @@ namespace Edu.Common.Plugin
...
@@ -84,22 +84,12 @@ namespace Edu.Common.Plugin
/// 获取大写的MD5签名结果
/// 获取大写的MD5签名结果
/// </summary>
/// </summary>
/// <param name="encypStr"></param>
/// <param name="encypStr"></param>
/// <param name="charset">默认值:utf-8</param>
/// <returns></returns>
/// <returns></returns>
public
static
string
MD5EncryptWeChat
(
string
encypStr
,
string
charset
=
""
)
public
static
string
MD5EncryptWeChat
(
string
encypStr
)
{
{
var
m5
=
new
MD5CryptoServiceProvider
();
var
m5
=
new
MD5CryptoServiceProvider
();
//创建md5对象
byte
[]
inputBye
;
byte
[]
inputBye
;
//使用GB2312编码方式把字符串转化为字节数组.
//if (!string.IsNullOrWhiteSpace(charset))
//{
// inputBye = Encoding.GetEncoding(charset).GetBytes(encypStr);
//}
//else
//{
inputBye
=
Encoding
.
GetEncoding
(
"utf-8"
).
GetBytes
(
encypStr
);
inputBye
=
Encoding
.
GetEncoding
(
"utf-8"
).
GetBytes
(
encypStr
);
// }
var
outputBye
=
m5
.
ComputeHash
(
inputBye
);
var
outputBye
=
m5
.
ComputeHash
(
inputBye
);
var
retStr
=
BitConverter
.
ToString
(
outputBye
);
var
retStr
=
BitConverter
.
ToString
(
outputBye
);
retStr
=
retStr
.
Replace
(
"-"
,
""
).
ToUpper
();
retStr
=
retStr
.
Replace
(
"-"
,
""
).
ToUpper
();
...
@@ -119,21 +109,21 @@ namespace Edu.Common.Plugin
...
@@ -119,21 +109,21 @@ namespace Edu.Common.Plugin
string
keyString
=
desKeyStr
.
Substring
(
0
,
8
);
string
keyString
=
desKeyStr
.
Substring
(
0
,
8
);
byte
[]
btKey
=
Encoding
.
UTF8
.
GetBytes
(
keyString
);
byte
[]
btKey
=
Encoding
.
UTF8
.
GetBytes
(
keyString
);
byte
[]
btIv
=
Encoding
.
UTF8
.
GetBytes
(
"12345678"
);
byte
[]
btIv
=
Encoding
.
UTF8
.
GetBytes
(
"12345678"
);
var
des
=
new
DESCryptoServiceProvider
();
var
des
=
new
DESCryptoServiceProvider
des
.
Mode
=
CipherMode
.
CBC
;
//这里指定加密模式为CBC
des
.
Padding
=
PaddingMode
.
PKCS7
;
des
.
Key
=
btKey
;
des
.
IV
=
btIv
;
using
(
var
ms
=
new
MemoryStream
())
{
{
byte
[]
inData
=
Convert
.
FromBase64String
(
encryptedString
);
Mode
=
CipherMode
.
CBC
,
//这里指定加密模式为CBC
using
(
var
cs
=
new
CryptoStream
(
ms
,
des
.
CreateDecryptor
(),
CryptoStreamMode
.
Write
))
Padding
=
PaddingMode
.
PKCS7
,
{
Key
=
btKey
,
cs
.
Write
(
inData
,
0
,
inData
.
Length
);
IV
=
btIv
cs
.
FlushFinalBlock
();
};
}
using
var
ms
=
new
MemoryStream
();
return
Encoding
.
UTF8
.
GetString
(
ms
.
ToArray
());
byte
[]
inData
=
Convert
.
FromBase64String
(
encryptedString
);
using
(
var
cs
=
new
CryptoStream
(
ms
,
des
.
CreateDecryptor
(),
CryptoStreamMode
.
Write
))
{
cs
.
Write
(
inData
,
0
,
inData
.
Length
);
cs
.
FlushFinalBlock
();
}
}
return
Encoding
.
UTF8
.
GetString
(
ms
.
ToArray
());
}
}
/// <summary>
/// <summary>
...
@@ -147,16 +137,14 @@ namespace Edu.Common.Plugin
...
@@ -147,16 +137,14 @@ namespace Edu.Common.Plugin
byte
[]
btIv
=
Encoding
.
UTF8
.
GetBytes
(
"12345678"
);
byte
[]
btIv
=
Encoding
.
UTF8
.
GetBytes
(
"12345678"
);
byte
[]
btKey
=
Encoding
.
UTF8
.
GetBytes
(
keyString
);
byte
[]
btKey
=
Encoding
.
UTF8
.
GetBytes
(
keyString
);
DESCryptoServiceProvider
des
=
new
DESCryptoServiceProvider
();
DESCryptoServiceProvider
des
=
new
DESCryptoServiceProvider
();
using
(
MemoryStream
ms
=
new
MemoryStream
())
using
MemoryStream
ms
=
new
MemoryStream
();
byte
[]
inData
=
Encoding
.
UTF8
.
GetBytes
(
sourceString
);
using
(
CryptoStream
cs
=
new
CryptoStream
(
ms
,
des
.
CreateEncryptor
(
btKey
,
btIv
),
CryptoStreamMode
.
Write
))
{
{
byte
[]
inData
=
Encoding
.
UTF8
.
GetBytes
(
sourceString
);
cs
.
Write
(
inData
,
0
,
inData
.
Length
);
using
(
CryptoStream
cs
=
new
CryptoStream
(
ms
,
des
.
CreateEncryptor
(
btKey
,
btIv
),
CryptoStreamMode
.
Write
))
cs
.
FlushFinalBlock
();
{
cs
.
Write
(
inData
,
0
,
inData
.
Length
);
cs
.
FlushFinalBlock
();
}
return
Convert
.
ToBase64String
(
ms
.
ToArray
());
}
}
return
Convert
.
ToBase64String
(
ms
.
ToArray
());
}
}
#
endregion
#
endregion
}
}
...
...
Edu.Common/Plugin/StopwatchHelper.cs
View file @
6cc95445
using
System
;
using
System.Diagnostics
;
using
System.Collections.Generic
;
using
System.Diagnostics
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
Edu.Common.Plugin
namespace
Edu.Common.Plugin
{
{
...
...
Edu.Common/Plugin/StringHelper.cs
View file @
6cc95445
...
@@ -206,25 +206,6 @@ namespace Edu.Common.Plugin
...
@@ -206,25 +206,6 @@ namespace Edu.Common.Plugin
return
new
DateTime
(
year
,
month
,
1
).
AddMonths
(
1
).
AddDays
(-
1
);
return
new
DateTime
(
year
,
month
,
1
).
AddMonths
(
1
).
AddDays
(-
1
);
}
}
/// <summary>
/// 是否为日期+时间型字符串
/// </summary>
/// <param name="StrSource"></param>
/// <returns></returns>
public
static
bool
IsDateTime
(
object
StrSource
)
{
DateTime
dt
=
DateTime
.
Now
;
if
(
DateTime
.
TryParse
(
StrSource
.
ToString
(),
out
dt
))
{
return
true
;
}
else
{
return
false
;
}
}
/// <summary>
/// <summary>
/// 时间
/// 时间
/// </summary>
/// </summary>
...
@@ -686,17 +667,6 @@ namespace Edu.Common.Plugin
...
@@ -686,17 +667,6 @@ namespace Edu.Common.Plugin
return
Encoding
.
Default
.
GetString
(
Byt
);
return
Encoding
.
Default
.
GetString
(
Byt
);
}
}
/// <summary>
/// 截取指定长度HTML内容 (该方法未完成)
/// </summary>
/// <param name="html"></param>
/// <param name="len"></param>
/// <returns></returns>
public
static
string
SubstringHTML
(
string
html
,
int
len
)
{
return
""
;
}
/// <summary>
/// <summary>
/// 截取指定长度字符
/// 截取指定长度字符
/// </summary>
/// </summary>
...
@@ -1284,12 +1254,12 @@ namespace Edu.Common.Plugin
...
@@ -1284,12 +1254,12 @@ namespace Edu.Common.Plugin
string
value
=
null
;
string
value
=
null
;
if
(
index
>=
0
)
if
(
index
>=
0
)
{
{
key
=
queryString
.
Substring
(
startIndex
,
index
-
startIndex
)
;
key
=
queryString
[
startIndex
..
index
]
;
value
=
queryString
.
Substring
(
index
+
1
,
(
i
-
index
)
-
1
);
value
=
queryString
.
Substring
(
index
+
1
,
(
i
-
index
)
-
1
);
}
}
else
else
{
{
key
=
queryString
.
Substring
(
startIndex
,
i
-
startIndex
)
;
key
=
queryString
[
startIndex
..
i
]
;
}
}
if
(
isEncoded
)
if
(
isEncoded
)
{
{
...
@@ -1468,7 +1438,7 @@ namespace Edu.Common.Plugin
...
@@ -1468,7 +1438,7 @@ namespace Edu.Common.Plugin
/// <returns></returns>
/// <returns></returns>
public
static
string
GetStarString
(
string
Input
)
public
static
string
GetStarString
(
string
Input
)
{
{
string
Output
=
""
;
string
Output
;
switch
(
Input
.
Length
)
switch
(
Input
.
Length
)
{
{
case
1
:
case
1
:
...
...
Edu.Common/Plugin/ValidateHepler.cs
View file @
6cc95445
...
@@ -140,8 +140,8 @@ namespace Edu.Common.Plugin
...
@@ -140,8 +140,8 @@ namespace Edu.Common.Plugin
/// </summary>
/// </summary>
public
class
IntRangeValidateAttribute
:
AbstractValidateAttribute
public
class
IntRangeValidateAttribute
:
AbstractValidateAttribute
{
{
private
int
_min
=
0
;
private
readonly
int
_min
=
0
;
private
int
_max
=
0
;
private
readonly
int
_max
=
0
;
/// <summary>
/// <summary>
/// 构造函数
/// 构造函数
...
@@ -222,8 +222,8 @@ namespace Edu.Common.Plugin
...
@@ -222,8 +222,8 @@ namespace Edu.Common.Plugin
/// </summary>
/// </summary>
public
class
StringRangeValidateAttribute
:
AbstractValidateAttribute
public
class
StringRangeValidateAttribute
:
AbstractValidateAttribute
{
{
private
int
_min
=
0
;
private
readonly
int
_min
=
0
;
private
int
_max
=
0
;
private
readonly
int
_max
=
0
;
/// <summary>
/// <summary>
/// 构造函数
/// 构造函数
...
@@ -380,7 +380,7 @@ namespace Edu.Common.Plugin
...
@@ -380,7 +380,7 @@ namespace Edu.Common.Plugin
/// </summary>
/// </summary>
public
class
RegularValidateAttribute
:
AbstractValidateAttribute
public
class
RegularValidateAttribute
:
AbstractValidateAttribute
{
{
private
string
pattern
=
""
;
private
readonly
string
pattern
=
""
;
/// <summary>
/// <summary>
///
///
/// </summary>
/// </summary>
...
...
Edu.Common/Plugin/WeiXinHelper.cs
View file @
6cc95445
...
@@ -10,7 +10,7 @@ namespace Edu.Common.Plugin
...
@@ -10,7 +10,7 @@ namespace Edu.Common.Plugin
{
{
public
class
WeiXinHelper
public
class
WeiXinHelper
{
{
static
List
<
WeChatMiniAppMessage
>
weChatMiniAppMessages
=
new
List
<
WeChatMiniAppMessage
>();
static
readonly
List
<
WeChatMiniAppMessage
>
weChatMiniAppMessages
=
new
List
<
WeChatMiniAppMessage
>();
static
WeiXinHelper
()
static
WeiXinHelper
()
{
{
...
@@ -163,14 +163,10 @@ namespace Edu.Common.Plugin
...
@@ -163,14 +163,10 @@ namespace Edu.Common.Plugin
try
try
{
{
System
.
Net
.
WebRequest
wReq
=
System
.
Net
.
WebRequest
.
Create
(
Url
);
System
.
Net
.
WebRequest
wReq
=
System
.
Net
.
WebRequest
.
Create
(
Url
);
// Get the response instance.
System
.
Net
.
WebResponse
wResp
=
wReq
.
GetResponse
();
System
.
Net
.
WebResponse
wResp
=
wReq
.
GetResponse
();
System
.
IO
.
Stream
respStream
=
wResp
.
GetResponseStream
();
System
.
IO
.
Stream
respStream
=
wResp
.
GetResponseStream
();
// Dim reader As StreamReader = New StreamReader(respStream)
using
System.IO.StreamReader
reader
=
new
System
.
IO
.
StreamReader
(
respStream
,
Encoding
.
GetEncoding
(
type
));
using
(
System
.
IO
.
StreamReader
reader
=
new
System
.
IO
.
StreamReader
(
respStream
,
Encoding
.
GetEncoding
(
type
)))
return
reader
.
ReadToEnd
();
{
return
reader
.
ReadToEnd
();
}
}
}
catch
(
System
.
Exception
ex
)
catch
(
System
.
Exception
ex
)
{
{
...
@@ -183,27 +179,27 @@ namespace Edu.Common.Plugin
...
@@ -183,27 +179,27 @@ namespace Edu.Common.Plugin
/// <summary>
/// <summary>
/// 微信小程序验证返回结果
/// 微信小程序验证返回结果
/// </summary>
/// </summary>
public
class
r
esult
public
class
R
esult
{
{
/// <summary>
/// <summary>
/// openid
/// openid
/// </summary>
/// </summary>
public
string
o
penid
{
get
;
set
;
}
public
string
O
penid
{
get
;
set
;
}
/// <summary>
/// <summary>
/// session_key
/// session_key
/// </summary>
/// </summary>
public
string
s
ession_key
{
get
;
set
;
}
public
string
S
ession_key
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 错误状态码
/// 错误状态码
/// </summary>
/// </summary>
public
string
e
rrcode
{
get
;
set
;
}
public
string
E
rrcode
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 错误提示信息
/// 错误提示信息
/// </summary>
/// </summary>
public
string
e
rrmsg
{
get
;
set
;
}
public
string
E
rrmsg
{
get
;
set
;
}
}
}
#
endregion
#
endregion
...
@@ -217,7 +213,7 @@ namespace Edu.Common.Plugin
...
@@ -217,7 +213,7 @@ namespace Edu.Common.Plugin
}
}
//采用排序的Dictionary的好处是方便对数据包进行签名,不用再签名之前再做一次排序
//采用排序的Dictionary的好处是方便对数据包进行签名,不用再签名之前再做一次排序
private
SortedDictionary
<
string
,
object
>
m_values
=
new
SortedDictionary
<
string
,
object
>();
private
readonly
SortedDictionary
<
string
,
object
>
m_values
=
new
SortedDictionary
<
string
,
object
>();
/**
/**
* 设置某个字段的值
* 设置某个字段的值
...
@@ -236,8 +232,7 @@ namespace Edu.Common.Plugin
...
@@ -236,8 +232,7 @@ namespace Edu.Common.Plugin
*/
*/
public
object
GetValue
(
string
key
)
public
object
GetValue
(
string
key
)
{
{
object
o
=
null
;
m_values
.
TryGetValue
(
key
,
out
object
o
);
m_values
.
TryGetValue
(
key
,
out
o
);
return
o
;
return
o
;
}
}
...
@@ -248,8 +243,7 @@ namespace Edu.Common.Plugin
...
@@ -248,8 +243,7 @@ namespace Edu.Common.Plugin
*/
*/
public
bool
IsSet
(
string
key
)
public
bool
IsSet
(
string
key
)
{
{
object
o
=
null
;
m_values
.
TryGetValue
(
key
,
out
object
o
);
m_values
.
TryGetValue
(
key
,
out
o
);
if
(
null
!=
o
)
if
(
null
!=
o
)
return
true
;
return
true
;
else
else
...
...
Edu.Common/Plugin/WordTemplateHelper.cs
View file @
6cc95445
...
@@ -43,7 +43,6 @@ namespace Edu.Common.Plugin
...
@@ -43,7 +43,6 @@ namespace Edu.Common.Plugin
table
.
Width
=
600
*
9
;
table
.
Width
=
600
*
9
;
var
rootRow
=
table
.
GetRow
(
0
);
var
rootRow
=
table
.
GetRow
(
0
);
var
secondRow
=
table
.
GetRow
(
1
);
table
.
SetColumnWidth
(
0
,
150
);
/* 设置列宽 */
table
.
SetColumnWidth
(
0
,
150
);
/* 设置列宽 */
table
.
SetColumnWidth
(
1
,
250
);
table
.
SetColumnWidth
(
1
,
250
);
...
@@ -140,7 +139,7 @@ namespace Edu.Common.Plugin
...
@@ -140,7 +139,7 @@ namespace Edu.Common.Plugin
rpr
.
AddNewSzCs
().
val
=
(
ulong
)
21
;
rpr
.
AddNewSzCs
().
val
=
(
ulong
)
21
;
table
.
Width
=
950
*
5
;
table
.
Width
=
950
*
5
;
var
rootRow
=
table
.
GetRow
(
0
);
table
.
SetColumnWidth
(
0
,
100
);
/* 设置列宽 */
table
.
SetColumnWidth
(
0
,
100
);
/* 设置列宽 */
table
.
SetColumnWidth
(
1
,
200
);
table
.
SetColumnWidth
(
1
,
200
);
...
@@ -222,11 +221,9 @@ namespace Edu.Common.Plugin
...
@@ -222,11 +221,9 @@ namespace Edu.Common.Plugin
XWPFDocument
doc
=
null
;
XWPFDocument
doc
=
null
;
if
(
isTemplate
&&
!
string
.
IsNullOrEmpty
(
templatePath
.
Trim
()))
if
(
isTemplate
&&
!
string
.
IsNullOrEmpty
(
templatePath
.
Trim
()))
{
{
using
(
FileStream
file
=
new
FileStream
(
templatePath
,
FileMode
.
Open
,
FileAccess
.
Read
))
using
FileStream
file
=
new
FileStream
(
templatePath
,
FileMode
.
Open
,
FileAccess
.
Read
);
{
//将文件流中模板加载到工作簿对象中
//将文件流中模板加载到工作簿对象中
doc
=
new
XWPFDocument
(
file
);
doc
=
new
XWPFDocument
(
file
);
}
}
}
else
else
{
{
...
@@ -242,13 +239,11 @@ namespace Edu.Common.Plugin
...
@@ -242,13 +239,11 @@ namespace Edu.Common.Plugin
/// <returns></returns>
/// <returns></returns>
private
static
byte
[]
GetStream
(
XWPFDocument
doc
)
private
static
byte
[]
GetStream
(
XWPFDocument
doc
)
{
{
using
(
MemoryStream
ms
=
new
MemoryStream
())
using
MemoryStream
ms
=
new
MemoryStream
();
{
doc
.
Write
(
ms
);
doc
.
Write
(
ms
);
ms
.
Flush
();
ms
.
Flush
();
ms
.
Position
=
0
;
ms
.
Position
=
0
;
return
ms
.
ToArray
();
return
ms
.
ToArray
();
}
}
}
}
}
...
...
Edu.Model/CacheModel/UserInfo.cs
View file @
6cc95445
using
Edu.Model.ViewModel.System
;
using
Edu.Model.ViewModel.System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Edu.Model.CacheModel
namespace
Edu.Model.CacheModel
{
{
...
@@ -60,4 +58,4 @@ namespace Edu.Model.CacheModel
...
@@ -60,4 +58,4 @@ namespace Edu.Model.CacheModel
/// </summary>
/// </summary>
public
string
UserIcon
{
get
;
set
;
}
public
string
UserIcon
{
get
;
set
;
}
}
}
}
}
\ No newline at end of file
Edu.Model/Entity/Course/RB_Course_Category.cs
View file @
6cc95445
using
Edu.Common.Enum
;
using
Edu.Common.Enum
;
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
VT.FW.DB
;
using
VT.FW.DB
;
namespace
Edu.Model.Entity.Course
namespace
Edu.Model.Entity.Course
...
@@ -68,4 +66,4 @@ namespace Edu.Model.Entity.Course
...
@@ -68,4 +66,4 @@ namespace Edu.Model.Entity.Course
/// </summary>
/// </summary>
public
int
School_Id
{
get
;
set
;
}
public
int
School_Id
{
get
;
set
;
}
}
}
}
}
\ No newline at end of file
Edu.Model/Entity/User/RB_Account.cs
View file @
6cc95445
using
Edu.Common.Enum
;
using
Edu.Common.Enum
;
using
Edu.Common.Enum.User
;
using
Edu.Common.Enum.User
;
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
VT.FW.DB
;
using
VT.FW.DB
;
namespace
Edu.Model.Entity.User
namespace
Edu.Model.Entity.User
...
...
Edu.Model/Entity/User/RB_Group.cs
View file @
6cc95445
using
Edu.Common.Enum
;
using
Edu.Common.Enum
;
using
Edu.Common.Plugin
;
using
Newtonsoft.Json
;
using
System
;
using
System
;
using
VT.FW.DB
;
using
VT.FW.DB
;
...
...
Edu.Model/Entity/User/RB_Manager.cs
View file @
6cc95445
using
Edu.Common.Enum
;
using
Edu.Common.Enum
;
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
VT.FW.DB
;
using
VT.FW.DB
;
namespace
Edu.Model.Entity.User
namespace
Edu.Model.Entity.User
...
...
Edu.Model/ViewModel/Course/CourseCategoryTree_ViewModel.cs
0 → 100644
View file @
6cc95445
using
System.Collections.Generic
;
namespace
Edu.Model.ViewModel.Course
{
/// <summary>
/// 课程分类树形结构实体类
/// </summary>
public
class
CourseCategoryTree_ViewModel
{
/// <summary>
/// 主键(课程分类编号)
/// </summary>
public
int
CateId
{
get
;
set
;
}
/// <summary>
/// 父级编号
/// </summary>
public
int
ParentId
{
get
;
set
;
}
/// <summary>
/// 课程分类名称
/// </summary>
public
string
CateName
{
get
;
set
;
}
/// <summary>
/// 分类下级列表
/// </summary>
public
List
<
CourseCategoryTree_ViewModel
>
ChildList
{
get
;
set
;
}
}
}
\ No newline at end of file
Edu.Model/ViewModel/Course/RB_Course_Category_ViewModel.cs
View file @
6cc95445
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
VT.FW.DB
;
using
VT.FW.DB
;
namespace
Edu.Model.ViewModel.Course
namespace
Edu.Model.ViewModel.Course
...
...
Edu.Model/ViewModel/System/AreaTree_ViewModel.cs
View file @
6cc95445
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Edu.Model.ViewModel.System
namespace
Edu.Model.ViewModel.System
{
{
...
...
Edu.Model/ViewModel/System/MenuTree_ViewModel.cs
View file @
6cc95445
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Edu.Model.ViewModel.System
namespace
Edu.Model.ViewModel.System
{
{
...
...
Edu.Model/ViewModel/System/RB_Destination_ViewModel.cs
View file @
6cc95445
using
System
;
namespace
Edu.Model.ViewModel.System
using
System.Collections.Generic
;
using
System.Text
;
namespace
Edu.Model.ViewModel.System
{
{
/// <summary>
/// <summary>
/// 地区视图实体类
/// 地区视图实体类
...
@@ -15,8 +11,8 @@ namespace Edu.Model.ViewModel.System
...
@@ -15,8 +11,8 @@ namespace Edu.Model.ViewModel.System
public
string
NameStr
{
get
;
set
;
}
public
string
NameStr
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 多个编号【逗号分割】
/// 多个编号【逗号分割】
/// </summary>
/// </summary>
public
string
Ids
{
get
;
set
;
}
public
string
Ids
{
get
;
set
;
}
}
}
}
}
\ No newline at end of file
Edu.Model/ViewModel/System/RB_Menu_ViewModel.cs
View file @
6cc95445
using
System
;
namespace
Edu.Model.ViewModel.System
using
System.Collections.Generic
;
using
System.Text
;
namespace
Edu.Model.ViewModel.System
{
{
/// <summary>
/// <summary>
/// 系统菜单视图实体类
/// 系统菜单视图实体类
...
...
Edu.Model/ViewModel/System/RB_Role_ViewModel.cs
View file @
6cc95445
using
System
;
namespace
Edu.Model.ViewModel.System
using
System.Collections.Generic
;
using
System.Text
;
namespace
Edu.Model.ViewModel.System
{
{
/// <summary>
/// <summary>
/// 系统角色视图实体类
/// 系统角色视图实体类
/// </summary>
/// </summary>
public
class
RB_Role_ViewModel
:
Model
.
Entity
.
System
.
RB_Role
public
class
RB_Role_ViewModel
:
Model
.
Entity
.
System
.
RB_Role
{
{
}
}
}
}
Edu.Model/ViewModel/User/RB_Account_ViewModel.cs
View file @
6cc95445
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Edu.Model.ViewModel.User
namespace
Edu.Model.ViewModel.User
{
{
...
...
Edu.Model/ViewModel/User/RB_Assist_ViewModel.cs
View file @
6cc95445
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Edu.Model.ViewModel.User
namespace
Edu.Model.ViewModel.User
{
{
...
...
Edu.Model/ViewModel/User/RB_Group_ViewModel.cs
View file @
6cc95445
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Edu.Model.ViewModel.User
namespace
Edu.Model.ViewModel.User
{
{
...
...
Edu.Model/ViewModel/User/RB_Manager_ViewModel.cs
View file @
6cc95445
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Edu.Model.ViewModel.User
namespace
Edu.Model.ViewModel.User
{
{
...
...
Edu.Model/ViewModel/User/RB_School_ViewModel.cs
View file @
6cc95445
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Edu.Model.ViewModel.User
namespace
Edu.Model.ViewModel.User
{
{
...
...
Edu.Model/ViewModel/User/RB_Student_ViewModel.cs
View file @
6cc95445
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Edu.Model.ViewModel.User
namespace
Edu.Model.ViewModel.User
{
{
...
...
Edu.Model/ViewModel/User/RB_Teacher_ViewModel.cs
View file @
6cc95445
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Edu.Model.ViewModel.User
namespace
Edu.Model.ViewModel.User
{
{
...
...
Edu.Module.Course/CourseCategoryModule.cs
View file @
6cc95445
using
Edu.Common.Enum
;
using
Edu.Common.Enum
;
using
Edu.Model.ViewModel.Course
;
using
Edu.Model.ViewModel.Course
;
using
Edu.Repository.Course
;
using
Edu.Repository.Course
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.
Text
;
using
System.
Linq
;
using
VT.FW.DB
;
using
VT.FW.DB
;
namespace
Edu.Module.Course
namespace
Edu.Module.Course
...
@@ -51,6 +50,60 @@ namespace Edu.Module.Course
...
@@ -51,6 +50,60 @@ namespace Edu.Module.Course
return
categoryRepository
.
GetEntity
<
RB_Course_Category_ViewModel
>(
CateId
);
return
categoryRepository
.
GetEntity
<
RB_Course_Category_ViewModel
>(
CateId
);
}
}
/// <summary>
/// 获取课程分类树形列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
CourseCategoryTree_ViewModel
>
GetCourseCategoryTreeListModule
(
RB_Course_Category_ViewModel
query
)
{
List
<
CourseCategoryTree_ViewModel
>
treeList
=
new
List
<
CourseCategoryTree_ViewModel
>();
var
list
=
GetCourseCategoryListModule
(
query
);
if
(
list
!=
null
&&
list
.
Count
>
0
)
{
var
firstList
=
list
.
Where
(
qitem
=>
qitem
.
ParentId
==
0
).
ToList
();
if
(
firstList
!=
null
&&
firstList
.
Count
>
0
)
{
foreach
(
var
fItem
in
firstList
)
{
CourseCategoryTree_ViewModel
tModel
=
new
CourseCategoryTree_ViewModel
()
{
CateId
=
fItem
.
CateId
,
CateName
=
fItem
.
CateName
,
ParentId
=
fItem
.
ParentId
,
ChildList
=
new
List
<
CourseCategoryTree_ViewModel
>()
};
tModel
.
ChildList
=
GetCategoryTreeList
(
fItem
.
CateId
,
list
);
treeList
.
Add
(
tModel
);
}
}
}
return
treeList
;
}
/// <summary>
/// 递归生成树形结构
/// </summary>
/// <param name="parentId">父节点编号</param>
/// <param name="sourceList">数据源列表</param>
private
List
<
CourseCategoryTree_ViewModel
>
GetCategoryTreeList
(
int
parentId
,
List
<
RB_Course_Category_ViewModel
>
sourceList
)
{
List
<
CourseCategoryTree_ViewModel
>
treeList
=
new
List
<
CourseCategoryTree_ViewModel
>();
foreach
(
var
item
in
sourceList
.
Where
(
qitem
=>
qitem
.
ParentId
==
parentId
))
{
CourseCategoryTree_ViewModel
model
=
new
CourseCategoryTree_ViewModel
()
{
CateId
=
item
.
CateId
,
CateName
=
item
.
CateName
,
ParentId
=
item
.
ParentId
,
ChildList
=
new
List
<
CourseCategoryTree_ViewModel
>(),
};
model
.
ChildList
=
GetCategoryTreeList
(
item
.
CateId
,
sourceList
);
treeList
.
Add
(
model
);
}
return
treeList
;
}
/// <summary>
/// <summary>
/// 新增修改课程分类
/// 新增修改课程分类
/// </summary>
/// </summary>
...
...
Edu.Module.System/DestinationModule.cs
View file @
6cc95445
using
Edu.Model.ViewModel.System
;
using
Edu.Model.ViewModel.System
;
using
Edu.Repository.System
;
using
Edu.Repository.System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Text
;
using
System.Linq
;
using
System.Linq
;
namespace
Edu.Module.System
namespace
Edu.Module.System
...
...
Edu.Module.System/MenuModule.cs
View file @
6cc95445
using
Edu.Model.ViewModel.System
;
using
Edu.Model.ViewModel.System
;
using
Edu.Repository.System
;
using
Edu.Repository.System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Linq
;
using
System.Text
;
using
VT.FW.DB
;
using
VT.FW.DB
;
namespace
Edu.Module.System
namespace
Edu.Module.System
...
...
Edu.Module.User/AccountModule.cs
View file @
6cc95445
using
Edu.Model.ViewModel.User
;
using
Edu.Model.ViewModel.User
;
using
Edu.Repository.User
;
using
Edu.Repository.User
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Text
;
using
VT.FW.DB
;
using
VT.FW.DB
;
namespace
Edu.Module.User
namespace
Edu.Module.User
...
...
Edu.Module.User/StudentModule.cs
View file @
6cc95445
using
Edu.Common.Enum
;
using
Edu.Common.Enum
;
using
Edu.Model.ViewModel.User
;
using
Edu.Model.ViewModel.User
;
using
Edu.Repository.User
;
using
Edu.Repository.User
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Text
;
using
VT.FW.DB
;
using
VT.FW.DB
;
namespace
Edu.Module.User
namespace
Edu.Module.User
...
...
Edu.Module.User/TeacherModule.cs
View file @
6cc95445
...
@@ -7,7 +7,6 @@ using Edu.Repository.User;
...
@@ -7,7 +7,6 @@ using Edu.Repository.User;
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Linq
;
using
System.Text
;
using
VT.FW.DB
;
using
VT.FW.DB
;
namespace
Edu.Module.User
namespace
Edu.Module.User
...
...
Edu.Repository/Course/RB_Course_CategoryRepository.cs
View file @
6cc95445
using
Edu.Common.Enum
;
using
Edu.Common.Enum
;
using
Edu.Model.ViewModel.Course
;
using
Edu.Model.ViewModel.Course
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Linq
;
using
System.Text
;
using
System.Text
;
...
...
Edu.Repository/System/RB_DestinationRepository.cs
View file @
6cc95445
using
Edu.Model.Entity.System
;
using
Edu.Model.ViewModel.System
;
using
Edu.Model.ViewModel.System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Linq
;
using
System.Text
;
using
System.Text
;
...
...
Edu.Repository/System/RB_MenuRepository.cs
View file @
6cc95445
using
Edu.Common.Enum
;
using
Edu.Common.Enum
;
using
Edu.Model.ViewModel.System
;
using
Edu.Model.ViewModel.System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Linq
;
using
System.Text
;
using
System.Text
;
...
...
Edu.Repository/System/RB_RoleRepository.cs
View file @
6cc95445
using
Edu.Common.Enum
;
using
Edu.Common.Enum
;
using
Edu.Model.ViewModel.System
;
using
Edu.Model.ViewModel.System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Linq
;
using
System.Text
;
using
System.Text
;
...
...
Edu.Repository/User/RB_AccountRepository.cs
View file @
6cc95445
using
Edu.Common.Enum
;
using
Edu.Common.Enum
;
using
Edu.Model.ViewModel.User
;
using
Edu.Model.ViewModel.User
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Linq
;
using
System.Text
;
using
System.Text
;
...
...
Edu.Repository/User/RB_AssistRepository.cs
View file @
6cc95445
using
Edu.Common.Enum
;
using
Edu.Common.Enum
;
using
Edu.Model.ViewModel.User
;
using
Edu.Model.ViewModel.User
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Linq
;
using
System.Text
;
using
System.Text
;
...
...
Edu.Repository/User/RB_GroupRepository.cs
View file @
6cc95445
using
Edu.Common.Enum
;
using
Edu.Common.Enum
;
using
Edu.Model.ViewModel.User
;
using
Edu.Model.ViewModel.User
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Linq
;
using
System.Text
;
using
System.Text
;
...
...
Edu.Repository/User/RB_ManagerRepository.cs
View file @
6cc95445
using
Edu.Common.Enum
;
using
Edu.Common.Enum
;
using
Edu.Model.ViewModel.User
;
using
Edu.Model.ViewModel.User
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Linq
;
using
System.Text
;
using
System.Text
;
...
...
Edu.Repository/User/RB_SchoolRepository.cs
View file @
6cc95445
using
Edu.Common.Enum
;
using
Edu.Common.Enum
;
using
Edu.Model.ViewModel.User
;
using
Edu.Model.ViewModel.User
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Linq
;
using
System.Text
;
using
System.Text
;
...
...
Edu.Repository/User/RB_StudentRepository.cs
View file @
6cc95445
using
Edu.Common.Enum
;
using
Edu.Common.Enum
;
using
Edu.Model.ViewModel.User
;
using
Edu.Model.ViewModel.User
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Linq
;
using
System.Text
;
using
System.Text
;
...
...
Edu.Repository/User/RB_TeacherRepository.cs
View file @
6cc95445
using
Edu.Common.Enum
;
using
Edu.Common.Enum
;
using
Edu.Model.ViewModel.User
;
using
Edu.Model.ViewModel.User
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Linq
;
using
System.Text
;
using
System.Text
;
...
...
Edu.WebApi/Controllers/BaseController.cs
View file @
6cc95445
using
System
;
using
Edu.Common
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Threading.Tasks
;
using
Edu.Common
;
using
Edu.Common.API
;
using
Edu.Common.API
;
using
Edu.Common.Plugin
;
using
Edu.Common.Plugin
;
using
Edu.WebApi.Filter
;
using
Edu.WebApi.Filter
;
...
@@ -11,7 +6,6 @@ using Microsoft.AspNetCore.Cors;
...
@@ -11,7 +6,6 @@ using Microsoft.AspNetCore.Cors;
using
Microsoft.AspNetCore.Mvc
;
using
Microsoft.AspNetCore.Mvc
;
using
Newtonsoft.Json
;
using
Newtonsoft.Json
;
using
Newtonsoft.Json.Linq
;
using
Newtonsoft.Json.Linq
;
using
System.Web
;
using
Edu.Model.CacheModel
;
using
Edu.Model.CacheModel
;
using
Edu.Cache.User
;
using
Edu.Cache.User
;
...
...
Edu.WebApi/Controllers/Course/CourseController.cs
View file @
6cc95445
using
System
;
using
System
;
using
System.Collections.Generic
;
using
Edu.Cache.User
;
using
System.Linq
;
using
System.Threading.Tasks
;
using
Edu.Common.API
;
using
Edu.Common.API
;
using
Edu.Common.Plugin
;
using
Edu.Common.Plugin
;
using
Edu.Model.ViewModel.Course
;
using
Edu.Model.ViewModel.Course
;
using
Edu.Module.Course
;
using
Edu.Module.Course
;
using
Edu.WebApi.Filter
;
using
Edu.WebApi.Filter
;
using
Microsoft.AspNetCore.Cors
;
using
Microsoft.AspNetCore.Cors
;
using
Microsoft.AspNetCore.Http
;
using
Microsoft.AspNetCore.Mvc
;
using
Microsoft.AspNetCore.Mvc
;
namespace
Edu.WebApi.Controllers.Course
namespace
Edu.WebApi.Controllers.Course
...
@@ -37,6 +34,17 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -37,6 +34,17 @@ namespace Edu.WebApi.Controllers.Course
query
.
Group_Id
=
base
.
UserInfo
.
Group_Id
;
query
.
Group_Id
=
base
.
UserInfo
.
Group_Id
;
query
.
School_Id
=
base
.
UserInfo
.
School_Id
;
query
.
School_Id
=
base
.
UserInfo
.
School_Id
;
var
list
=
categoryModule
.
GetCourseCategoryPageListModule
(
pageModel
.
PageIndex
,
pageModel
.
PageSize
,
out
long
rowsCount
,
query
);
var
list
=
categoryModule
.
GetCourseCategoryPageListModule
(
pageModel
.
PageIndex
,
pageModel
.
PageSize
,
out
long
rowsCount
,
query
);
foreach
(
var
item
in
list
)
{
if
(
item
.
CreateBy
>
0
)
{
item
.
CreateByName
=
UserReidsCache
.
GetUserLoginInfo
(
item
.
CreateBy
)?.
AccountName
??
""
;
}
if
(
item
.
UpdateBy
>
0
)
{
item
.
UpdateByName
=
UserReidsCache
.
GetUserLoginInfo
(
item
.
UpdateBy
)?.
AccountName
??
""
;
}
}
pageModel
.
Count
=
rowsCount
;
pageModel
.
Count
=
rowsCount
;
pageModel
.
PageData
=
list
;
pageModel
.
PageData
=
list
;
return
ApiResult
.
Success
(
data
:
pageModel
);
return
ApiResult
.
Success
(
data
:
pageModel
);
...
@@ -56,6 +64,19 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -56,6 +64,19 @@ namespace Edu.WebApi.Controllers.Course
return
ApiResult
.
Success
(
data
:
list
);
return
ApiResult
.
Success
(
data
:
list
);
}
}
/// <summary>
/// 获取课程分类树形列表
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetCourseCategoryTree
()
{
var
query
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
RB_Course_Category_ViewModel
>(
RequestParm
.
Msg
.
ToString
());
query
.
Group_Id
=
base
.
UserInfo
.
Group_Id
;
query
.
School_Id
=
base
.
UserInfo
.
School_Id
;
var
list
=
categoryModule
.
GetCourseCategoryTreeListModule
(
query
);
return
ApiResult
.
Success
(
data
:
list
);
}
/// <summary>
/// <summary>
/// 添加修改课程分类
/// 添加修改课程分类
...
@@ -69,6 +90,8 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -69,6 +90,8 @@ namespace Edu.WebApi.Controllers.Course
extModel
.
CreateBy
=
base
.
UserInfo
.
Id
;
extModel
.
CreateBy
=
base
.
UserInfo
.
Id
;
extModel
.
UpdateBy
=
base
.
UserInfo
.
Id
;
extModel
.
UpdateBy
=
base
.
UserInfo
.
Id
;
extModel
.
UpdateTime
=
DateTime
.
Now
;
extModel
.
UpdateTime
=
DateTime
.
Now
;
extModel
.
Group_Id
=
this
.
UserInfo
.
Group_Id
;
extModel
.
School_Id
=
this
.
UserInfo
.
School_Id
;
bool
flag
=
categoryModule
.
SetCourseCategoryModule
(
extModel
);
bool
flag
=
categoryModule
.
SetCourseCategoryModule
(
extModel
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
}
...
...
Edu.WebApi/Filter/ApiFilterAttribute.cs
View file @
6cc95445
...
@@ -28,7 +28,7 @@ namespace Edu.WebApi.Filter
...
@@ -28,7 +28,7 @@ namespace Edu.WebApi.Filter
{
{
string
token
=
""
;
string
token
=
""
;
//请求参数
//请求参数
JObject
parm
=
DoApiMonitorLog
(
actionContext
,
ref
token
);
DoApiMonitorLog
(
actionContext
,
ref
token
);
bool
isCheckToken
=
true
;
bool
isCheckToken
=
true
;
var
endpoint
=
actionContext
.
HttpContext
.
Features
.
Get
<
IEndpointFeature
>()?.
Endpoint
;
var
endpoint
=
actionContext
.
HttpContext
.
Features
.
Get
<
IEndpointFeature
>()?.
Endpoint
;
if
(
endpoint
!=
null
&&
endpoint
.
Metadata
.
GetMetadata
<
AllowAnonymousAttribute
>()
!=
null
)
if
(
endpoint
!=
null
&&
endpoint
.
Metadata
.
GetMetadata
<
AllowAnonymousAttribute
>()
!=
null
)
...
@@ -149,7 +149,7 @@ namespace Edu.WebApi.Filter
...
@@ -149,7 +149,7 @@ namespace Edu.WebApi.Filter
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
string
message
=
ex
.
Message
;
Common
.
Plugin
.
LogHelper
.
Write
(
ex
,
"JWTValidat3"
)
;
actionContext
.
Result
=
new
Microsoft
.
AspNetCore
.
Mvc
.
JsonResult
(
actionContext
.
Result
=
new
Microsoft
.
AspNetCore
.
Mvc
.
JsonResult
(
HttpStatusCode
.
OK
,
HttpStatusCode
.
OK
,
new
ApiResult
new
ApiResult
...
...
Edu.WebApi/Helper/WebApiTokenHelper.cs
View file @
6cc95445
...
@@ -5,8 +5,6 @@ using JWT.Serializers;
...
@@ -5,8 +5,6 @@ using JWT.Serializers;
using
Newtonsoft.Json.Linq
;
using
Newtonsoft.Json.Linq
;
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Threading.Tasks
;
namespace
Edu.WebApi.Helper
namespace
Edu.WebApi.Helper
{
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment