其余文件
This commit is contained in:
60
app/admin/controller/wechat/Mnp.php
Normal file
60
app/admin/controller/wechat/Mnp.php
Normal file
@ -0,0 +1,60 @@
|
||||
<?php
|
||||
namespace app\admin\controller\wechat;
|
||||
|
||||
use app\common\basics\AdminBase;
|
||||
use app\admin\logic\wechat\MnpLogic;
|
||||
use app\common\server\JsonServer;
|
||||
use app\common\server\ConfigServer;
|
||||
|
||||
class Mnp extends AdminBase
|
||||
{
|
||||
/**
|
||||
* 小程序设置
|
||||
*/
|
||||
public function setMnp()
|
||||
{
|
||||
if($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
if(isset($post['qr_code'])){
|
||||
$domain = $this->request->domain();
|
||||
$post['qr_code'] = str_replace($domain, '', $post['qr_code']);
|
||||
}else{
|
||||
$post['qr_code'] = '';
|
||||
}
|
||||
MnpLogic::setMnp($post);
|
||||
return JsonServer::success('设置成功');
|
||||
}
|
||||
|
||||
$mnp = MnpLogic::getMnp();
|
||||
return view('set_mnp', ['mnp' => $mnp]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 一键上传
|
||||
*/
|
||||
public function uploadMnp()
|
||||
{
|
||||
if($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$post['admin_id'] = $this->adminId;
|
||||
$result = MnpLogic::uploadMnp($post);
|
||||
if (true !== $result) {
|
||||
return JsonServer::error($result);
|
||||
}
|
||||
return JsonServer::success('上传成功');
|
||||
}
|
||||
|
||||
return view('upload_mnp', ['version'=>config('project.version')]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传日志
|
||||
*/
|
||||
public function uploadMnpLog()
|
||||
{
|
||||
$get = $this->request->get();
|
||||
return JsonServer::success('', MnpLogic::uploadMnpLog($get));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user