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
b503eb25
Commit
b503eb25
authored
Jun 15, 2018
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug
parent
e458efbf
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
6 deletions
+24
-6
WxSdk.php
application/api/controller/WxSdk.php
+24
-6
No files found.
application/api/controller/WxSdk.php
View file @
b503eb25
...
...
@@ -12,6 +12,7 @@ namespace app\api\controller;
*/
use
app\api\extend\Basic
;
use
app\api\untils\JwtUntils
;
use
app\model\Users
;
use
app\model\UWxInfo
;
use
think\Exception
;
...
...
@@ -65,14 +66,31 @@ class WxSdk extends Basic
return
$this
->
response
(
"101"
,
"request error:"
.
$exception
);
}
$conditions
[
"buyer_id"
]
=
$id
;
$fields
=
"id"
;
$fields
=
"id
,user_nick,user_phone,user_pic,other_pic
"
;
$user_info
=
$this
->
userModel
->
getUserByWhere
(
$conditions
,
$fields
);
$user_id
=
0
;
if
(
count
(
$user_info
)
>
0
)
{
//如果绑定了直接返回用户数据,无需帐号验证码登录
if
(
$id
>
0
&&
count
(
$user_info
)
>
0
)
{
$user_id
=
$user_info
[
0
][
'id'
];
}
if
(
$id
>
0
)
{
return
$this
->
response
(
"200"
,
"request success"
,
[
"user_id"
=>
$user_id
]);
$user_nick
=
$user_info
[
0
][
'user_nick'
];
$user_phone
=
$user_info
[
0
][
'user_phone'
];
$user_pic
=
$user_info
[
0
][
"user_pic"
];
$other_pic
=
$user_info
[
0
][
"other_pic"
];
$jwt_data
[
'id'
]
=
$user_id
;
$jwt_data
[
'userNick'
]
=
$user_nick
;
$jwt_data
[
'phone'
]
=
$user_phone
;
$jwt
=
new
JwtUntils
();
$data
[
"id"
]
=
$user_id
;
$data
[
"user_nick"
]
=
$user_nick
;
$data
[
"user_phone"
]
=
$user_phone
;
$data
[
"user_pic"
]
=
!
empty
(
$user_pic
)
?
HEADERIMGURL
.
$user_pic
:
$other_pic
;
$data
[
"AuthToken"
]
=
$jwt
->
createToken
(
$jwt_data
);;
return
$this
->
response
(
"200"
,
"request success"
,
[
"data"
=>
$data
]);
}
elseif
(
$id
>
0
&&
count
(
$user_info
)
<=
0
)
{
return
$this
->
response
(
"200"
,
"request success"
,
[
"data"
=>
null
]);
}
else
{
return
$this
->
response
(
"101"
,
"request exception"
);
}
...
...
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