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
f8be81dd
Commit
f8be81dd
authored
Jun 16, 2021
by
吴春
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交代码
parent
37091f2a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
85 additions
and
6 deletions
+85
-6
UserModule.cs
Mall.Module.User/UserModule.cs
+50
-5
AppletLoginController.cs
Mall.WebApi/Controllers/User/AppletLoginController.cs
+1
-1
AppletUserController.cs
Mall.WebApi/Controllers/User/AppletUserController.cs
+34
-0
No files found.
Mall.Module.User/UserModule.cs
View file @
f8be81dd
...
...
@@ -208,7 +208,7 @@ namespace Mall.Module.User
private
readonly
Repository
.
TradePavilion
.
RB_CompanyRepository
companyRepository
=
new
Repository
.
TradePavilion
.
RB_CompanyRepository
();
private
readonly
Repository
.
Education
.
RB_Education_BaseInfoRepository
education_BaseInfoRepository
=
new
Repository
.
Education
.
RB_Education_BaseInfoRepository
();
private
readonly
Repository
.
Education
.
Rb_Education_SchoolRepository
education_SchoolRepository
=
new
Repository
.
Education
.
Rb_Education_SchoolRepository
();
#
region
基础配置
/// <summary>
...
...
@@ -4873,7 +4873,7 @@ namespace Mall.Module.User
messageNum
=
MessageNum
,
openOfflineEarnings
=
OpenOfflineEarnings
,
isAttestationEdu
=
(
eduBaseInfo
!=
null
&&
eduBaseInfo
.
StudentId
>
0
)
?
1
:
0
,
Sexedu
=
(
eduBaseInfo
!=
null
&&
eduBaseInfo
.
Id
>
0
)
?
eduBaseInfo
.
Sex
:
0
,
Sexedu
=
(
eduBaseInfo
!=
null
&&
eduBaseInfo
.
Id
>
0
)
?
eduBaseInfo
.
Sex
:
0
,
};
}
return
objData
;
...
...
@@ -6004,7 +6004,7 @@ namespace Mall.Module.User
int
IsNormalServer
=
Convert
.
ToInt32
(
new
ConfigurationBuilder
().
Add
(
new
JsonConfigurationSource
{
Path
=
"appsettings.json"
}).
Build
().
GetSection
(
"IsNormalServer"
).
Value
);
if
(
IsNormalServer
!=
1
)
{
token
=
"46_
01sFR99p0-s3mWH1RZrwT7dYMWoHelRyygi6ic07xS_cU2jDuZZ7w22IqiUzStUwa8Acy84oVByIsCIFjpF-FIbLdvb6Y9bQvBl4osyxQWcj5oTZZdrRyWQe6K7gVi21KWqEwwZ-9SEy7QnCYIXiAAAGQF
"
;
token
=
"46_
_bXdCmXKR-3O68ayCYYCJd9KIYUFD-5IkiYJHlJb7ORV7PfpNPp7Csf9KcwMAU42oDaRFfj__NI_N8ZI3_-RqTMeDq9UM3pU1k7ceBAg1miucYcwtwj0UAMx1j_NWkwX3AoMeGdVhA9GWcXaKVTfABADOM
"
;
}
if
(
string
.
IsNullOrEmpty
(
token
))
{
...
...
@@ -6088,7 +6088,7 @@ namespace Mall.Module.User
int
IsNormalServer
=
Convert
.
ToInt32
(
new
ConfigurationBuilder
().
Add
(
new
JsonConfigurationSource
{
Path
=
"appsettings.json"
}).
Build
().
GetSection
(
"IsNormalServer"
).
Value
);
if
(
IsNormalServer
!=
1
)
{
token
=
"46_
01sFR99p0-s3mWH1RZrwT7dYMWoHelRyygi6ic07xS_cU2jDuZZ7w22IqiUzStUwa8Acy84oVByIsCIFjpF-FIbLdvb6Y9bQvBl4osyxQWcj5oTZZdrRyWQe6K7gVi21KWqEwwZ-9SEy7QnCYIXiAAAGQF
"
;
token
=
"46_
_bXdCmXKR-3O68ayCYYCJd9KIYUFD-5IkiYJHlJb7ORV7PfpNPp7Csf9KcwMAU42oDaRFfj__NI_N8ZI3_-RqTMeDq9UM3pU1k7ceBAg1miucYcwtwj0UAMx1j_NWkwX3AoMeGdVhA9GWcXaKVTfABADOM
"
;
}
if
(
string
.
IsNullOrEmpty
(
token
))
{
...
...
@@ -6120,9 +6120,54 @@ namespace Mall.Module.User
/// <summary>
/// 获取微店小程序码
/// </summary>
/// <param name="path"></param>
/// <param name="width"></param>
/// <param name="mallBaseId"></param>
/// <param name="EduSchoolId"></param>
/// <returns></returns>
public
string
GetWeiXinQRCodeForSchool
(
string
path
,
int
width
,
int
mallBaseId
,
int
EduSchoolId
)
{
var
appletWeChatModel
=
miniProgramRepository
.
GetEntity
(
mallBaseId
);
string
token
=
CacheManager
.
AppletWeChat
.
WeiXinReidsCache
.
Get
(
appletWeChatModel
.
MiniAppId
);
int
IsNormalServer
=
Convert
.
ToInt32
(
new
ConfigurationBuilder
().
Add
(
new
JsonConfigurationSource
{
Path
=
"appsettings.json"
}).
Build
().
GetSection
(
"IsNormalServer"
).
Value
);
if
(
IsNormalServer
!=
1
)
{
token
=
"46__bXdCmXKR-3O68ayCYYCJd9KIYUFD-5IkiYJHlJb7ORV7PfpNPp7Csf9KcwMAU42oDaRFfj__NI_N8ZI3_-RqTMeDq9UM3pU1k7ceBAg1miucYcwtwj0UAMx1j_NWkwX3AoMeGdVhA9GWcXaKVTfABADOM"
;
}
if
(
string
.
IsNullOrEmpty
(
token
))
{
token
=
Mall
.
Common
.
Pay
.
WeChatPat
.
TokenHelper
.
GetLXYToken
(
token
,
appletWeChatModel
.
MiniAppId
,
appletWeChatModel
.
MiniAppSecret
);
System
.
Threading
.
Tasks
.
Task
.
Run
(()
=>
CacheManager
.
AppletWeChat
.
WeiXinReidsCache
.
Set
(
appletWeChatModel
.
MiniAppId
,
token
));
}
if
(!
string
.
IsNullOrEmpty
(
token
))
{
//string GetImageUrl = "https://api.weixin.qq.com/cgi-bin/wxaapp/createwxaqrcode?access_token=" + token;//获取二维码
string
GetImageUrl
=
"https://api.weixin.qq.com/wxa/getwxacode?access_token="
+
token
;
//获取小程序码
var
postData
=
new
{
path
,
width
};
string
pathName
=
Guid
.
NewGuid
().
ToString
()
+
".jpg"
;
string
basepath
=
AppContext
.
BaseDirectory
;
string
path_server
=
basepath
+
"\\upfile\\temporary\\"
+
pathName
;
#
region
微店头像
var
ssmodel
=
education_SchoolRepository
.
GetEducationSchoolList
(
new
Mall
.
Model
.
Extend
.
Education
.
Rb_Education_School_Extend
()
{
MallBaseId
=
mallBaseId
,
Id
=
EduSchoolId
}).
FirstOrDefault
();
string
ssPhoto
=
ssmodel
?.
CoverPhoto
??
""
;
#
endregion
var
Robj
=
HttpHelper
.
HttpPostForGetWXQRCodePathSmallShops
(
GetImageUrl
,
JsonHelper
.
Serialize
(
postData
),
path_server
,
ssPhoto
);
return
"/upfile/temporary/"
+
pathName
;
}
return
""
;
}
#
endregion
...
...
Mall.WebApi/Controllers/User/AppletLoginController.cs
View file @
f8be81dd
...
...
@@ -55,7 +55,7 @@ namespace Mall.WebApi.Controllers.User
{
var
requestParm
=
JsonConvert
.
DeserializeObject
<
RequestParm
>(
requestMsg
.
ToString
());
JObject
parms
=
JObject
.
Parse
(
requestParm
.
msg
.
ToString
());
LogHelper
.
WriteInfo
(
"登录请求数据:"
+
requestParm
.
msg
.
ToString
());
//
LogHelper.WriteInfo("登录请求数据:" + requestParm.msg.ToString());
RB_Member_User_Extend
demodel
=
new
RB_Member_User_Extend
()
{
Source
=
(
UserSourceEnum
)
parms
.
GetInt
(
"Source"
),
...
...
Mall.WebApi/Controllers/User/AppletUserController.cs
View file @
f8be81dd
...
...
@@ -1549,6 +1549,40 @@ namespace Mall.WebApi.Controllers.User
string
base64Img
=
userModule
.
GetWeiXinQRCodeForSmallShops
(
Path
,
With
,
userInfo
.
MallBaseId
,
userInfo
.
UserId
);
return
ApiResult
.
Success
(
""
,
base64Img
);
}
/// <summary>
/// 获取微信小程序码(学校)
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetWeiXinQRCodeForAppletSchool
()
{
var
req
=
RequestParm
;
var
userInfo
=
AppletUserInfo
;
JObject
parms
=
JObject
.
Parse
(
req
.
msg
.
ToString
());
string
Path
=
parms
.
GetStringValue
(
"Path"
);
//路径
int
With
=
parms
.
GetInt
(
"With"
,
430
);
//大小
int
EduSchoolId
=
parms
.
GetInt
(
"EduSchoolId"
,
0
);
//大小
if
(
string
.
IsNullOrEmpty
(
Path
))
{
return
ApiResult
.
ParamIsNull
(
"请传递路径"
);
}
if
(
EduSchoolId
>
0
)
{
string
base64Img
=
userModule
.
GetWeiXinQRCodeForSchool
(
Path
,
With
,
userInfo
.
MallBaseId
,
EduSchoolId
);
return
ApiResult
.
Success
(
""
,
base64Img
);
}
else
{
string
base64Img
=
userModule
.
GetWeiXinQRCode
(
Path
,
With
,
userInfo
.
MallBaseId
);
return
ApiResult
.
Success
(
""
,
base64Img
);
}
}
#
endregion
#
region
获取分销海报
...
...
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