mirror of
https://gitee.com/dromara/sa-token.git
synced 2025-06-28 13:34:18 +08:00
sa-token 小助手增加提示信息
This commit is contained in:
parent
f5586a94ea
commit
6f8a3a4249
@ -143,7 +143,8 @@
|
||||
</div>
|
||||
|
||||
<!-- 小助手div -->
|
||||
<div class="p-none" style="position: fixed; right: 40px; bottom: 330px; z-index: 10000; border: 0px #aaa solid;">
|
||||
<div class="p-none help-btn-box" style="position: fixed; right: 40px; bottom: 330px; z-index: 10000; border: 0px #aaa solid;">
|
||||
<div class="help-tips" style="position: relative; left: -30px; top: -10px;"></div>
|
||||
<div class="help-btn" style="width: 60px; height: 60px; text-align: center; border-radius: 50%; background-color: #42b983; cursor: pointer;">
|
||||
<span style="font-size: 18px; color: #FFF; line-height: 60px;">Help</span>
|
||||
</div>
|
||||
@ -162,7 +163,7 @@
|
||||
|
||||
<!-- -->
|
||||
<script src="./static/docsify-plugin.js"></script>
|
||||
<script src="./static/is-star-plugin.js?v=2"></script>
|
||||
<script src="./static/is-star-plugin.js?v=3"></script>
|
||||
<script>
|
||||
var saTokenTopVersion = '1.35.0.RC'; // Sa-Token最新版本
|
||||
var name = '<img style="width: 60px; height: 60px; vertical-align: middle;" src="logo.png" alt="logo" /> ';
|
||||
@ -291,6 +292,18 @@
|
||||
offset: '10%',
|
||||
})
|
||||
})
|
||||
try{
|
||||
// 给个小提示
|
||||
const index = layer.tips('框架技术支持,点此求助', '.help-tips', {
|
||||
tips: [1, '#000'] ,//还可配置颜色
|
||||
time: 5000,
|
||||
});
|
||||
// 改为 fixed 定位,否则它会随着滚动条移动,样式就跑偏了
|
||||
$('#layui-layer' + index).css('position', 'fixed');
|
||||
}catch(e){
|
||||
console.error(e);
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<!-- 修改背景颜色 -->
|
||||
|
@ -103,15 +103,18 @@ function getCode() {
|
||||
function confirmStar() {
|
||||
|
||||
// 弹窗提示文字
|
||||
let tipStr = "<p><b>嗨,同学,来支持一下 Sa-Token 吧,为项目点个 star !</b></p>";
|
||||
tipStr += "<div>仅需两步即可完成:<br>" +
|
||||
'<div>1、打开 Sa-Token <a href="https://gitee.com/dromara/sa-token" target="_blank">开源仓库主页</a>,在右上角点个 star 。</div>' +
|
||||
'<div>2、点击下方 [ 同意授权检测 ] 按钮,同意 Sa-Token 获取 API 权限进行检测。<a href="javascript:authDetails();" style="text-decoration: none;">?</a></div>' +
|
||||
"</div>";
|
||||
tipStr += "<p><b>本章节文档将在 star 后正常开放展示</b></p>";
|
||||
tipStr = '<div>' + tipStr + '</div>'
|
||||
const tipStr = `
|
||||
<div>
|
||||
<p><b>嗨,同学,来支持一下 Sa-Token 吧,为项目点个 star !</b></p>
|
||||
<div>仅需两步即可完成:<br>
|
||||
<div>1、打开 Sa-Token <a href="https://gitee.com/dromara/sa-token" target="_blank">开源仓库主页</a>,在右上角点个 star 。</div>
|
||||
<div>2、点击下方 [ 同意授权检测 ] 按钮,同意 Sa-Token 获取 API 权限进行检测。<a href="javascript:authDetails();" style="text-decoration: none;">?</a></div>
|
||||
</div>
|
||||
<p><b>本章节文档将在 star 后正常开放展示</b></p>
|
||||
</div>
|
||||
`;
|
||||
|
||||
layer.confirm(tipStr, {
|
||||
const index = layer.confirm(tipStr, {
|
||||
title: '提示',
|
||||
btn: ['同意授权检测'],
|
||||
// btn: ['同意授权检测', '暂时不要,我先看看文档'],
|
||||
@ -126,6 +129,17 @@ function confirmStar() {
|
||||
goAuth();
|
||||
}
|
||||
);
|
||||
const closeLayer =
|
||||
`
|
||||
<!--
|
||||
↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
||||
在 f12 控制台 执行一下:
|
||||
localStorage.isStarRepo = new Date().getTime()
|
||||
即可取消弹窗 ,执行完刷新一下页面
|
||||
↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
||||
-->
|
||||
`;
|
||||
$('#layui-layer' + index).prepend(closeLayer)
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user