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
61244b1a
Commit
61244b1a
authored
Jun 15, 2018
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
h5获取微信授权
parent
01f79e98
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
10 deletions
+13
-10
Register.php
application/api/controller/Register.php
+2
-1
WxAuthorization.php
application/index/controller/WxAuthorization.php
+7
-5
test.html
application/index/view/wx_authorization/test.html
+0
-0
route.php
application/route.php
+4
-4
No files found.
application/api/controller/Register.php
View file @
61244b1a
...
@@ -50,7 +50,7 @@ class Register extends Basic
...
@@ -50,7 +50,7 @@ class Register extends Basic
}
}
$result
=
$this
->
messageUntil
->
sendCheckCodeV2
(
$params
[
'device_id'
],
$params
[
'phone'
]);
$result
=
$this
->
messageUntil
->
sendCheckCodeV2
(
$params
[
'device_id'
],
$params
[
'phone'
]);
if
(
$result
==
'true'
)
{
if
(
$result
==
'true'
)
{
return
$this
->
response
(
"200"
,
"
request success
"
,
$result
);
return
$this
->
response
(
"200"
,
"
短信发送成功
"
,
$result
);
}
else
{
}
else
{
return
$this
->
response
(
"101"
,
$result
);
return
$this
->
response
(
"101"
,
$result
);
}
}
...
@@ -58,6 +58,7 @@ class Register extends Basic
...
@@ -58,6 +58,7 @@ class Register extends Basic
}
}
/**
/**
* 邀请登录or app微信授权登录
* @return \think\Response
* @return \think\Response
*/
*/
public
function
registerVerify
()
public
function
registerVerify
()
...
...
application/index/controller/Wx
Test
.php
→
application/index/controller/Wx
Authorization
.php
View file @
61244b1a
...
@@ -13,15 +13,17 @@ use Think\Log;
...
@@ -13,15 +13,17 @@ use Think\Log;
* Time : 18:06
* Time : 18:06
* Intro:
* Intro:
*/
*/
class
Wx
Test
extends
Basic
class
Wx
Authorization
extends
Basic
{
{
private
$url
=
"https://pre2.tonglianjituan.com/index/
test
"
;
private
$url
=
"https://pre2.tonglianjituan.com/index/
getWxInfo
"
;
private
$_wxApi
;
private
$_wxApi
;
public
function
__construct
()
public
function
__construct
()
{
{
$this
->
_wxApi
=
new
WxCallbackUntils
();
$this
->
_wxApi
=
new
WxCallbackUntils
();
}
}
public
function
test
()
public
function
getWxInfo
()
{
{
$code
=
empty
(
$_GET
[
'code'
])
?
null
:
$_GET
[
'code'
];
$code
=
empty
(
$_GET
[
'code'
])
?
null
:
$_GET
[
'code'
];
...
@@ -29,9 +31,9 @@ class WxTest extends Basic
...
@@ -29,9 +31,9 @@ class WxTest extends Basic
if
(
!
$code
)
{
if
(
!
$code
)
{
$this
->
_wxApi
->
getWxCode
(
$this
->
url
);
$this
->
_wxApi
->
getWxCode
(
$this
->
url
);
}
else
{
}
else
{
$this
->
_wxApi
->
getUserInfoByAccessToken
(
$code
);
$this
->
_wxApi
->
getUserInfoByAccessToken
(
$code
);
Log
::
record
(
"session wx -----------------"
.
json_encode
(
$userInfo
),
"info"
);
Log
::
record
(
"session wx -----------------"
.
json_encode
(
$userInfo
),
"info"
);
if
(
!
$userInfo
)
{
if
(
!
$userInfo
)
{
$this
->
_wxApi
->
getWxCode
(
$this
->
url
);
$this
->
_wxApi
->
getWxCode
(
$this
->
url
);
}
else
{
}
else
{
...
...
application/index/view/wx_
test
/test.html
→
application/index/view/wx_
authorization
/test.html
View file @
61244b1a
File moved
application/route.php
View file @
61244b1a
...
@@ -242,7 +242,7 @@ Route::group('index', [
...
@@ -242,7 +242,7 @@ Route::group('index', [
'delNotice'
=>
[
'index/notice/delNotice'
,
[
'method'
=>
'POST'
]
],
//删除公告
'delNotice'
=>
[
'index/notice/delNotice'
,
[
'method'
=>
'POST'
]
],
//删除公告
'addNotice'
=>
[
'index/notice/addNotice'
,
[
'method'
=>
'POST'
]
],
//新增公告
'addNotice'
=>
[
'index/notice/addNotice'
,
[
'method'
=>
'POST'
]
],
//新增公告
'
test'
=>
[
'index/WxTest/test
'
,
[
'method'
=>
'POST|GET'
]
],
//wx
'
getWxInfo'
=>
[
'index/WxAuthorization/getWxInfo
'
,
[
'method'
=>
'POST|GET'
]
],
//wx
...
@@ -316,11 +316,11 @@ Route::group('api', [
...
@@ -316,11 +316,11 @@ Route::group('api', [
'getVersionNo'
=>
[
'api/Version/getVersionNo'
,
[
'method'
=>
'post|get'
]
],
'getVersionNo'
=>
[
'api/Version/getVersionNo'
,
[
'method'
=>
'post|get'
]
],
'saveWxInfo'
=>
[
'api/WxSdk/saveWxInfo'
,
[
'method'
=>
'POST
|get
'
]
],
//wx
'saveWxInfo'
=>
[
'api/WxSdk/saveWxInfo'
,
[
'method'
=>
'POST'
]
],
//wx
'bindUserId'
=>
[
'api/WxSdk/bindUserId'
,
[
'method'
=>
'POST|GET'
]
],
//wx
'bindUserId'
=>
[
'api/WxSdk/bindUserId'
,
[
'method'
=>
'POST|GET'
]
],
//wx
'sendCode'
=>
[
'api/Register/registerSendCode'
,
[
'method'
=>
'POST
|get
'
]
],
'sendCode'
=>
[
'api/Register/registerSendCode'
,
[
'method'
=>
'POST'
]
],
'userVerify'
=>
[
'api/Register/registerVerify'
,
[
'method'
=>
'POST
|get
'
]
],
'userVerify'
=>
[
'api/Register/registerVerify'
,
[
'method'
=>
'POST'
]
],
]);
]);
...
...
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