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
88ec1211
Commit
88ec1211
authored
May 20, 2020
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
登录修改
parent
f8ff82d9
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
59 additions
and
2 deletions
+59
-2
UserInfo.cs
Mall.Common/API/UserInfo.cs
+5
-0
RB_Tenant_Extend.cs
Mall.Model/Extend/User/RB_Tenant_Extend.cs
+10
-0
TenantModule.cs
Mall.Module.User/TenantModule.cs
+10
-0
RB_TenantRepository.cs
Mall.Repository/User/RB_TenantRepository.cs
+23
-0
TenantController.cs
Mall.WebApi/Controllers/User/TenantController.cs
+11
-2
No files found.
Mall.Common/API/UserInfo.cs
View file @
88ec1211
...
...
@@ -121,5 +121,10 @@ namespace Mall.Common
/// SecretKey
/// </summary>
public
string
SecretKey
{
get
;
set
;
}
/// <summary>
/// 员工编号
/// </summary>
public
int
EmpId
{
get
;
set
;
}
}
}
Mall.Model/Extend/User/RB_Tenant_Extend.cs
View file @
88ec1211
...
...
@@ -34,5 +34,15 @@ namespace Mall.Model.Extend.User
return
str
;
}
}
/// <summary>
/// 小程序Id【用于登录验证】
/// </summary>
public
int
MallBaseId
{
get
;
set
;
}
/// <summary>
/// 当前登录员工编号
/// </summary>
public
int
EmpId
{
get
;
set
;
}
}
}
Mall.Module.User/TenantModule.cs
View file @
88ec1211
...
...
@@ -27,6 +27,16 @@ namespace Mall.Module.User
return
tenantRepository
.
GetListRepository
(
query
);
}
/// <summary>
/// 根据小程序获取商户信息
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public
RB_Tenant_Extend
GetTenantByMallModule
(
RB_Tenant_Extend
query
)
{
return
tenantRepository
.
GetTenantByMallRepository
(
query
);
}
/// <summary>
/// 获取商户分页列表
/// </summary>
...
...
Mall.Repository/User/RB_TenantRepository.cs
View file @
88ec1211
...
...
@@ -31,6 +31,29 @@ namespace Mall.Repository.User
return
Get
<
RB_Tenant_Extend
>(
builder
.
ToString
()).
ToList
();
}
/// <summary>
/// 根据小程序获取商户信息
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public
RB_Tenant_Extend
GetTenantByMallRepository
(
RB_Tenant_Extend
query
)
{
StringBuilder
builder
=
new
StringBuilder
();
builder
.
Append
(
@"
SELECT A.TenantId,B.EmpAccount AS Account,A.Name,A.MobilePhone,A.WeChatNum,A.IsEffective,A.AccountValidate,A.CreateMiniPrograme
,A.AccountStatus,B.EmpPwd AS Password,B.EmpId
FROM RB_Tenant AS A LEFT JOIN rb_employee AS B ON A.TenantId=B.TenantId
WHERE 1=1 "
);
if
(
query
!=
null
)
{
if
(
query
.
Account
!=
null
&&
!
string
.
IsNullOrEmpty
(
query
.
Account
.
Trim
()))
{
builder
.
AppendFormat
(
" AND B.EmpAccount='{0}' "
,
query
.
Account
.
Trim
());
}
}
return
Get
<
RB_Tenant_Extend
>(
builder
.
ToString
()).
FirstOrDefault
();
}
/// <summary>
/// 获取商户分页列表
/// </summary>
...
...
Mall.WebApi/Controllers/User/TenantController.cs
View file @
88ec1211
...
...
@@ -73,7 +73,16 @@ namespace Mall.WebApi.Controllers.User
public
ApiResult
Login
()
{
var
query
=
JsonConvert
.
DeserializeObject
<
RB_Tenant_Extend
>(
RequestParm
.
msg
.
ToString
());
var
model
=
TenantModule
.
GetTenantListModule
(
query
).
FirstOrDefault
();
var
model
=
new
RB_Tenant_Extend
();
if
(
query
.
MallBaseId
>
0
)
{
model
=
TenantModule
.
GetTenantByMallModule
(
query
);
}
else
{
model
=
TenantModule
.
GetTenantListModule
(
query
).
FirstOrDefault
();
}
if
(
model
==
null
)
{
return
ApiResult
.
Failed
(
"未找到此用户"
);
...
...
@@ -117,11 +126,11 @@ namespace Mall.WebApi.Controllers.User
IsEffective
=
model
.
IsEffective
,
AccountValidate
=
model
.
AccountValidate
,
CreateMiniPrograme
=
model
.
CreateMiniPrograme
,
//MallName = model.MallName,
AccountStatus
=
model
.
AccountStatus
,
Token
=
token
,
SecretKey
=
""
,
MallBaseId
=
0
,
EmpId
=
model
.
EmpId
,
};
UserReidsCache
.
UserInfoSet
(
UserModuleCacheKeyConfig
.
Mall_Login_Info
+
model
.
TenantId
,
obj
,
Config
.
JwtExpirTime
);
return
ApiResult
.
Success
(
""
,
obj
);
...
...
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