Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
TarsWeb
Commits
149d4dd3
Commit
149d4dd3
authored
5 years ago
by
ruanshudong
Browse files
Options
Download
Email Patches
Plain Diff
add validate log
parent
6a946d63
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
config/loginConf.js
+6
-5
config/loginConf.js
with
6 additions
and
5 deletions
+6
-5
config/loginConf.js
+
6
-
5
View file @
149d4dd3
...
...
@@ -14,6 +14,7 @@
* specific language governing permissions and limitations under the License.
*/
let
request
=
require
(
'
request-promise-any
'
);
const
logger
=
require
(
'
../app/logger
'
);
/**
* 登录配置
...
...
@@ -56,6 +57,8 @@ async function getUidByTicket(ctx, ticket){
return
new
Promise
((
resolve
,
reject
)
=>
{
try
{
request
.
get
(
'
http://localhost:3001/api/getUidByTicket?ticket=
'
+
ticket
).
then
(
uidInfo
=>
{
logger
.
info
(
ctx
.
url
,
'
getUidByTicket
'
,
ticket
,
uidInfo
);
uidInfo
=
JSON
.
parse
(
uidInfo
);
resolve
(
uidInfo
.
data
.
uid
);
}).
catch
(
err
=>
{
...
...
@@ -76,12 +79,10 @@ async function validate(ctx, uid, ticket){
return
new
Promise
((
resolve
,
reject
)
=>
{
try
{
request
.
get
(
'
http://localhost:3001/api/getUidByTicket?ticket=
'
+
ticket
).
then
(
uidInfo
=>
{
uidInfo
=
JSON
.
parse
(
uidInfo
);
// ticket也保存下来
if
(
uidInfo
.
data
.
uid
===
uid
)
{
ctx
.
ticket
=
ticket
;
}
logger
.
info
(
ctx
.
url
,
'
validate
'
,
ticket
,
uidInfo
);
uidInfo
=
JSON
.
parse
(
uidInfo
);
resolve
(
uidInfo
.
data
.
uid
===
uid
);
}).
catch
(
err
=>
{
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
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
Menu
Projects
Groups
Snippets
Help