优化ctms-api语法、修复已知BUG;

主要修复ctms-api、dacms对PHP新版本的支持问题
This commit is contained in:
2025-07-13 19:37:42 +08:00
parent 65bbd06981
commit 037f274ec5
413 changed files with 107271 additions and 72326 deletions
+8
View File
@@ -0,0 +1,8 @@
<div class="site-error">
<div style="margin-top: 100px;text-align: center;">
<h1>温馨提示</h1><br>
</div>
<h4 style="margin: 10px auto;text-align: center;background-color: #1ab394; color: #ffffff;width: 500px;height: 50px;line-height: 50px;border-radius: 5px;">
<i class="fa fa-spinner fa-spin"></i> 功能尚未开放,敬请稍候……</h4>
</div>
+180 -53
View File
@@ -2,15 +2,19 @@
/* @var $this \yii\web\View */
/* @var $content string */
use backend\assets\AppAsset;
use yii\helpers\Html;
use yii\helpers\Url;
use yii\bootstrap\Nav;
use yii\bootstrap\NavBar;
use yii\widgets\Breadcrumbs;
use frontend\assets\AppAsset;
use common\widgets\Alert;
AppAsset::register($this);
// AppAsset::register($this);
$keywords = '';
$description = '';
$routes = ['data']; //自添加的controllers列表集,用于为新添加的控制器在渲染视图时自动加入HTML代码段,以便兼容h+的后台模板
?>
<?php $this->beginPage() ?>
<!DOCTYPE html>
@@ -20,65 +24,188 @@ AppAsset::register($this);
<meta name="viewport" content="width=device-width, initial-scale=1">
<?= Html::csrfMetaTags() ?>
<title><?= Html::encode($this->title) ?></title>
<meta name="renderer" content="webkit">
<meta http-equiv="Cache-Control" content="no-siteapp"/>
<meta name="keywords" content="<?php echo $keywords ?>">
<meta name="description" content="<?php echo $description ?>">
<!--[if lt IE 9]>
<meta http-equiv="refresh" content="0;ie.html"/>
<![endif]-->
<link rel="shortcut icon" href="<?= Url::to('@web/favicon.ico'); ?>">
<?= Html::cssFile('@web/css/bootstrap.min.css') ?>
<?= Html::cssFile('@web/css/font-awesome.css') ?>
<?= Html::cssFile('@web/css/animate.min.css') ?>
<?= Html::cssFile('@web/css/site.css') ?>
<?= Html::cssFile('@web/css/style.min.css') ?>
<?= Html::jsFile('@web/js/jquery.min.js?v=2.1.4') ?>
<?= Html::jsFile('@web/js/bootstrap.min.js?v=3.3.6') ?>
<?= Html::jsFile('@web/js/plugins/layer/layer.js') ?>
<?= Html::jsFile('@web/js/admin.js') ?>
<?= Html::cssFile('@web/css/plugins/iCheck/custom.css') ?>
<?= Html::cssFile('@web/css/plugins/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css') ?>
<?php $this->head() ?>
</head>
<body>
<body class="fixed-sidebar full-height-layout gray-bg animated">
<?php $this->beginBody() ?>
<?php if ((Yii::$app->controller->module->defaultRoute != "site") || (Yii::$app->controller->module->defaultRoute == "site" && Yii::$app->controller->module->requestedRoute != ""
&& Yii::$app->controller->module->requestedRoute != "site/login")): ?>
<nav class="breadcrumb fix_top hidden-sm hidden-xs" id="_HiQuickMenu"
style="background-color:#ccc;width: 55px;padding-top: 15px;padding-left: 10px;position:fixed;top:40%;right:15px;z-index:9999;">
<div class="pull-right">
<a class="btn btn-primary radius goback" style="line-height:1.6em;margin-top:3px"
href="javascript:history.go(-1);" title="后退">
<span class="fa fa-reply"></span>
</a>
<br>
<a class="btn btn-primary radius refresh" style="line-height:1.6em;margin-top:3px"
href="javascript:location.replace(location.href);" title="刷新">
<span class="fa fa-refresh"></span>
</a>
<br>
<a class="btn btn-warning radius" style="line-height:1.6em;margin-top:3px"
href="<?php echo url::toRoute(['error/report', 'url' => urlDecode(Url::current())]); ?>"
title="报错反馈">
<span class="fa fa-at"></span>
</a>
<br>
<button class="btn btn-danger radius lockscreen" style="line-height:1.6em;margin-top:3px" title="锁屏">
<span class="fa fa-expeditedssl"></span>
</button>
&nbsp;
</div>
</nav>
<?php endif; ?>
<?php if (in_array(Yii::$app->controller->module->id, $routes)): ?>
<div class="wrapper wrapper-content">
<div class="row">
<div class="col-sm-12">
<div class="ibox float-e-margins">
<div class="ibox-content">
<?php endif; ?>
<?= Alert::widget() ?>
<?= $content ?>
<?php if (in_array(Yii::$app->controller->module->id, $routes)): ?>
</div>
</div>
</div>
</div>
</div>
<?php endif; ?>
<div class="wrap">
<?php
NavBar::begin([
'brandLabel' => Yii::t('frontend','Site Name'),
'brandUrl' => Yii::$app->homeUrl,
'options' => [
'class' => 'navbar-inverse navbar-fixed-top',
],
]);
$menuItems = [
['label' => Yii::t('frontend','Home'), 'url' => ['/site/index']],
//['label' => Yii::t('frontend','About'), 'url' => ['/site/about']],
['label' => Yii::t('frontend','Contact'), 'url' => ['/site/contact']],
];
if (Yii::$app->user->isGuest) {
$menuItems[] = ['label' => Yii::t('frontend','Sign Up'), 'url' => ['/site/signup']];
$menuItems[] = ['label' => Yii::t('frontend','Login'), 'url' => ['/site/login']];
} else {
$menuItems[] = ['label' => Yii::t('frontend','Ali SMS'), 'url' => ['/alimsg/index']];
$menuItems[] = ['label' => Yii::t('frontend','Api'), 'url' => ['/api/index','appid'=>Yii::$app->user->identity->username]];
$menuItems[] = '<li>'
. Html::beginForm(['/site/logout'], 'post')
. Html::submitButton(
Yii::t('frontend','Logout').' (' . Yii::$app->user->identity->username . ')',
['class' => 'btn btn-link logout']
)
. Html::endForm()
. '</li>';
<?php $this->endBody() ?>
<style>
.modal-backdrop.in {
opacity: .7;
}
echo Nav::widget([
'options' => ['class' => 'navbar-nav navbar-right'],
'items' => $menuItems,
]);
NavBar::end();
?>
<div class="container">
<?= Breadcrumbs::widget([
'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [],
]) ?>
<?= Alert::widget() ?>
<?= $content ?>
</style>
<div class="modal inmodal" id="myModal" tabindex="-1" role="dialog" aria-hidden="true" data-keyboard='false'
data-backdrop="static" style="z-index:9999;">
<div class="modal-dialog">
<div class="modal-content animated bounceInRight">
<div class="modal-header">
<i class="fa fa-laptop modal-icon"></i>
<h4 class="modal-title">屏幕解锁</h4>
<small class="font-bold"><?php echo date('Y-m-d H:i:s'); ?></small>
</div>
<div class="modal-body">
<p id="_LockScreenTips"></p>
<form class="form-horizontal m-t" id="commentForm" novalidate="novalidate">
<div class="form-group">
<label class="col-sm-3 control-label">口令:</label>
<div class="col-sm-8">
<input id="_ScreenLockCode" name="code" type="password" class="form-control" required=""
aria-required="true">
</div>
</div>
<div class="form-group">
<div class="col-sm-4 col-sm-offset-3">
<button type="button" class="btn btn-white unlockscreen">验证</button>
<button type="reset" class="btn btn-warning">再等等</button>
</div>
</div>
</form>
</div>
<div class="modal-footer" style="text-align: center;">
<button type="button" class="hidden btn btn-primary closelockscreen" data-dismiss="modal">
现在点我,立即解锁
</button>
</div>
</div>
</div>
</div>
<footer class="footer">
<div class="container">
<p class="pull-left">&copy; <?= Yii::t('frontend','English Company Name') ?>&nbsp;<?= date('Y') ?> Version: <?= HI_VERSION;?></p>
<script>
//锁屏
$(function () {
var modalId = 'myModal';
sessionStorage.unLockScreen = true;
$('.lockscreen').bind('click', function () {
layer.confirm('您确认要锁屏吗?', {
btn: ['确认', '算了'], //按钮
shade: true //是否显示遮罩
}, function (index) {
layer.close(index);
layer.prompt(
{
title: '输入解锁屏幕时要用的口令(仅数字与字母)后按确认,即可锁屏',
formType: 0 //prompt风格,支持0-2
},
function (value, index, elem) {
layer.close(index);
var code1 = value;
sessionStorage.unLockScreen = false;
sessionStorage.LockScreenCode = code1;
var msg = '锁屏完成,您的口令是:' + code1 + ' ;如果您不小心忘记锁屏密码,请重新登陆;如果您有可能未保存的页面数据,可通过浏览器的网页开发调试工具,清除会话缓存中的锁屏键;如果您不会操作,可联系微信客服<?php echo Yii::$app->params["developerWx"];?>获取付费协助';
var msg2 = '锁屏完成;如果您不小心忘记锁屏密码,请重新登陆;如果您有可能未保存的页面数据,可通过浏览器的网页开发调试工具,清除会话缓存中的锁屏键;如果您不会操作,可联系微信客服<?php echo Yii::$app->params["developerWx"];?>获取付费协助';
$('#_LockScreenTips').html(msg2);
$('#' + modalId).modal('show');
}
);
}, function () {
layer.msg('您取消了锁屏操作', {shift: 6});
});
<p class="pull-right"><?= Yii::t('frontend','Full Company Name') ?></p>
</div>
</footer>
$('#' + modalId).on('hide.bs.modal',
function () {
$('.closelockscreen').addClass('hidden').hide();
layer.msg('好的,您已成功解锁');
});
});
$('.unlockscreen').bind('click', function () {
var code = $('#_ScreenLockCode').val();
var LockScreenCode = sessionStorage.LockScreenCode;
if (code == LockScreenCode) {
sessionStorage.unLockScreen = true;
$('.closelockscreen').removeClass('hidden').show();
} else {
layer.msg('口令错误,请重新输入');
}
});
if (!sessionStorage.unLockScreen) {
if (sessionStorage.LockScreenCode) {
$('#' + modalId).modal('show');
}
return;
}
});
</script>
<script>
var HOME_URL = '<?php echo Url::home();?>'; //定义首页位置,用于content.min.js中快速跳转首页按钮
</script>
<!-- 以下js必须放在页尾,顺序不可更换 -->
<?= Html::jsFile('@web/js/bootstrap.min.js?v=3.3.6') ?>
<?= Html::jsFile('@web/js/plugins/layer/layer.js') ?>
<?= Html::jsFile('@web/js/content.min.js') ?>
<?php $this->endBody() ?>
</body>
</html>
<?php $this->endPage() ?>
-19
View File
@@ -1,19 +0,0 @@
<?php
?>
<div class="container" style="padding-top: 5%;">
<div class="alert alert-<?php if(isset($message['class'])){ echo $message['class']; }else{ echo "info";}?> alert-dismissible fade in" role="alert">
<button type="button" class="close" data-dismiss="alert">×</button>
<h3 style="text-align: center;text-align: -webkit-center;"><?php if(isset($message['title'])){ echo $message['title']; }else{ echo "系统提示";}?></h3>
<div><?php echo $message['content'];?></div>
</div>
<div style="text-align: center;text-align: -webkit-center;">
<?php foreach($message['button'] as $btn){?>
<a class="<?php echo $btn['class'];?>" style="margin-right:15px;" href="<?php echo $btn['link'];?>"><?php echo $btn['title'];?></a>
<?php }?>
<a class="btn btn-default" style="margin-right:15px;" href="javascript:void(0)" onclick="history.back();">返回</a>
</div>
</div>
<div class="container" style="margin-top:2%;text-align: center;color:#ccc;font-weight:200;">
如果使用过程中发现有任何问题,请及时反馈给技术人员。
</div>
+32
View File
@@ -0,0 +1,32 @@
<?php
use yii\helpers\Html;
use yii\helpers\Url;
$this->title = isset($title) ? $title : '提示';
$content = isset($content) ? $content : '';
$class = isset($class) ? $class : 'info';
$class = in_array($class, ['danger', 'warning', 'success', 'info']) ? $class : 'info';
$buttons = isset($buttons) ? $buttons : [['title' => '好的,我知道了', 'class' => 'primary', 'url' => FALSE]];
?>
<div class="site-index" style="text-align: center;width:80%;margin-left:10%;">
<div style="margin-top: 100px;">
<h1><?= Html::encode($this->title) ?></h1><br>
</div>
<div class="alert alert-<?php echo $class; ?> fade in" role="alert">
<?php echo $content; ?>
</div>
<?php foreach ($buttons as $btn) { ?>
<a <?php if ($btn['url']) { ?> href="<?php echo $btn['url']; ?>" <?php } ?>
class="btn btn-<?php if ($btn['class']) {
echo $btn['class'];
} else {
echo 'primary';
} ?>"><?php if ($btn['title']) {
echo $btn['title'];
} else {
echo '点击按钮';
} ?></a>
<?php } ?>
</div>