初始化项目:添加后端代码、ThinkPHP框架、前端资源
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\controller;
|
||||
|
||||
use app\common\controller\Backend;
|
||||
use think\Db;
|
||||
/**
|
||||
* 分享
|
||||
*/
|
||||
class Share extends Backend
|
||||
{
|
||||
|
||||
protected $noNeedRight = ['*'];
|
||||
|
||||
public function _initialize()
|
||||
{
|
||||
parent::_initialize();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取小程序码
|
||||
* @return void
|
||||
*/
|
||||
public function getMpCode(){
|
||||
|
||||
$val = $this->request->post('val');
|
||||
$type = $this->request->post('type');
|
||||
|
||||
$qrCode = \app\common\library\share\Qrsharecode::getMpCode($type,$val);
|
||||
|
||||
if(!$qrCode){
|
||||
$this->error(__('获取失败'));
|
||||
}
|
||||
|
||||
return $this->success("获取成功","data:image/png;base64,".$qrCode);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user