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
1fdc3aa7
Commit
1fdc3aa7
authored
Jun 05, 2020
by
liudong1993
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/Kui2/mall.oytour.com
parents
ce1add48
333a57de
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
108 additions
and
43 deletions
+108
-43
Config.cs
Mall.Common/Config.cs
+11
-0
TokenHelper.cs
Mall.Common/Pay/WeChatPat/TokenHelper.cs
+0
-1
WeiXinHelper.cs
Mall.Common/Plugin/WeiXinHelper.cs
+35
-8
RB_ClientBankAccountRepository.cs
Mall.Repository/Finance/RB_ClientBankAccountRepository.cs
+37
-33
RB_Member_IntegralRepository.cs
Mall.Repository/User/RB_Member_IntegralRepository.cs
+1
-1
MallController.cs
Mall.WebApi/Controllers/Mall/MallController.cs
+23
-0
appsettings.json
Mall.WebApi/appsettings.json
+1
-0
No files found.
Mall.Common/Config.cs
View file @
1fdc3aa7
...
@@ -353,5 +353,16 @@ namespace Mall.Common
...
@@ -353,5 +353,16 @@ namespace Mall.Common
}
}
}
}
/// <summary>
/// 数据库地址
/// </summary>
public
static
string
RebornDMC
{
get
{
return
new
ConfigurationBuilder
().
Add
(
new
JsonConfigurationSource
{
Path
=
"appsettings.json"
}).
Build
().
GetSection
(
"RebornDMC"
).
Value
;
}
}
}
}
}
}
\ No newline at end of file
Mall.Common/Pay/WeChatPat/TokenHelper.cs
View file @
1fdc3aa7
...
@@ -49,7 +49,6 @@ namespace Mall.Common.Pay.WeChatPat
...
@@ -49,7 +49,6 @@ namespace Mall.Common.Pay.WeChatPat
{
{
openid
=
openid
.
Replace
(
"/t"
,
""
);
openid
=
openid
.
Replace
(
"/t"
,
""
);
string
url
=
"https://api.weixin.qq.com/cgi-bin/user/info?access_token="
+
access_token
+
"&openid="
+
openid
+
"&lang=zh_CN"
;
string
url
=
"https://api.weixin.qq.com/cgi-bin/user/info?access_token="
+
access_token
+
"&openid="
+
openid
+
"&lang=zh_CN"
;
//string url = "https://api.weixin.qq.com/sns/userinfo?access_token=" + access_token + "&openid=" + openid + "&lang=zh_CN";
string
type
=
"utf-8"
;
string
type
=
"utf-8"
;
Mall
.
Common
.
Plugin
.
GetUsersHelper
GetUsersHelper
=
new
Mall
.
Common
.
Plugin
.
GetUsersHelper
();
Mall
.
Common
.
Plugin
.
GetUsersHelper
GetUsersHelper
=
new
Mall
.
Common
.
Plugin
.
GetUsersHelper
();
string
wenXinResult
=
string
.
Empty
;
string
wenXinResult
=
string
.
Empty
;
...
...
Mall.Common/Plugin/WeiXinHelper.cs
View file @
1fdc3aa7
using
System
;
using
Newtonsoft.Json.Linq
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.IO
;
using
System.Net
;
using
System.Text
;
using
System.Text
;
using
System.Xml
;
using
System.Xml
;
namespace
Mall.Common.Plugin
namespace
Mall.Common.Plugin
{
{
public
class
WeiXinHelper
public
class
WeiXinHelper
{
{
/// <summary>
/// 获取微信用户OpenId
/// </summary>
/// <param name="AppId"></param>
/// <param name="AppSecret"></param>
/// <param name="Code"></param>
/// <returns></returns>
public
static
string
GetWeChatOpenId
(
string
AppId
,
string
AppSecret
,
string
Code
)
{
string
result
=
""
;
string
openid
=
""
;
try
{
//请求路径
string
url
=
"https://api.weixin.qq.com/sns/jscode2session?appid="
+
AppId
+
"&secret="
+
AppSecret
+
"&js_code="
+
Code
+
"&grant_type=authorization_code"
;
result
=
Common
.
Plugin
.
HttpHelper
.
HttpGet
(
url
);
if
(
result
!=
null
&&
!
string
.
IsNullOrEmpty
(
result
))
{
JObject
jObj
=
JObject
.
Parse
(
result
);
openid
=
jObj
[
"openid"
].
ToString
();
}
}
catch
(
Exception
ex
)
{
Common
.
Plugin
.
LogHelper
.
Write
(
ex
,
"GetWeChatOpenId:result="
+
result
);
}
return
openid
;
}
}
}
/// <summary>
/// <summary>
...
@@ -170,7 +199,7 @@ namespace Mall.Common.Plugin
...
@@ -170,7 +199,7 @@ namespace Mall.Common.Plugin
return
xml
;
return
xml
;
}
}
public
SortedDictionary
<
string
,
object
>
NoSignFromXml
(
string
xml
)
public
SortedDictionary
<
string
,
object
>
NoSignFromXml
(
string
xml
)
{
{
...
@@ -248,7 +277,5 @@ namespace Mall.Common.Plugin
...
@@ -248,7 +277,5 @@ namespace Mall.Common.Plugin
//_logger.LogError(this.GetType().ToString(), "WxPayData签名验证错误!");
//_logger.LogError(this.GetType().ToString(), "WxPayData签名验证错误!");
throw
new
Exception
(
"WxPayData签名验证错误!"
);
throw
new
Exception
(
"WxPayData签名验证错误!"
);
}
}
}
}
}
}
Mall.Repository/Finance/RB_ClientBankAccountRepository.cs
View file @
1fdc3aa7
This diff is collapsed.
Click to expand it.
Mall.Repository/User/RB_Member_IntegralRepository.cs
View file @
1fdc3aa7
...
@@ -43,7 +43,7 @@ namespace Mall.Repository.User
...
@@ -43,7 +43,7 @@ namespace Mall.Repository.User
}
}
if
(
dmodel
.
Type
>
0
)
if
(
dmodel
.
Type
>
0
)
{
{
where
+=
$@" and
{
nameof
(
RB_Member_Integral
.
Type
)}
=
{
dmodel
.
Type
}
"
;
where
+=
$@" and
{
nameof
(
RB_Member_Integral
.
Type
)}
=
{
(
int
)
dmodel
.
Type
}
"
;
}
}
if
(
dmodel
.
UserId
>
0
)
if
(
dmodel
.
UserId
>
0
)
{
{
...
...
Mall.WebApi/Controllers/Mall/MallController.cs
View file @
1fdc3aa7
...
@@ -2162,5 +2162,28 @@ namespace Mall.WebApi.Controllers.MallBase
...
@@ -2162,5 +2162,28 @@ namespace Mall.WebApi.Controllers.MallBase
return
ApiResult
.
Failed
(
message
:
"请获取用户OpenId"
);
return
ApiResult
.
Failed
(
message
:
"请获取用户OpenId"
);
}
}
}
}
/// <summary>
/// 获取用户信息
/// </summary>
/// <returns></returns>
[
HttpGet
]
[
HttpPost
]
[
AllowAnonymous
]
public
ApiResult
GetWeChatOpenId
()
{
JObject
parms
=
JObject
.
Parse
(
RequestParm
.
msg
.
ToString
());
string
code
=
parms
.
GetStringValue
(
"Code"
);
string
openId
=
""
;
if
(
RequestParm
.
MiniAppId
!=
null
&&
!
string
.
IsNullOrWhiteSpace
(
RequestParm
.
MiniAppId
))
{
var
miniProgram
=
programModule
.
GetMiniProgramModule
(
new
Model
.
Extend
.
User
.
RB_MiniProgram_Extend
()
{
MiniAppId
=
RequestParm
.
MiniAppId
});
if
(
miniProgram
!=
null
&&
miniProgram
.
MallBaseId
>
0
)
{
openId
=
Common
.
Plugin
.
WeiXinHelper
.
GetWeChatOpenId
(
miniProgram
.
MiniAppId
,
miniProgram
.
MiniAppSecret
,
code
);
}
}
return
ApiResult
.
Success
(
data
:
openId
);
}
}
}
}
}
\ No newline at end of file
Mall.WebApi/appsettings.json
View file @
1fdc3aa7
...
@@ -29,6 +29,7 @@
...
@@ -29,6 +29,7 @@
"ByteDanceSendTemplate"
:
"https://developer.toutiao.com/api/apps/game/template/send"
,
"ByteDanceSendTemplate"
:
"https://developer.toutiao.com/api/apps/game/template/send"
,
"sTenpayNotify"
:
"http://mallapi.oytour.com/api/WeChatNotify/Notify"
,
//微信回调地址
"sTenpayNotify"
:
"http://mallapi.oytour.com/api/WeChatNotify/Notify"
,
//微信回调地址
"NetworkDirector"
:
1756
,
//网络主管的id,用于新建供应商账户的时候的创建人
"NetworkDirector"
:
1756
,
//网络主管的id,用于新建供应商账户的时候的创建人
"RebornDMC"
:
"reborn_dmc"
,
"RedisSetting"
:
{
"RedisSetting"
:
{
"RedisServer"
:
"192.168.2.214"
,
"RedisServer"
:
"192.168.2.214"
,
"RedisPort"
:
"6379"
,
"RedisPort"
:
"6379"
,
...
...
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