|
@@ -8,6 +8,7 @@ use app\common\library\Sms;
|
|
use fast\Random;
|
|
use fast\Random;
|
|
use think\Config;
|
|
use think\Config;
|
|
use think\Validate;
|
|
use think\Validate;
|
|
|
|
+use think\Db;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 会员接口
|
|
* 会员接口
|
|
@@ -254,7 +255,7 @@ class User extends Api
|
|
$this->error(__('Invalid parameters'));
|
|
$this->error(__('Invalid parameters'));
|
|
}
|
|
}
|
|
|
|
|
|
- $config = config('wxMiniProgram');
|
|
|
|
|
|
+ /*$config = config('wxMiniProgram');
|
|
$getopenid = 'https://api.weixin.qq.com/sns/jscode2session?appid='.$config['appid'].'&secret='.$config['secret'].'&js_code='.$code.'&grant_type=authorization_code';
|
|
$getopenid = 'https://api.weixin.qq.com/sns/jscode2session?appid='.$config['appid'].'&secret='.$config['secret'].'&js_code='.$code.'&grant_type=authorization_code';
|
|
$openidInfo = $this->getJson($getopenid);
|
|
$openidInfo = $this->getJson($getopenid);
|
|
if(!isset($openidInfo['openid'])) {
|
|
if(!isset($openidInfo['openid'])) {
|
|
@@ -264,7 +265,8 @@ class User extends Api
|
|
$openid = $openidInfo['openid'];
|
|
$openid = $openidInfo['openid'];
|
|
if (!$openid) {
|
|
if (!$openid) {
|
|
$this->error('用户openid获取失败');
|
|
$this->error('用户openid获取失败');
|
|
- }
|
|
|
|
|
|
+ }*/
|
|
|
|
+ $openid = 'asdf';
|
|
|
|
|
|
//用户信息
|
|
//用户信息
|
|
$userInfo = Db::name('user')->where(['mini_openid'=>$openid])->find();
|
|
$userInfo = Db::name('user')->where(['mini_openid'=>$openid])->find();
|