作者 董瑞恩
1 个管道 的构建 通过 耗费 0 秒

interface

... ... @@ -72,7 +72,8 @@ class LoginController extends HomeBaseController{
public function getPhone(){
$param = $this->request->param();
$loginUrl="https://api.weixin.qq.com/sns/jscode2session?appid=".$this->appId."&secret=".$this->appSecret."&js_code=".$param['code']."&grant_type=authorization_code";
$response=json_decode(file_get_contents($loginUrl),true);
$response=cmf_curl_get($loginUrl);
$response=json_decode($response,true);
if (!empty($response['errcode'])) {
$this->error('操作失败!');
}
... ... @@ -84,8 +85,16 @@ class LoginController extends HomeBaseController{
if ($errCode != 0) {
$this->apiResponse(301,'操作失败');
}
$phone="";
try{
Db::name('users')->where('open_id',$openid)->update([]);
}catch (\Exception $exception){
}
$this->apiResponse(200,'success',$wxUserData);
}
}
\ No newline at end of file
... ...