Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
Education
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
黄奎
Education
Commits
c98e90b9
Commit
c98e90b9
authored
Oct 09, 2021
by
吴春
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
02325bd6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
3 deletions
+54
-3
AppletLoginController.cs
Edu.WebApi/Controllers/Applet/AppletLoginController.cs
+54
-3
No files found.
Edu.WebApi/Controllers/Applet/AppletLoginController.cs
View file @
c98e90b9
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Linq
;
using
System.Threading
;
using
System.Threading.Tasks
;
using
System.Threading.Tasks
;
using
Edu.Common
;
using
Edu.Common
;
using
Edu.Common.API
;
using
Edu.Common.API
;
...
@@ -229,6 +230,10 @@ namespace Edu.WebApi.Controllers.APP
...
@@ -229,6 +230,10 @@ namespace Edu.WebApi.Controllers.APP
string
account
=
jobj
.
GetStringValue
(
"Account"
);
string
account
=
jobj
.
GetStringValue
(
"Account"
);
string
UnionId
=
jobj
.
GetStringValue
(
"UnionId"
);
string
UnionId
=
jobj
.
GetStringValue
(
"UnionId"
);
string
OpenId
=
jobj
.
GetStringValue
(
"OpenId"
);
string
OpenId
=
jobj
.
GetStringValue
(
"OpenId"
);
if
(
string
.
IsNullOrEmpty
(
account
))
{
return
ApiResult
.
Failed
(
message
:
"请授权手机号码!"
,
new
{
Error
=
-
1
});
}
var
model
=
accountModule
.
GetStudentExt
(
new
RB_Account_ViewModel
()
var
model
=
accountModule
.
GetStudentExt
(
new
RB_Account_ViewModel
()
{
{
Account
=
account
.
Trim
(),
Account
=
account
.
Trim
(),
...
@@ -341,22 +346,68 @@ namespace Edu.WebApi.Controllers.APP
...
@@ -341,22 +346,68 @@ namespace Edu.WebApi.Controllers.APP
string
code
=
parms
.
GetStringValue
(
"code"
);
string
code
=
parms
.
GetStringValue
(
"code"
);
string
encryptedData
=
parms
.
GetStringValue
(
"encryptedData"
);
string
encryptedData
=
parms
.
GetStringValue
(
"encryptedData"
);
string
iv
=
parms
.
GetStringValue
(
"iv"
);
string
iv
=
parms
.
GetStringValue
(
"iv"
);
result
res
=
new
result
();
result
res
=
new
result
()
{
phoneNumber
=
""
,
openid
=
""
};
try
try
{
{
res
=
Common
.
Plugin
.
WeChatHelper
.
GetWechatMobile
(
encryptedData
,
code
,
iv
);
res
=
Common
.
Plugin
.
WeChatHelper
.
GetWechatMobile
(
encryptedData
,
code
,
iv
);
}
}
catch
catch
{
{
Common
.
Plugin
.
LogHelper
.
Write
(
"GetGuestWeiXinMobile:1"
+
Common
.
Plugin
.
JsonHelper
.
Serialize
(
res
));
try
{
res
=
Common
.
Plugin
.
WeChatHelper
.
GetWechatMobile
(
encryptedData
,
code
,
iv
);
}
catch
{
Common
.
Plugin
.
LogHelper
.
Write
(
"GetGuestWeiXinMobile:2"
+
Common
.
Plugin
.
JsonHelper
.
Serialize
(
res
));
}
}
if
(
res
.
phoneNumber
==
null
||
string
.
IsNullOrEmpty
(
res
.
phoneNumber
))
{
Thread
.
Sleep
(
10
);
try
try
{
{
res
=
Common
.
Plugin
.
WeChatHelper
.
GetWechatMobile
(
encryptedData
,
code
,
iv
);
res
=
Common
.
Plugin
.
WeChatHelper
.
GetWechatMobile
(
encryptedData
,
code
,
iv
);
}
}
catch
(
Exception
ex
)
catch
{
{
Common
.
Plugin
.
LogHelper
.
Write
(
ex
,
"GetGuestWeiXinMobile"
);
Common
.
Plugin
.
LogHelper
.
Write
(
"GetGuestWeiXinMobile:3"
+
Common
.
Plugin
.
JsonHelper
.
Serialize
(
res
));
try
{
res
=
Common
.
Plugin
.
WeChatHelper
.
GetWechatMobile
(
encryptedData
,
code
,
iv
);
}
catch
{
Common
.
Plugin
.
LogHelper
.
Write
(
"GetGuestWeiXinMobile:4"
+
Common
.
Plugin
.
JsonHelper
.
Serialize
(
res
));
}
}
}
if
(
res
.
phoneNumber
==
null
||
string
.
IsNullOrEmpty
(
res
.
phoneNumber
))
{
Thread
.
Sleep
(
10
);
try
{
res
=
Common
.
Plugin
.
WeChatHelper
.
GetWechatMobile
(
encryptedData
,
code
,
iv
);
}
catch
{
Common
.
Plugin
.
LogHelper
.
Write
(
"GetGuestWeiXinMobile:5"
+
Common
.
Plugin
.
JsonHelper
.
Serialize
(
res
));
try
{
res
=
Common
.
Plugin
.
WeChatHelper
.
GetWechatMobile
(
encryptedData
,
code
,
iv
);
}
catch
{
Common
.
Plugin
.
LogHelper
.
Write
(
"GetGuestWeiXinMobile:6"
+
Common
.
Plugin
.
JsonHelper
.
Serialize
(
res
));
}
}
}
}
}
Common
.
Plugin
.
LogHelper
.
Write
(
"GetGuestWeiXinMobile:7"
+
Common
.
Plugin
.
JsonHelper
.
Serialize
(
res
));
return
ApiResult
.
Success
(
""
,
res
);
return
ApiResult
.
Success
(
""
,
res
);
}
}
...
...
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