上线 sa-token 小助手

This commit is contained in:
click33
2023-08-09 11:29:43 +08:00
parent 0d69bde2ba
commit 1f84ea6939
3 changed files with 52 additions and 13 deletions

View File

@@ -136,10 +136,20 @@
<div class="main-box">
<div id="app">加载中...</div>
</div>
<!-- 万维广告div -->
<div style="position: fixed; right: 0; bottom: 0; z-index: 10000; border: 0px #aaa solid;">
<div class="wwads-cn wwads-vertical" data-id="88" style="max-width:150px"></div>
</div>
<!-- 小助手div -->
<div class="p-none" style="position: fixed; right: 40px; bottom: 330px; z-index: 10000; border: 0px #aaa solid;">
<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>
</div>
<!-- UI逐渐显现 -->
<style type="text/css">
body{opacity: 0.01; transition: opacity 0.5s; background-color: #FFF;}
@@ -259,6 +269,30 @@
}
</script>
<!-- 小助手提示 -->
<script>
$('.help-btn').click(function(){
var str = `
<div class="xiaozhushou-intro">
<p>1、你在使用 Sa-Token 时遇到任何技术难题,可以向 < sa-token 小助手 > 求助咨询。</p>
<p>2、该小助手不属于商业运营求助咨询完全免费。</p>
<p>3、目前该小助手属于试运营阶段每天只能提供大约 1 小时的求助时间。</p>
<p>4、根据运营效果反馈我们日后可能会提高求助时间但也可能关闭此功能。</p>
<p>5、该小助手由企业微信提供平台支持感谢企业微信。</p>
<p style="margin-top: 30px;">打开方式:</p>
<p>1、如果你是使用 PC 端企业微信,请点此链接:<a href="https://work.weixin.qq.com/kfid/kfcdd45c432fee9655f" target="_blank">https://work.weixin.qq.com/kfid/kfcdd45c432fee9655f</a></p>
<p>2、如果你是使用手机端微信请扫码</p>
<p><img src="https://oss.dev33.cn/sa-token/sa-token-xiaozhushou.jpg" width="200px"></p>
</div>
`;
layer.alert(str, {
title: '技术求助',
area: '550px',
offset: '10%',
})
})
</script>
<!-- 修改背景颜色 -->
<script>

View File

@@ -338,4 +338,18 @@ body {
#main .top-ad-box a img:hover{box-shadow: 0 0 20px #ddd;}
.ad-tips{color: #aaa;}
.ad-close{float: right;}
.ad-close:hover{cursor: pointer; text-decoration: underline; color: red;}
.ad-close:hover{cursor: pointer; text-decoration: underline; color: red;}
/* 帮助按钮 */
.help-btn{transition: all 0.2s;}
.help-btn:hover{box-shadow: 0 0 30px #aaa !important;}
.xiaozhushou-intro p{line-height: 16px;}
/* 按钮发光动画 */
.help-btn{animation: helpbtnanimation 3s infinite;}
@keyframes helpbtnanimation{
0%{box-shadow: 0 0 1px #42B983;}
50%{box-shadow: 0 0 20px #42B983;}
100%{box-shadow: 0 0 20px #FFF;}
}

View File

@@ -13,10 +13,6 @@ var isStarPlugin = function(hook, vm) {
// 钩子函数:每次路由切换时,解析内容之后执行
hook.afterEach(function(html) {
// changePage++;
// if(changePage % 15 === 0) {
// isStarRepo();
// }
return html;
});
@@ -204,13 +200,13 @@ function getAccessToken(code) {
},
error: function(e) {
console.log('请求错误 ', e);
// 如果请求地址有错,暂停一天
// 如果请求地址有错,可能是服务器宕机了,暂停一天检测
if(e.status === 0 || e.status === 502) {
return layer.alert(JSON.stringify(e), {closeBtn: false}, function(){
// 一天内不再检查,否则
// 一天内不再检查
const ygTime = allowDisparity - (1000 * 60 * 60 * 24);
localStorage.isStarRepo = new Date().getTime() - ygTime;
// 刷新url去掉 code 参数
// 刷新 url去掉 code 参数
location.href = location.href.replace("?code=" + code, '');
});
}
@@ -227,11 +223,6 @@ function getAccessToken(code) {
url = url.replace("&code=" + code, '');
location.href = url;
});
// 一天内不再检查,否则
// const ygTime = allowDisparity - (1000 * 60 * 60 * 24);
// localStorage.isStarRepo = new Date().getTime() - ygTime;
// // 刷新url去掉 code 参数
// location.href = location.href.replace("?code=" + code, '');
}
})
}