优化去除缓存按钮操作

This commit is contained in:
hdm 2022-06-10 12:10:07 +08:00
parent 4c2c5125db
commit 4d17c16f92
4 changed files with 16 additions and 8 deletions

View File

@ -14,7 +14,7 @@
<a href="javascript:;" gg-event="shrink" title="侧边伸缩"><i class="layui-icon layui-icon-shrink-right"></i></a>
</span>
<span class="gg-head-item gg-head-cache">
<a href="javascript:;" gg-event="cache" title="清空缓存"><i class="layui-icon layui-icon-fonts-clear"></i></a>
<a href="javascript:;" gg-event="cache" data-href="/admin/api/cache_clear" title="清空缓存"><i class="layui-icon layui-icon-fonts-clear"></i></a>
</span>
<span class="gg-head-item gg-head-home">
<a href="/" target="_blank" title="前台首页"><i class="layui-icon layui-icon-website"></i></a>

View File

@ -53,8 +53,8 @@
html {background-color: #F6F8FA; color: #162a48}
html,body{height:100%;}
body.right-open{overflow:hidden;}
a.tab-a,a.open-a,a.open-link,a.right-a{color:#1E9FFF; cursor:pointer;}
a.tab-a:hover,a:hover,a.open-a:hover,a.open-link:hover,a.right-a:hover{color:#1E9FFF; opacity:0.8}
a.tab-a,a.open-a,a.link-a,a.right-a{color:#1E9FFF; cursor:pointer;}
a.tab-a:hover,a:hover,a.open-a:hover,a.link-a:hover,a.right-a:hover{color:#1E9FFF; opacity:0.8}
.left{float:left;}
.right{float:right;}
.h1,h1{font-size:24px; font-weight: 600;}

View File

@ -195,7 +195,8 @@ layui.define(['element'], function (exports) {
//左上角清除缓存
$('#GouguApp').on('click', '[gg-event="cache"]', function (e) {
var that = $(this);
let that = $(this);
let url = $(this).data('href');
if (that.attr('class') === 'clearThis') {
layer.tips('正在努力清理中...', this);
return false;
@ -203,7 +204,7 @@ layui.define(['element'], function (exports) {
layer.tips('正在清理系统缓存...', this);
that.attr('class', 'clearThis');
$.ajax({
url: "/admin/api/cache_clear",
url: url,
success: function (res) {
if (res.code == 1) {
setTimeout(function () {

View File

@ -3,7 +3,7 @@ layui.define([], function (exports) {
var tool = {
loading: false,
side: function (url, width) {
var sideWidth = window.innerWidth > 1280 ? '1200px' : '960px';
var sideWidth = window.innerWidth > 1280 ? '1200px' : '996px';
if (width && width > 0) {
sideWidth = width + 'px';
}
@ -30,7 +30,7 @@ layui.define([], function (exports) {
})
})
$(window).resize(function () {
width = window.innerWidth > 1280 ? '1200' : '960';
width = window.innerWidth > 1280 ? '1200' : '996';
$('.layui-anim-rl').width(width);
})
}
@ -227,7 +227,14 @@ layui.define([], function (exports) {
$('body').on('click', '.right-a', function () {
let url = $(this).data('href');
if (url && url !== '') {
tool.right(url);
tool.side(url);
}
return false;
});
$('body').on('click', '.link-a', function () {
let url = $(this).data('href');
if (url && url !== '') {
window.location.href=url;
}
return false;
});