Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mall.oytour.com
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
黄奎
mall.oytour.com
Commits
a36f911c
Commit
a36f911c
authored
Apr 21, 2020
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
0046a5dc
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
181 additions
and
1 deletion
+181
-1
storage.ide
Mall/.vs/Mall/v16/Server/sqlite3/storage.ide
+0
-0
storage.ide-shm
Mall/.vs/Mall/v16/Server/sqlite3/storage.ide-shm
+0
-0
storage.ide-wal
Mall/.vs/Mall/v16/Server/sqlite3/storage.ide-wal
+0
-0
Mall.Module.BaseSetUp.AssemblyInfoInputs.cache
...coreapp3.1/Mall.Module.BaseSetUp.AssemblyInfoInputs.cache
+1
-0
Mall.Module.BaseSetUp.assets.cache
...bj/Debug/netcoreapp3.1/Mall.Module.BaseSetUp.assets.cache
+0
-0
Mall.Module.BaseSetUp.csprojAssemblyReference.cache
...pp3.1/Mall.Module.BaseSetUp.csprojAssemblyReference.cache
+0
-0
Mall.Module.BaseSetUp.csproj.nuget.cache
...le.BaseSetUp/obj/Mall.Module.BaseSetUp.csproj.nuget.cache
+5
-0
dotnet-tools.json
Mall/Mall.WebApi/.config/dotnet-tools.json
+12
-0
BaseController.cs
Mall/Mall.WebApi/Controllers/BaseController.cs
+47
-0
TenantController.cs
Mall/Mall.WebApi/Controllers/User/TenantController.cs
+69
-0
Mall.WebApi.csproj.user
Mall/Mall.WebApi/Mall.WebApi.csproj.user
+14
-0
Program.cs
Mall/Mall.WebApi/Program.cs
+1
-1
CustomProfile.pubxml
...ll.WebApi/Properties/PublishProfiles/CustomProfile.pubxml
+21
-0
CustomProfile.pubxml.user
...bApi/Properties/PublishProfiles/CustomProfile.pubxml.user
+11
-0
No files found.
Mall/.vs/Mall/v16/Server/sqlite3/storage.ide
0 → 100644
View file @
a36f911c
File added
Mall/.vs/Mall/v16/Server/sqlite3/storage.ide-shm
0 → 100644
View file @
a36f911c
File added
Mall/.vs/Mall/v16/Server/sqlite3/storage.ide-wal
0 → 100644
View file @
a36f911c
File added
Mall/Mall.Module.BaseSetUp/obj/Debug/netcoreapp3.1/Mall.Module.BaseSetUp.AssemblyInfoInputs.cache
0 → 100644
View file @
a36f911c
a661180cba268b71980a07f0b03bcb220373213c
Mall/Mall.Module.BaseSetUp/obj/Debug/netcoreapp3.1/Mall.Module.BaseSetUp.assets.cache
0 → 100644
View file @
a36f911c
File added
Mall/Mall.Module.BaseSetUp/obj/Debug/netcoreapp3.1/Mall.Module.BaseSetUp.csprojAssemblyReference.cache
0 → 100644
View file @
a36f911c
File added
Mall/Mall.Module.BaseSetUp/obj/Mall.Module.BaseSetUp.csproj.nuget.cache
0 → 100644
View file @
a36f911c
{
"version": 1,
"dgSpecHash": "oFP36aTWSefHN0ZVnyqxX7jI9/JiVlGC5sshaQSYqDZj+6NRSCIh0GaCRE68l00pJI2k8ybusb1xcRAW1+ce9g==",
"success": true
}
\ No newline at end of file
Mall/Mall.WebApi/.config/dotnet-tools.json
0 → 100644
View file @
a36f911c
{
"version"
:
1
,
"isRoot"
:
true
,
"tools"
:
{
"dotnet-ef"
:
{
"version"
:
"3.1.3"
,
"commands"
:
[
"dotnet-ef"
]
}
}
}
\ No newline at end of file
Mall/Mall.WebApi/Controllers/BaseController.cs
0 → 100644
View file @
a36f911c
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Threading.Tasks
;
using
Mall.Common
;
using
Mall.Common.API
;
using
Mall.Common.Plugin
;
using
Mall.WebApi.Filter
;
using
Microsoft.AspNetCore.Cors
;
using
Microsoft.AspNetCore.Mvc
;
using
Newtonsoft.Json
;
using
Newtonsoft.Json.Linq
;
namespace
Mall.WebApi.Controllers
{
[
Route
(
"api/[controller]/[action]"
)]
[
ApiExceptionFilter
]
[
ApiFilter
]
[
EnableCors
(
"AllowCors"
)]
public
class
BaseController
:
ControllerBase
{
/// <summary>
/// 整理前端传递的post参数
/// </summary>
/// <param name="requestMsg"></param>
/// <returns></returns>
public
RequestParm
RequestParm
{
get
{
#
region
读取
post
参数
var
requestMsg
=
Request
.
HttpContext
.
Items
[
GlobalKey
.
UserPostInfo
];
var
requestParm
=
JsonConvert
.
DeserializeObject
<
RequestParm
>(
requestMsg
.
ToString
());
var
UObj
=
Request
.
HttpContext
.
Items
[
GlobalKey
.
TokenUserInfo
];
if
(
UObj
!=
null
)
{
JObject
parms
=
JObject
.
Parse
(
UObj
.
ToString
());
requestParm
.
uid
=
parms
.
GetStringValue
(
"uid"
);
}
#
endregion
//根据token 获取uid
return
requestParm
;
}
}
}
}
\ No newline at end of file
Mall/Mall.WebApi/Controllers/User/TenantController.cs
0 → 100644
View file @
a36f911c
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Threading.Tasks
;
using
Mall.Common.API
;
using
Mall.WebApi.Filter
;
using
Microsoft.AspNetCore.Cors
;
using
Microsoft.AspNetCore.Mvc
;
using
Mall.Model.Extend.User
;
using
Newtonsoft.Json
;
using
Newtonsoft.Json.Linq
;
using
JWT
;
using
Mall.Common
;
using
JWT.Algorithms
;
using
JWT.Serializers
;
using
Mall.Common.Enum
;
namespace
Mall.WebApi.Controllers.User
{
[
Route
(
"api/[controller]/[action]"
)]
[
ApiExceptionFilter
]
[
ApiController
]
[
EnableCors
(
"AllowCors"
)]
public
class
TenantController
:
BaseController
{
private
Module
.
User
.
TenantModule
TenantModule
=
new
Module
.
User
.
TenantModule
();
// JObject parm = JObject.Parse(RequestParm.msg.ToString());
//UserInfo userInfo = UserReidsCache.GetUserLoginInfo(base.RequestParm.uid);
public
ApiResult
Login
()
{
var
query
=
JsonConvert
.
DeserializeObject
<
RB_Tenant_Extend
>(
RequestParm
.
msg
.
ToString
());
var
model
=
TenantModule
.
GetTenantListModule
(
query
).
FirstOrDefault
();
if
(
model
==
null
)
{
return
ApiResult
.
Failed
(
"未找到此用户"
);
}
else
{
if
(
model
.
Password
!=
query
.
Password
)
{
return
ApiResult
.
Failed
(
"密码错误"
);
}
TokenUserInfo
userInfo
=
new
TokenUserInfo
{
uid
=
model
.
TenantId
.
ToString
(),
requestFrom
=
ApiRequestFromEnum
.
Web
};
string
token
=
""
;
#
region
JWT
IDateTimeProvider
provider
=
new
UtcDateTimeProvider
();
var
now
=
provider
.
GetNow
().
AddMinutes
(-
1
);
var
unixEpoch
=
new
DateTime
(
1970
,
1
,
1
,
0
,
0
,
0
,
DateTimeKind
.
Utc
);
// or use JwtValidator.UnixEpoch
var
secondsSinceEpoch
=
Math
.
Round
((
now
-
unixEpoch
).
TotalSeconds
);
var
payload
=
new
Dictionary
<
string
,
object
>
{
{
"iat"
,
secondsSinceEpoch
},
{
"exp"
,
secondsSinceEpoch
+
Config
.
JwtExpirTime
},
{
"mall_userInfo"
,
userInfo
}
};
IJwtAlgorithm
algorithm
=
new
HMACSHA256Algorithm
();
IJsonSerializer
serializer
=
new
JsonNetSerializer
();
IBase64UrlEncoder
urlEncoder
=
new
JwtBase64UrlEncoder
();
IJwtEncoder
encoder
=
new
JwtEncoder
(
algorithm
,
serializer
,
urlEncoder
);
string
secret
=
Config
.
JwtSecretKey
;
token
=
encoder
.
Encode
(
payload
,
secret
);
#
endregion
return
ApiResult
.
Success
(
""
,
model
);
}
}
}
}
\ No newline at end of file
Mall/Mall.WebApi/Mall.WebApi.csproj.user
0 → 100644
View file @
a36f911c
<?xml version="1.0" encoding="utf-8"?>
<Project
ToolsVersion=
"Current"
xmlns=
"http://schemas.microsoft.com/developer/msbuild/2003"
>
<PropertyGroup>
<Controller_SelectedScaffolderID>
MvcControllerEmptyScaffolder
</Controller_SelectedScaffolderID>
<Controller_SelectedScaffolderCategoryPath>
root/Controller
</Controller_SelectedScaffolderCategoryPath>
<WebStackScaffolding_ControllerDialogWidth>
600
</WebStackScaffolding_ControllerDialogWidth>
<WebStackScaffolding_IsLayoutPageSelected>
True
</WebStackScaffolding_IsLayoutPageSelected>
<WebStackScaffolding_IsPartialViewSelected>
False
</WebStackScaffolding_IsPartialViewSelected>
<WebStackScaffolding_IsReferencingScriptLibrariesSelected>
True
</WebStackScaffolding_IsReferencingScriptLibrariesSelected>
<WebStackScaffolding_LayoutPageFile
/>
<WebStackScaffolding_IsAsyncSelected>
False
</WebStackScaffolding_IsAsyncSelected>
<NameOfLastUsedPublishProfile>
CustomProfile
</NameOfLastUsedPublishProfile>
</PropertyGroup>
</Project>
\ No newline at end of file
Mall/Mall.WebApi/Program.cs
View file @
a36f911c
...
...
@@ -20,7 +20,7 @@ namespace Mall.WebApi
Host
.
CreateDefaultBuilder
(
args
)
.
ConfigureWebHostDefaults
(
webBuilder
=>
{
webBuilder
.
UseStartup
<
Startup
>();
webBuilder
.
UseStartup
<
Startup
>()
.
UseIIS
()
;
});
}
}
Mall/Mall.WebApi/Properties/PublishProfiles/CustomProfile.pubxml
0 → 100644
View file @
a36f911c
<?xml version="1.0" encoding="utf-8"?>
<!--
此文件由 Web 项目的发布/打包过程使用。可以通过编辑此 MSBuild 文件
自定义此过程的行为。为了解与此相关的更多内容,请访问 https://go.microsoft.com/fwlink/?LinkID=208121。
-->
<Project
ToolsVersion=
"4.0"
xmlns=
"http://schemas.microsoft.com/developer/msbuild/2003"
>
<PropertyGroup>
<WebPublishMethod>
FileSystem
</WebPublishMethod>
<LastUsedBuildConfiguration>
Release
</LastUsedBuildConfiguration>
<LastUsedPlatform>
Any CPU
</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish
/>
<LaunchSiteAfterPublish>
True
</LaunchSiteAfterPublish>
<ExcludeApp_Data>
False
</ExcludeApp_Data>
<TargetFramework>
netcoreapp3.0
</TargetFramework>
<ProjectGuid>
ad842a33-b1df-4360-ae06-536353f0276c
</ProjectGuid>
<SelfContained>
false
</SelfContained>
<publishUrl>
F:\网站发布\Mall.oytour.com
</publishUrl>
<DeleteExistingFiles>
True
</DeleteExistingFiles>
<RuntimeIdentifier>
win-x64
</RuntimeIdentifier>
</PropertyGroup>
</Project>
\ No newline at end of file
Mall/Mall.WebApi/Properties/PublishProfiles/CustomProfile.pubxml.user
0 → 100644
View file @
a36f911c
<?xml version="1.0" encoding="utf-8"?>
<!--
此文件由 Web 项目的发布/打包过程使用。可以通过编辑此 MSBuild 文件
自定义此过程的行为。为了解与此相关的更多内容,请访问 https://go.microsoft.com/fwlink/?LinkID=208121。
-->
<Project
ToolsVersion=
"4.0"
xmlns=
"http://schemas.microsoft.com/developer/msbuild/2003"
>
<PropertyGroup>
<TimeStampOfAssociatedLegacyPublishXmlFile
/>
<_PublishTargetUrl>
F:\网站发布\Mall.oytour.com
</_PublishTargetUrl>
</PropertyGroup>
</Project>
\ No newline at end of file
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