1、文件上传验证
2、增加图片上传配置 2、接口功能优化
This commit is contained in:
36
application/api/controller/Wechat.php
Normal file
36
application/api/controller/Wechat.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
namespace app\api\controller;
|
||||
|
||||
use EasyWeChat\Factory;
|
||||
|
||||
/**
|
||||
* 微信类接口
|
||||
*/
|
||||
class Wechat extends \app\common\controller\Api{
|
||||
|
||||
public function onLogin() {
|
||||
$app = Factory::miniProgram(array(
|
||||
'app_id' => 'wxbcf7b64b8dc6ca72',
|
||||
'secret' => '01f8b10956ea44e6a726f1391af6e3d8',
|
||||
));
|
||||
|
||||
$info = $app->auth->session($this->request->param('code'));
|
||||
|
||||
$this->data['data'] = $info;
|
||||
|
||||
return json($this->data);
|
||||
}
|
||||
|
||||
public function jscode2session(){
|
||||
$app = Factory::miniProgram(array(
|
||||
'app_id' => 'wxbcf7b64b8dc6ca72',
|
||||
'secret' => '01f8b10956ea44e6a726f1391af6e3d8',
|
||||
));
|
||||
|
||||
$info = $app->auth->session($this->request->param('jsCode'));
|
||||
|
||||
$this->data['data'] = $info;
|
||||
|
||||
return json($this->data);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user