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
3881566c
Commit
3881566c
authored
Dec 16, 2024
by
吴春
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
76f3da53
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
12 deletions
+17
-12
AppletLoginController.cs
Mall.WebApi/Controllers/User/AppletLoginController.cs
+17
-12
No files found.
Mall.WebApi/Controllers/User/AppletLoginController.cs
View file @
3881566c
...
...
@@ -26,6 +26,8 @@ using Mall.Module.BaseSetUp;
using
Mall.CacheManager.AppletWeChat
;
using
NPOI.SS.Formula.Functions
;
using
Mall.WeChat.Common
;
using
static
QRCoder
.
PayloadGenerator
;
using
NPOI.SS.Formula.PTG
;
namespace
Mall.WebApi.Controllers.User
{
...
...
@@ -970,23 +972,21 @@ namespace Mall.WebApi.Controllers.User
JObject
parms
=
JObject
.
Parse
(
requestParm
.
msg
.
ToString
());
if
(
requestParm
.
TenantId
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请传递商户号"
);
return
ApiResult
.
Success
(
"请传递商户号"
,
new
{
code
=
0
,
phoneNumber
=
""
,
purePhoneNumber
=
""
,
countryCode
=
""
}
);
}
if
(
requestParm
.
MallBaseId
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请传递小程序id"
);
return
ApiResult
.
Success
(
"请传递小程序id"
,
new
{
code
=
0
,
phoneNumber
=
""
,
purePhoneNumber
=
""
,
countryCode
=
""
}
);
}
var
mmodel
=
programModule
.
GetMiniProgramModule
(
new
RB_MiniProgram_Extend
()
{
MallBaseId
=
requestParm
.
MallBaseId
});
if
((
mmodel
?.
MallBaseId
??
0
)
==
0
)
{
return
ApiResult
.
Failed
(
"小程序基本信息获取失败"
);
return
ApiResult
.
Success
(
"小程序基本信息获取失败"
,
new
{
code
=
0
,
phoneNumber
=
""
,
purePhoneNumber
=
""
,
countryCode
=
""
}
);
}
string
code
=
parms
.
GetStringValue
(
"Code"
);
if
(
string
.
IsNullOrWhiteSpace
(
code
))
{
return
ApiResult
.
ParamIsNull
(
"请传递手机号获取凭证"
);
return
ApiResult
.
Success
(
"请传递手机号获取凭证"
,
new
{
code
=
0
,
phoneNumber
=
""
,
purePhoneNumber
=
""
,
countryCode
=
""
}
);
}
string
token
=
WeiXinReidsCache
.
Get
(
mmodel
.
MiniAppId
);
if
(
string
.
IsNullOrEmpty
(
token
))
...
...
@@ -996,19 +996,19 @@ namespace Mall.WebApi.Controllers.User
}
if
(
string
.
IsNullOrEmpty
(
token
))
{
return
ApiResult
.
Failed
(
"获取Token失败"
);
return
ApiResult
.
Success
(
"获取Token失败"
,
new
{
code
=
0
,
phoneNumber
=
""
,
purePhoneNumber
=
""
,
countryCode
=
""
}
);
}
string
url
=
"https://api.weixin.qq.com/wxa/business/getuserphonenumber?access_token="
+
token
;
var
obj
=
new
{
code
=
code
,
code
=
code
,
};
string
result
=
Common
.
Plugin
.
HttpHelper
.
HttpPostStr
(
url
,
JsonHelper
.
Serialize
(
obj
));
JObject
jObj
=
JObject
.
Parse
(
result
);
if
(!
string
.
IsNullOrWhiteSpace
(
result
))
{
JObject
jObj
=
JObject
.
Parse
(
result
);
string
errcode
=
jObj
[
"errcode"
].
ToString
();
if
(
errcode
==
"0"
)
{
...
...
@@ -1017,10 +1017,15 @@ namespace Mall.WebApi.Controllers.User
string
phoneNumber
=
phoneInfo
[
"phoneNumber"
].
ToString
();
string
purePhoneNumber
=
phoneInfo
[
"purePhoneNumber"
].
ToString
();
string
countryCode
=
phoneInfo
[
"countryCode"
].
ToString
();
return
ApiResult
.
Success
(
""
,
new
{
phoneNumber
,
purePhoneNumber
,
countryCode
});
return
ApiResult
.
Success
(
""
,
new
{
code
=
1
,
phoneNumber
,
purePhoneNumber
,
countryCode
});
}
else
{
string
errmsg
=
jObj
[
"errmsg"
].
ToString
();
return
ApiResult
.
Success
(
errmsg
,
new
{
code
=
0
,
phoneNumber
=
""
,
purePhoneNumber
=
""
,
countryCode
=
""
});
}
}
return
ApiResult
.
Failed
(
"获取手机号失败"
);
return
ApiResult
.
Success
(
"获取手机号失败"
,
new
{
code
=
0
,
phoneNumber
=
""
,
purePhoneNumber
=
""
,
countryCode
=
""
}
);
}
#
endregion
}
...
...
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