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
d7b7f0a5
Commit
d7b7f0a5
authored
Feb 08, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
经纪人登录
parent
ca6ddbbf
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
88 additions
and
0 deletions
+88
-0
config.php
application/api_broker/config.php
+10
-0
Broker.php
application/api_broker/controller/Broker.php
+76
-0
route.php
application/route.php
+2
-0
No files found.
application/api_broker/config.php
0 → 100644
View file @
d7b7f0a5
<?php
//配置文件
error_reporting
(
E_ERROR
|
E_PARSE
);
return
[
'jwt_key'
=>
'tonglian+123'
,
// 应用模式状态
'app_status'
=>
'dev-config'
,
];
\ No newline at end of file
application/api_broker/controller/Broker.php
0 → 100644
View file @
d7b7f0a5
<?php
/**
* Created by PhpStorm.
* User: hu jun
* Date: 2018/2/8
* Time: 16:59
*/
namespace
app\api_broker\controller
;
use
app\api\untils\JwtUntils
;
use
app\api_broker\extend\Basic
;
use
app\model\AAgents
;
use
think\Request
;
class
Broker
extends
Basic
{
protected
$a_agents
;
public
function
__construct
(
Request
$request
=
null
)
{
parent
::
__construct
(
$request
);
$this
->
a_agents
=
new
AAgents
();
}
/**
* 经纪人登录
*
* @return \think\Response
* @throws \think\exception\DbException
*/
public
function
login
()
{
$data
[
'data'
]
=
array
();
$data
[
'status'
]
=
101
;
if
(
$this
->
params
[
'phone'
]
&&
$this
->
params
[
'pwd'
])
{
$agents_data
=
$this
->
a_agents
->
get
([
'phone'
=>
$this
->
params
[
'phone'
],
'status'
=>
0
]);
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
->
save
();
if
(
$agents_data
->
img
)
{
$agents_data
->
img
=
HEADERIMGURL
.
$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
=
new
JwtUntils
();
$data
[
'data'
]
=
$agents_data
->
getData
();
$data
[
'data'
][
'last_login_ip'
]
=
long2ip
(
$data
[
'data'
][
'last_login_ip'
]);
$data
[
'data'
][
'AuthToken'
]
=
$jwt
->
createToken
(
$jwt_data
);
$data
[
'msg'
]
=
'登陆成功'
;
$data
[
'status'
]
=
200
;
}
else
{
$data
[
'msg'
]
=
'密码错误'
;
}
}
else
{
$data
[
'msg'
]
=
'没有该用户'
;
}
}
else
{
$data
[
'msg'
]
=
'用户名或密码为空'
;
}
return
$this
->
response
(
$data
[
'status'
],
$data
[
'msg'
],
$data
[
'data'
]);
}
}
\ No newline at end of file
application/route.php
View file @
d7b7f0a5
...
@@ -213,6 +213,7 @@ Route::group('broker', [
...
@@ -213,6 +213,7 @@ Route::group('broker', [
'refund'
=>
[
'api_broker/OrderLog/refund'
,
[
'method'
=>
'get|post'
]
],
'refund'
=>
[
'api_broker/OrderLog/refund'
,
[
'method'
=>
'get|post'
]
],
'bargain'
=>
[
'api_broker/OrderLog/bargain'
,
[
'method'
=>
'get|post'
]
],
'bargain'
=>
[
'api_broker/OrderLog/bargain'
,
[
'method'
=>
'get|post'
]
],
'statusBargain'
=>
[
'api_broker/OrderLog/statusBargain'
,
[
'method'
=>
'get|post'
]
],
'statusBargain'
=>
[
'api_broker/OrderLog/statusBargain'
,
[
'method'
=>
'get|post'
]
],
'login'
=>
[
'api_broker/Broker/login'
,
[
'method'
=>
'get'
]
],
]);
]);
//Route::miss('api/index/miss');//处理错误的url
//Route::miss('api/index/miss');//处理错误的url
\ No newline at end of file
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