admin/app/shop/controller/H5.php

73 lines
2.0 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
/**
* ThinkShop商城系统 - 团队十年电商经验汇集巨献!
* =========================================================
* Copy right 2019-2029 成都云之牛科技有限公司, 保留所有权利。
* ----------------------------------------------
* 官方网址: https://www.cdcloudshop.com
* =========================================================
*/
namespace app\shop\controller;
use app\model\system\H5 as H5Model;
use app\model\web\Config;
use app\model\system\Upgrade;
use app\model\web\DiyView as DiyViewModel;
class H5 extends BaseShop
{
/**
* 刷新前端代码
*/
public function refreshH5()
{
if (request()->isAjax()) {
$h5 = new H5Model();
$res = $h5->refresh();
$this->h5DomainName(); // 修改H5域名
return $res;
} else {
$refresh_time = 0;
if (file_exists('h5/refresh.log')) {
$refresh_time = file_get_contents('h5/refresh.log');
}
$config_model = new Config();
$config = $config_model->geth5DomainName($this->site_id);
$this->assign('config', $config[ 'data' ][ 'value' ]);
$this->assign('refresh_time', $refresh_time);
$this->assign("root_url", __ROOT__);
return $this->fetch('h5/refresh_h5');
}
}
/**
* h5域名配置
*/
public function h5DomainName()
{
$config_model = new Config();
$domain_name = input("domain", "");
$deploy_way = input("deploy_way", "default");
if ($deploy_way == 'default') {
$domain_name = __ROOT__ . '/h5';
}
$result = $config_model->seth5DomainName([
'domain_name_h5' => $domain_name,
'deploy_way' => $deploy_way
]);
return $result;
}
/**
* 独立部署版下载
*/
public function downloadSeparate(){}
/**
* 下载uniapp源码混入所选模板代码
* @return array|bool|int|mixed|void
*/
public function downloadUniapp() {}
}