...
|
...
|
@@ -14,8 +14,11 @@ use app\admin\model\Suggest; |
|
|
use app\common\controller\Api;
|
|
|
use app\common\library\Auth;
|
|
|
use EasyWeChat\Foundation\Application;
|
|
|
use EasyWeChat\Foundation\ServiceProviders\MiniProgramServiceProvider;
|
|
|
use EasyWeChat\MiniProgram\MiniProgram;
|
|
|
use fast\Http;
|
|
|
use fast\Random;
|
|
|
use Overtrue\Socialite\FactoryInterface;
|
|
|
use PhpOffice\PhpSpreadsheet\Shared\OLE\PPS\Root;
|
|
|
use think\Config;
|
|
|
use think\Db;
|
...
|
...
|
@@ -27,7 +30,7 @@ use think\Log; |
|
|
*/
|
|
|
class Common extends Api
|
|
|
{
|
|
|
protected $noNeedLogin = ['getSessionKey','login','index','codeToToken','notifyx','notifyx1','clock'];
|
|
|
protected $noNeedLogin = ['getSessionKey','login','index','codeToToken','notifyx','notifyx1','clock','getPath'];
|
|
|
protected $noNeedRight = '*';
|
|
|
|
|
|
|
...
|
...
|
@@ -62,6 +65,20 @@ class Common extends Api |
|
|
|
|
|
}
|
|
|
|
|
|
public function getPath(){
|
|
|
$access_token=$this->get_accessToken();
|
|
|
$url = 'https://api.weixin.qq.com/wxa/getwxacode?access_token='.$access_token;
|
|
|
$path="pages/clock/clock";
|
|
|
$width=430;
|
|
|
$data='{"path":"'.$path.'","width":'.$width.'}';
|
|
|
$return = $this->http_request($url,$data);
|
|
|
$path=APP_PATH.'../public/'.time().'.jpg';
|
|
|
file_put_contents($path,$return);
|
|
|
$this->success('生成成功', 'Shop/index');
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
* @ApiTitle (获取SessionKey)
|
|
|
* @ApiSummary (解密微信加密信息)
|
...
|
...
|
@@ -890,6 +907,23 @@ class Common extends Api |
|
|
return $output;
|
|
|
}
|
|
|
|
|
|
private function http_request($url, $data = null)
|
|
|
{
|
|
|
$curl = curl_init();
|
|
|
//curl_setopt ( $curl, CURLOPT_SAFE_UPLOAD, false);
|
|
|
curl_setopt($curl, CURLOPT_URL, $url);
|
|
|
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
|
|
|
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, FALSE);
|
|
|
if (!empty ($data)) {
|
|
|
curl_setopt($curl, CURLOPT_POST, 1);
|
|
|
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
|
|
|
}
|
|
|
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
|
|
|
$output = curl_exec($curl);
|
|
|
curl_close($curl);
|
|
|
return $output;
|
|
|
}
|
|
|
|
|
|
public function getLogo(){
|
|
|
$site=\config('site');
|
|
|
$return['logo']=cdnurl($site['logo']);
|
...
|
...
|
|