187 lines
4.3 KiB
PHP
187 lines
4.3 KiB
PHP
<?php
|
|
|
|
namespace app\admin\controller\channel\wxapp;
|
|
|
|
use app\common\controller\Backend;
|
|
use ZipArchive;
|
|
/**
|
|
* 版本管理
|
|
*/
|
|
class Version extends Backend
|
|
{
|
|
|
|
public function _initialize()
|
|
{
|
|
parent::_initialize();
|
|
}
|
|
|
|
|
|
/**
|
|
* 获取授权链接
|
|
* @return void
|
|
*/
|
|
public function getAuthUrl(){
|
|
|
|
if(\app\common\library\Platform::getSystemType() == 'single'){
|
|
$domain = $this->request->domain();
|
|
//thinkphp5获取系统的域名,如 baidu.com 去除 https或 http
|
|
}else{
|
|
$domain = $this->request->domain() . '/app/index.php';
|
|
}
|
|
$domain = preg_replace('/^(http|https):\/\//i', '', $domain);
|
|
|
|
try{
|
|
$data = \app\common\library\Client::request('api/wechat/auth/getAuthUrl',[
|
|
'domain'=>$domain
|
|
]);
|
|
}catch (\Exception $e){
|
|
$this->error($e->getMessage());
|
|
}
|
|
|
|
$this->success("获取成功",$data);
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
* 获取版本信息
|
|
* @return void
|
|
*/
|
|
public function getVersionInfo(){
|
|
//应该获取授权状态
|
|
//小程序版本
|
|
|
|
try{
|
|
$data = \app\common\library\Client::request('api/wechat/auth/versionInfo',[]);
|
|
}catch (\Exception $e){
|
|
$this->error($e->getMessage());
|
|
}
|
|
|
|
$this->success("获取成功",$data);
|
|
}
|
|
|
|
/**
|
|
* 获取审核版本信息
|
|
* @return void
|
|
*/
|
|
public function getAuditVersionInfo(){
|
|
//应该获取授权状态
|
|
//小程序版本
|
|
try{
|
|
$data = \app\common\library\Client::request('api/wechat/auth/getLatestAuditStatus',[]);
|
|
|
|
}catch (\Exception $e){
|
|
$this->error($e->getMessage());
|
|
}
|
|
|
|
$this->success("获取成功",$data);
|
|
}
|
|
|
|
/**
|
|
* 提交审核
|
|
* @return void
|
|
*/
|
|
public function submitAudit(){
|
|
//应该获取授权状态
|
|
//小程序版本
|
|
$version_desc = input('version_desc','');
|
|
try{
|
|
$data = \app\common\library\Client::request('api/wechat/auth/submitAudit',[
|
|
'version_desc'=>$version_desc
|
|
]);
|
|
}catch (\Exception $e){
|
|
$this->error($e->getMessage());
|
|
}
|
|
|
|
$this->success("提交成功",$data);
|
|
}
|
|
|
|
/**
|
|
* 撤回审核
|
|
* @return void
|
|
*/
|
|
public function undoAudit(){
|
|
try{
|
|
$data = \app\common\library\Client::request('api/wechat/auth/undoAudit',[]);
|
|
}catch (\Exception $e){
|
|
$this->error($e->getMessage());
|
|
}
|
|
|
|
$this->success("撤回审核成功");
|
|
}
|
|
|
|
/**
|
|
* 发布已通过审核版本
|
|
* @return void
|
|
*/
|
|
public function release(){
|
|
try{
|
|
\app\common\library\Client::request('api/wechat/auth/release',[]);
|
|
}catch (\Exception $e){
|
|
$this->error($e->getMessage());
|
|
}
|
|
|
|
$this->success("发布版本成功");
|
|
}
|
|
|
|
/**
|
|
* 撤回审核
|
|
* @return void
|
|
*/
|
|
public function getQrcode(){
|
|
$path = input('path');
|
|
try{
|
|
$data = \app\common\library\Client::request('api/wechat/auth/getQrcode',[
|
|
'path'=>$path
|
|
]);
|
|
}catch (\Exception $e){
|
|
$this->error($e->getMessage());
|
|
}
|
|
|
|
$this->success("操作成功",$data);
|
|
}
|
|
|
|
/**
|
|
* 解除小程序绑定
|
|
* @return void
|
|
*/
|
|
public function unbind(){
|
|
|
|
try{
|
|
$data = \app\common\library\Client::request('api/wechat/auth/unbind',[]);
|
|
}catch (\Exception $e){
|
|
$this->error($e->getMessage());
|
|
}
|
|
|
|
$this->success("操作成功");
|
|
}
|
|
|
|
/**
|
|
* 获取授权信息
|
|
* @return void
|
|
*/
|
|
public function authorization()
|
|
{
|
|
try{
|
|
$data = \app\common\library\Client::request('api/wechat/auth/authorization',[]);
|
|
}catch (\Exception $e){
|
|
$this->error($e->getMessage());
|
|
}
|
|
|
|
$this->success("获取成功",$data);
|
|
}
|
|
|
|
/**
|
|
* 提交代码到体验版
|
|
* @return false|void
|
|
*/
|
|
public function commit(){
|
|
try{
|
|
$data = \app\common\library\Client::request('api/wechat/auth/commit',[]);
|
|
}catch (\Exception $e){
|
|
$this->error($e->getMessage());
|
|
}
|
|
|
|
$this->success("提交成功",$data);
|
|
}
|
|
} |