Commit 61244b1a authored by clone's avatar clone

h5获取微信授权

parent 01f79e98
......@@ -50,7 +50,7 @@ class Register extends Basic
}
$result = $this->messageUntil->sendCheckCodeV2($params['device_id'], $params['phone']);
if ($result == 'true') {
return $this->response("200", "request success", $result);
return $this->response("200", "短信发送成功", $result);
} else {
return $this->response("101", $result);
}
......@@ -58,6 +58,7 @@ class Register extends Basic
}
/**
* 邀请登录or app微信授权登录
* @return \think\Response
*/
public function registerVerify()
......
......@@ -13,15 +13,17 @@ use Think\Log;
* Time : 18:06
* Intro:
*/
class WxTest extends Basic
class WxAuthorization extends Basic
{
private $url = "https://pre2.tonglianjituan.com/index/test";
private $url = "https://pre2.tonglianjituan.com/index/getWxInfo";
private $_wxApi;
public function __construct()
{
$this->_wxApi = new WxCallbackUntils();
}
public function test()
public function getWxInfo()
{
$code = empty($_GET['code']) ? null : $_GET['code'];
......@@ -29,9 +31,9 @@ class WxTest extends Basic
if (!$code) {
$this->_wxApi->getWxCode($this->url);
}else{
} else {
$this->_wxApi->getUserInfoByAccessToken($code);
Log::record("session wx -----------------".json_encode( $userInfo),"info");
Log::record("session wx -----------------" . json_encode($userInfo), "info");
if (!$userInfo) {
$this->_wxApi->getWxCode($this->url);
} else {
......
......@@ -242,7 +242,7 @@ Route::group('index', [
'delNotice' => [ 'index/notice/delNotice', [ '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', [
'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
'sendCode' => [ 'api/Register/registerSendCode', [ 'method' => 'POST|get' ] ],
'userVerify' => [ 'api/Register/registerVerify', [ 'method' => 'POST|get' ] ],
'sendCode' => [ 'api/Register/registerSendCode', [ 'method' => 'POST' ] ],
'userVerify' => [ 'api/Register/registerVerify', [ 'method' => 'POST' ] ],
]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment