Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tl_estate
Project
Project
Details
Activity
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
hujun
tl_estate
Commits
a8c0f501
Commit
a8c0f501
authored
Mar 15, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
登录修改
parent
7555b249
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
15 deletions
+13
-15
Broker.php
application/api_broker/controller/Broker.php
+10
-10
Basic.php
application/api_broker/extend/Basic.php
+3
-5
No files found.
application/api_broker/controller/Broker.php
View file @
a8c0f501
...
...
@@ -45,20 +45,20 @@ class Broker extends Basic
$agents_data
=
$this
->
a_agents
->
getInfo
(
$this
->
params
[
'phone'
],
$this
->
params
[
'pwd'
]);
if
(
isset
(
$agents_data
->
id
)
&&
(
$agents_data
->
status
==
0
))
{
if
(
$agents_data
->
password
==
md5
(
$this
->
params
[
'pwd'
]))
{
$agents_data
->
last_login_ip
=
ip2long
(
$this
->
request
->
ip
());
$agents_data
->
last_login_time
=
date
(
'Y-m-d H:i:s'
);
if
(
isset
(
$agents_data
[
'id'
])
&&
(
$agents_data
[
'status'
]
==
0
))
{
if
(
$agents_data
[
'password'
]
==
md5
(
$this
->
params
[
'pwd'
]))
{
$agents_data
[
'last_login_ip'
]
=
ip2long
(
$this
->
request
->
ip
());
$agents_data
[
'last_login_time'
]
=
date
(
'Y-m-d H:i:s'
);
$agents_data
->
allowField
(
true
)
->
save
();
if
(
$agents_data
->
img
)
{
$agents_data
->
img
=
AGENTHEADERIMGURL
.
$agents_data
->
img
;
if
(
!
empty
(
$agents_data
[
'img'
])
)
{
$agents_data
[
'img'
]
=
AGENTHEADERIMGURL
.
$agents_data
->
img
;
}
$jwt_data
[
'id'
]
=
$agents_data
->
id
;
$jwt_data
[
'name'
]
=
$agents_data
->
name
;
$jwt_data
[
'phone'
]
=
$agents_data
->
phone
;
$jwt_data
[
'level'
]
=
$agents_data
->
level
;
$jwt_data
[
'id'
]
=
$agents_data
[
'id'
]
;
$jwt_data
[
'name'
]
=
$agents_data
[
'name'
]
;
$jwt_data
[
'phone'
]
=
$agents_data
[
'phone'
]
;
$jwt_data
[
'level'
]
=
$agents_data
[
'level'
]
;
$jwt
=
new
JwtUntils
();
$data
[
'data'
]
=
$agents_data
->
getData
();
...
...
application/api_broker/extend/Basic.php
View file @
a8c0f501
...
...
@@ -71,11 +71,10 @@ class Basic extends Controller
$jwt
=
new
\Firebase\JWT\JWT
();
$this
->
authToken
=
$this
->
params
[
'AuthToken'
];
$result
=
$jwt
->
decode
(
$this
->
authToken
,
config
(
'jwt_key'
),
array
(
'HS256'
));
//解码token
$this
->
userId
=
$result
->
data
->
id
;
$this
->
agentId
=
$result
->
data
->
id
;
$this
->
phone
=
$result
->
data
->
phone
;
$this
->
userNick
=
$result
->
data
->
userNick
;
$this
->
name
=
$result
->
data
->
name
;
$this
->
timeStamp_
=
$result
->
timeStamp_
;
unset
(
$this
->
params
[
"AuthToken"
]);
}
$requestPath
=
$this
->
request
->
routeInfo
()[
"rule"
][
0
]
.
"/"
.
$this
->
request
->
routeInfo
()[
"rule"
][
1
];
...
...
@@ -83,8 +82,7 @@ class Basic extends Controller
if
(
!
in_array
(
trim
(
$requestPath
),
$this
->
filterVerify
))
{
$this
->
tokenVerify
();
}
unset
(
$this
->
params
[
"AuthToken"
]);
}
/**
...
...
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