上线 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

@@ -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, '');
}
})
}