Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
fusionapi
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
林洽文
fusionapi
Commits
99a53377
Commit
99a53377
authored
May 18, 2023
by
zazaname
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修正登录保存的信息
parent
212d689d
Pipeline
#11104
passed with stage
in 0 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
9 deletions
+12
-9
LoginService.php
app/Http/Service/LoginService.php
+12
-9
No files found.
app/Http/Service/LoginService.php
View file @
99a53377
...
@@ -53,35 +53,38 @@ class LoginService
...
@@ -53,35 +53,38 @@ class LoginService
}
}
// 判断用户是否存在,appid为CP的appid
// 判断用户是否存在,appid为CP的appid
$userInfo
=
DB
::
table
(
'app_member'
)
->
where
([
'app_id'
=>
$params
[
'app_id'
],
'uname'
=>
$loginInfo
[
'uname'
]])
->
first
();
$userInfo
=
DB
::
table
(
'app_member'
)
->
where
([
'app_id'
=>
$params
[
'app_id'
],
'uname'
=>
$loginInfo
[
'uname'
]])
->
first
();
$curr_time
=
date
(
'Y-m-d H:i:s'
);
if
(
is_null
(
$userInfo
))
{
if
(
is_null
(
$userInfo
))
{
//保存聚合用户的信息并返回token
//保存聚合用户的信息并返回token
$uid
=
DB
::
table
(
'app_member'
)
->
insertGetId
([
DB
::
table
(
'app_member'
)
->
insert
([
'uname'
=>
$loginInfo
[
'uname'
],
'uname'
=>
$loginInfo
[
'uname'
],
'veruniqid'
=>
$loginInfo
[
'ver_user_id'
],
'veruniqid'
=>
$loginInfo
[
'ver_user_id'
],
'app_id'
=>
$params
[
'app_id'
],
'app_id'
=>
$params
[
'app_id'
],
'ver'
=>
$params
[
'ctype'
]
??
''
,
'ver'
=>
$params
[
'ctype'
]
??
''
,
'reg_ip'
=>
CommonFunc
::
getTrustedProxiesIp
(),
'reg_ip'
=>
CommonFunc
::
getTrustedProxiesIp
(),
'reg_time'
=>
date
(
'Y-m-d H:i:s'
)
,
'reg_time'
=>
$curr_time
,
'login_time'
=>
date
(
'Y-m-d H:i:s'
)
,
'login_time'
=>
$curr_time
,
'login_ip'
=>
CommonFunc
::
getTrustedProxiesIp
(),
'login_ip'
=>
CommonFunc
::
getTrustedProxiesIp
(),
'add_time'
=>
date
(
'Y-m-d H:i:s'
)
'add_time'
=>
$curr_time
]);
]);
}
else
{
}
else
{
// 更新登录信息
// 更新登录信息
DB
::
table
(
'app_member'
)
->
where
([
'uname'
=>
$loginInfo
[
'uname'
],
'app_id'
=>
$gameInfo
->
app_id
])
->
update
([
DB
::
table
(
'app_member'
)
->
where
([
'uname'
=>
$loginInfo
[
'uname'
],
'app_id'
=>
$gameInfo
->
app_id
])
->
update
([
'login_time'
=>
date
(
'Y-m-d H:i:s'
)
,
'login_time'
=>
$curr_time
,
'login_ip'
=>
CommonFunc
::
getTrustedProxiesIp
()
'login_ip'
=>
CommonFunc
::
getTrustedProxiesIp
()
]);
]);
}
}
// 获取用户注册渠道,时间
$userInfo
=
DB
::
table
(
'app_member'
)
->
where
([
'app_id'
=>
$params
[
'app_id'
],
'uname'
=>
$loginInfo
[
'uname'
]])
->
first
();
// 保存登录日志
// 保存登录日志
DB
::
table
(
'app_memberloginlog'
)
->
insert
([
DB
::
table
(
'app_memberloginlog'
)
->
insert
([
'uid'
=>
$u
id
??
$u
serInfo
->
uid
,
'uid'
=>
$userInfo
->
uid
,
'uname'
=>
$loginInfo
[
'uname'
],
'uname'
=>
$loginInfo
[
'uname'
],
'reg_ver'
=>
$
params
[
'ctype'
]
??
''
,
'reg_ver'
=>
$
userInfo
->
ver
,
'reg_time'
=>
date
(
'Y-m-d H:i:s'
)
,
'reg_time'
=>
$userInfo
->
reg_time
,
'appid'
=>
$params
[
'app_id'
],
'appid'
=>
$params
[
'app_id'
],
'login_ver'
=>
$params
[
'ctype'
]
??
''
,
'login_ver'
=>
$params
[
'ctype'
]
??
''
,
'login_time'
=>
date
(
'Y-m-d H:i:s'
)
,
'login_time'
=>
$curr_time
,
'login_ip'
=>
CommonFunc
::
getTrustedProxiesIp
()
'login_ip'
=>
CommonFunc
::
getTrustedProxiesIp
()
]);
]);
// 产生一个token ,存redis ,有效期5分钟
// 产生一个token ,存redis ,有效期5分钟
...
...
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