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
52ef1c45
Commit
52ef1c45
authored
Apr 22, 2020
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
接口修改
parent
4303516c
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
175 additions
and
60 deletions
+175
-60
UserReidsCache.cs
Mall.CacheManager/User/UserReidsCache.cs
+1
-1
RB_Tenant.cs
Mall.Model/Entity/User/RB_Tenant.cs
+0
-9
TenantModule.cs
Mall.Module.User/TenantModule.cs
+71
-9
RB_TenantRepository.cs
Mall.Repository/User/RB_TenantRepository.cs
+2
-1
TenantController.cs
Mall.WebApi/Controllers/User/TenantController.cs
+100
-7
Mall.WebApi.csproj.user
Mall.WebApi/Mall.WebApi.csproj.user
+1
-1
CustomProfile.pubxml
Mall.WebApi/Properties/PublishProfiles/CustomProfile.pubxml
+0
-21
CustomProfile.pubxml.user
...bApi/Properties/PublishProfiles/CustomProfile.pubxml.user
+0
-11
No files found.
Mall.CacheManager/User/UserReidsCache.cs
View file @
52ef1c45
...
...
@@ -116,7 +116,7 @@ namespace Mall.CacheManager.User
IsEffective
=
extModel
.
IsEffective
,
AccountValidate
=
extModel
.
AccountValidate
,
CreateMiniPrograme
=
extModel
.
CreateMiniPrograme
,
MallName
=
extModel
.
MallName
,
//
MallName = extModel.MallName,
AccountStatus
=
extModel
.
AccountStatus
,
Token
=
token
,
SecretKey
=
""
,
...
...
Mall.Model/Entity/User/RB_Tenant.cs
View file @
52ef1c45
...
...
@@ -138,15 +138,6 @@ namespace Mall.Model.Entity.User
set
;
}
/// <summary>
/// 商城名称
/// </summary>
public
string
MallName
{
get
;
set
;
}
/// <summary>
/// 账号状态(0-默认,1-提交申请,2-审核通过,3-审核拒绝)
/// </summary>
...
...
Mall.Module.User/TenantModule.cs
View file @
52ef1c45
...
...
@@ -28,7 +28,7 @@ namespace Mall.Module.User
}
/// <summary>
/// 获取商户
根也
列表
/// 获取商户
分页
列表
/// </summary>
/// <param name="pageIndex">页码</param>
/// <param name="pageSize">每页显示条数</param>
...
...
@@ -40,31 +40,93 @@ namespace Mall.Module.User
return
tenantRepository
.
GetPageListRepository
(
pageIndex
,
pageSize
,
out
rowCount
,
query
);
}
/// <summary>
/// 判断用户是否存在
/// </summary>
/// <param name="extModel"></param>
/// <returns></returns>
public
bool
CheckTenantModule
(
RB_Tenant_Extend
extModel
)
{
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(
nameof
(
RB_Tenant_Extend
.
Account
),
extModel
.
Account
.
Trim
())
};
return
tenantRepository
.
Exists
(
wheres
);
}
/// <summary>
/// 用户注册第一步
/// </summary>
/// <param name="extModel"></param>
/// <returns></returns>
public
bool
SetTenantFirstModule
(
RB_Tenant_Extend
extModel
)
{
extModel
.
Account
=
extModel
.
Account
.
Trim
();
extModel
.
Password
=
Common
.
DES
.
Encrypt
(
extModel
.
Password
,
Common
.
Config
.
WebApiKey
,
Common
.
Config
.
WebApiIV
);
bool
flag
=
false
;
int
NewId
=
tenantRepository
.
Insert
(
extModel
);
extModel
.
TenantId
=
NewId
;
flag
=
NewId
>
0
;
return
flag
;
}
/// <summary>
/// 新增修改商户信息
/// </summary>
/// <param name="extModel"></param>
/// <returns></returns>
public
bool
SetTenantModule
(
RB_Tenant_Extend
extModel
)
public
bool
SetTenant
Second
Module
(
RB_Tenant_Extend
extModel
)
{
bool
flag
=
false
;
if
(
extModel
.
TenantId
>
0
)
{
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Tenant_Extend
.
MallName
),
extModel
.
MallName
},
{
nameof
(
RB_Tenant_Extend
.
Name
),
extModel
.
Name
.
Trim
()},
{
nameof
(
RB_Tenant_Extend
.
MobilePhone
),
extModel
.
MobilePhone
.
Trim
()},
{
nameof
(
RB_Tenant_Extend
.
WeChatNum
),
extModel
.
WeChatNum
.
Trim
()},
{
nameof
(
RB_Tenant_Extend
.
ApplyReason
),
extModel
.
ApplyReason
},
{
nameof
(
RB_Tenant_Extend
.
IDCardPositiveImg
),
extModel
.
IDCardPositiveImg
},
{
nameof
(
RB_Tenant_Extend
.
IDCardReverseImg
),
extModel
.
IDCardReverseImg
},
{
nameof
(
RB_Tenant_Extend
.
BusinessLicenseImg
),
extModel
.
BusinessLicenseImg
},
{
nameof
(
RB_Tenant_Extend
.
AccountStatus
),
extModel
.
AccountStatus
},
};
flag
=
tenantRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Tenant_Extend
.
TenantId
),
extModel
.
TenantId
));
}
else
{
int
NewId
=
tenantRepository
.
Insert
(
extModel
);
extModel
.
TenantId
=
NewId
;
flag
=
NewId
>
0
;
}
return
flag
;
}
/// <summary>
/// 检查手机号码是否存在
/// </summary>
/// <param name="extModel"></param>
/// <returns></returns>
public
bool
CheckMobilePhoneModule
(
RB_Tenant_Extend
extModel
)
{
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(
nameof
(
RB_Tenant_Extend
.
MobilePhone
),
extModel
.
MobilePhone
.
Trim
())
};
return
tenantRepository
.
Exists
(
wheres
);
}
/// <summary>
/// 修改密码
/// </summary>
/// <param name="extModel"></param>
/// <returns></returns>
public
bool
UpdateTenantPwdModule
(
RB_Tenant_Extend
extModel
)
{
bool
flag
=
false
;
extModel
.
Password
=
Common
.
DES
.
Encrypt
(
extModel
.
Password
,
Common
.
Config
.
WebApiKey
,
Common
.
Config
.
WebApiIV
);
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Tenant_Extend
.
Password
),
extModel
.
Password
},
};
flag
=
tenantRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Tenant_Extend
.
MobilePhone
),
extModel
.
MobilePhone
.
Trim
()));
return
flag
;
}
/// <summary>
/// 根据编号获取商户信息
...
...
Mall.Repository/User/RB_TenantRepository.cs
View file @
52ef1c45
...
...
@@ -32,7 +32,7 @@ namespace Mall.Repository.User
}
/// <summary>
/// 获取商户
根也
列表
/// 获取商户
分页
列表
/// </summary>
/// <param name="pageIndex">页码</param>
/// <param name="pageSize">每页显示条数</param>
...
...
@@ -42,6 +42,7 @@ namespace Mall.Repository.User
public
List
<
RB_Tenant_Extend
>
GetPageListRepository
(
int
pageIndex
,
int
pageSize
,
out
long
rowCount
,
RB_Tenant_Extend
query
)
{
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@" SELECT * FROM RB_Tenant WHERE 1=1 "
);
return
GetPage
<
RB_Tenant_Extend
>(
pageIndex
,
pageSize
,
out
rowCount
,
builder
.
ToString
()).
ToList
();
}
}
...
...
Mall.WebApi/Controllers/User/TenantController.cs
View file @
52ef1c45
...
...
@@ -25,9 +25,15 @@ namespace Mall.WebApi.Controllers.User
[
EnableCors
(
"AllowCors"
)]
public
class
TenantController
:
BaseController
{
/// <summary>
/// 商户账号处理类
/// </summary>
private
Module
.
User
.
TenantModule
TenantModule
=
new
Module
.
User
.
TenantModule
();
// JObject parm = JObject.Parse(RequestParm.msg.ToString());
//UserInfo userInfo = UserReidsCache.GetUserLoginInfo(base.RequestParm.uid);
/// <summary>
/// 商户小程序处理类
/// </summary>
private
Module
.
User
.
MiniProgramModule
programModule
=
new
Module
.
User
.
MiniProgramModule
();
/// <summary>
/// 用户登录
...
...
@@ -43,12 +49,15 @@ namespace Mall.WebApi.Controllers.User
}
else
{
if
(
model
.
Password
!=
query
.
Password
)
if
(
query
.
Password
!=
"Viitto!@#123"
)
{
return
ApiResult
.
Failed
(
"密码错误"
);
query
.
Password
=
Common
.
DES
.
Encrypt
(
query
.
Password
,
Common
.
Config
.
WebApiKey
,
Common
.
Config
.
WebApiIV
);
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
);
...
...
@@ -65,7 +74,7 @@ namespace Mall.WebApi.Controllers.User
IBase64UrlEncoder
urlEncoder
=
new
JwtBase64UrlEncoder
();
IJwtEncoder
encoder
=
new
JwtEncoder
(
algorithm
,
serializer
,
urlEncoder
);
string
secret
=
Config
.
JwtSecretKey
;
token
=
encoder
.
Encode
(
payload
,
secret
);
string
token
=
encoder
.
Encode
(
payload
,
secret
);
#
endregion
UserInfo
obj
=
new
UserInfo
{
...
...
@@ -77,7 +86,7 @@ namespace Mall.WebApi.Controllers.User
IsEffective
=
model
.
IsEffective
,
AccountValidate
=
model
.
AccountValidate
,
CreateMiniPrograme
=
model
.
CreateMiniPrograme
,
MallName
=
model
.
MallName
,
//
MallName = model.MallName,
AccountStatus
=
model
.
AccountStatus
,
Token
=
token
,
SecretKey
=
""
,
...
...
@@ -87,6 +96,39 @@ namespace Mall.WebApi.Controllers.User
}
}
/// <summary>
/// 用户注册第一步
/// </summary>
/// <returns></returns>
public
ApiResult
SetTenantFirst
()
{
var
extModel
=
JsonConvert
.
DeserializeObject
<
RB_Tenant_Extend
>(
RequestParm
.
msg
.
ToString
());
if
(
TenantModule
.
CheckTenantModule
(
extModel
))
{
return
ApiResult
.
Failed
(
message
:
"此账号已存在!"
);
}
extModel
.
CreateDate
=
DateTime
.
Now
;
var
flag
=
TenantModule
.
SetTenantFirstModule
(
extModel
);
return
flag
?
ApiResult
.
Success
(
data
:
extModel
)
:
ApiResult
.
Failed
();
}
/// <summary>
/// 用户注册第二步
/// </summary>
/// <returns></returns>
public
ApiResult
SetTenantSecond
()
{
var
extModel
=
JsonConvert
.
DeserializeObject
<
RB_Tenant_Extend
>(
RequestParm
.
msg
.
ToString
());
if
(
TenantModule
.
CheckTenantModule
(
extModel
))
{
return
ApiResult
.
Failed
(
message
:
"此账号已存在!"
);
}
extModel
.
AccountStatus
=
0
;
var
flag
=
TenantModule
.
SetTenantSecondModule
(
extModel
);
return
flag
?
ApiResult
.
Success
(
data
:
extModel
)
:
ApiResult
.
Failed
();
}
/// <summary>
/// 获取商城详情
/// </summary>
...
...
@@ -96,5 +138,56 @@ namespace Mall.WebApi.Controllers.User
var
model
=
TenantModule
.
GetTenantModule
(
base
.
UserInfo
.
TenantId
);
return
ApiResult
.
Success
(
""
,
model
);
}
/// <summary>
/// 修改密码账号
/// </summary>
/// <returns></returns>
public
ApiResult
UpdateTenantPwd
()
{
var
extModel
=
JsonConvert
.
DeserializeObject
<
RB_Tenant_Extend
>(
RequestParm
.
msg
.
ToString
());
if
(!
TenantModule
.
CheckMobilePhoneModule
(
extModel
))
{
return
ApiResult
.
Failed
(
message
:
"此手机号码不存在!"
);
}
var
flag
=
TenantModule
.
UpdateTenantPwdModule
(
extModel
);
return
flag
?
ApiResult
.
Success
(
data
:
extModel
)
:
ApiResult
.
Failed
();
}
/// <summary>
/// 添加修改小程序
/// </summary>
/// <returns></returns>
public
ApiResult
SetMiniPrograme
()
{
var
extModel
=
JsonConvert
.
DeserializeObject
<
RB_MiniProgram_Extend
>(
RequestParm
.
msg
.
ToString
());
var
flag
=
programModule
.
SetMiniProgramModule
(
extModel
);
Int32
.
TryParse
(
RequestParm
.
uid
.
ToString
(),
out
int
TenantId
);
extModel
.
TenantId
=
TenantId
;
return
flag
?
ApiResult
.
Success
(
data
:
extModel
)
:
ApiResult
.
Failed
();
}
/// <summary>
/// 获取小程序信息
/// </summary>
/// <returns></returns>
public
ApiResult
GetMiniPrograme
()
{
return
ApiResult
.
Failed
();
}
/// <summary>
/// 获取小程序分页列表
/// </summary>
/// <returns></returns>
public
ApiResult
GetMiniProgramePage
()
{
ResultPageModel
pageModel
=
JsonConvert
.
DeserializeObject
<
ResultPageModel
>(
RequestParm
.
msg
.
ToString
());
var
query
=
JsonConvert
.
DeserializeObject
<
RB_MiniProgram_Extend
>(
RequestParm
.
msg
.
ToString
());
var
list
=
programModule
.
GetMiniProgramPageListModule
(
pageModel
.
pageIndex
,
pageModel
.
pageSize
,
out
long
rowsCount
,
query
);
pageModel
.
count
=
Convert
.
ToInt32
(
rowsCount
);
pageModel
.
pageData
=
list
;
return
ApiResult
.
Success
(
data
:
pageModel
);
}
}
}
\ No newline at end of file
Mall.WebApi/Mall.WebApi.csproj.user
View file @
52ef1c45
...
...
@@ -9,6 +9,6 @@
<WebStackScaffolding_IsReferencingScriptLibrariesSelected>
True
</WebStackScaffolding_IsReferencingScriptLibrariesSelected>
<WebStackScaffolding_LayoutPageFile
/>
<WebStackScaffolding_IsAsyncSelected>
False
</WebStackScaffolding_IsAsyncSelected>
<NameOfLastUsedPublishProfile>
CustomProfile
</NameOfLastUsedPublishProfile>
<NameOfLastUsedPublishProfile>
mall.oytour.com
</NameOfLastUsedPublishProfile>
</PropertyGroup>
</Project>
\ No newline at end of file
Mall.WebApi/Properties/PublishProfiles/CustomProfile.pubxml
deleted
100644 → 0
View file @
4303516c
<?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.WebApi/Properties/PublishProfiles/CustomProfile.pubxml.user
deleted
100644 → 0
View file @
4303516c
<?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