提交 83268da0 编写于 作者: shengzhang_'s avatar shengzhang_

优化文档

上级 fcf3cc43
...@@ -162,8 +162,8 @@ ...@@ -162,8 +162,8 @@
</script> </script>
<!-- --> <!-- -->
<script src="./static/docsify-plugin.js"></script> <script src="./static/docsify-plugin.js?v=6"></script>
<script src="./static/is-star-plugin.js?v=4"></script> <script src="./static/is-star-plugin.js?v=6"></script>
<script> <script>
var saTokenTopVersion = '1.35.0.RC'; // Sa-Token最新版本 var saTokenTopVersion = '1.35.0.RC'; // Sa-Token最新版本
var name = '<img style="width: 60px; height: 60px; vertical-align: middle;" src="logo.png" alt="logo" /> '; var name = '<img style="width: 60px; height: 60px; vertical-align: middle;" src="logo.png" alt="logo" /> ';
......
...@@ -74,13 +74,36 @@ var myDocsifyPlugin = function(hook, vm) { ...@@ -74,13 +74,36 @@ var myDocsifyPlugin = function(hook, vm) {
// if($('#main h1').next().prop('tagName') !== 'HR') { // if($('#main h1').next().prop('tagName') !== 'HR') {
// $('#main h1').after('<hr/>'); // $('#main h1').after('<hr/>');
// } // }
// 如果一周内用户点击过关闭广告,则不再展现
let allowJg = 1000 * 60 * 60 * 24 * 7;
// allowJg = 1000 * 10;
try{
const closeAdTime = localStorage.closeAdTime;
if(closeAdTime) {
// 点击广告关闭的时间,和当前时间的差距
const closeAdJg = new Date().getTime() - parseInt(closeAdTime);
// 差距小于七天,不再展示
if(closeAdJg < allowJg) {
console.log('not show ad ...');
return;
}
}
}catch(e){
console.error(e);
}
// 添加广告 // 添加广告
$('#main h1').after(ad); $('#main h1').after(ad);
// 添加关闭事件 // 添加关闭事件
$('.top-ad-box .ad-close').click(function(){ $('.top-ad-box .ad-close').click(function(){
console.log(123); console.log('关闭广告');
// $('.top-ad-box').slideUp(); // 折叠收起 // $('.top-ad-box').slideUp(); // 折叠收起
$(".top-ad-box").fadeOut(1000); // 淡出效果 $(".top-ad-box").fadeOut(1000); // 淡出效果
layer.msg('一周内不再展现此信息')
localStorage.closeAdTime = new Date().getTime();
}) })
} }
......
...@@ -27,7 +27,7 @@ var isStarPlugin = function(hook, vm) { ...@@ -27,7 +27,7 @@ var isStarPlugin = function(hook, vm) {
// 应用参数 // 应用参数
const client_id = '0cc618beb08db99bff50e500e38c2144d95ada9abb51c00c44592726ecd583f4'; const client_id = '0cc618beb08db99bff50e500e38c2144d95ada9abb51c00c44592726ecd583f4';
const client_secret = '2574c2aac8ce2142e34752dc5957dddcb30bc68df5c61de64251a3a6b11a51e5'; const client_secret = 'xxx';
const redirect_uri = 'https://sa-token.cc/doc.html'; const redirect_uri = 'https://sa-token.cc/doc.html';
const docDomain = 'sa-token.cc'; const docDomain = 'sa-token.cc';
// const redirect_uri = 'http://127.0.0.1:8848/sa-token-doc/doc.html'; // const redirect_uri = 'http://127.0.0.1:8848/sa-token-doc/doc.html';
...@@ -48,7 +48,7 @@ function isStarRepo(vm) { ...@@ -48,7 +48,7 @@ function isStarRepo(vm) {
// 判断是否在主域名下 // 判断是否在主域名下
if(location.host !== docDomain) { if(location.host !== docDomain) {
console.log('非主域名,不检测...'); console.log('not domain, no check...');
return; return;
} }
...@@ -70,7 +70,7 @@ function isStarRepo(vm) { ...@@ -70,7 +70,7 @@ function isStarRepo(vm) {
} }
// 白名单路由不判断 // 白名单路由不判断
const whiteList = ['/', '/more/link', '/more/demand-commit', '/more/join-group', '/more/sa-token-donate', const whiteList = ['/a', '/more/link', '/more/demand-commit', '/more/join-group', '/more/sa-token-donate',
'/sso/sso-pro', '/more/update-log', '/more/common-questions', '/fun/sa-token-test', '/fun/issue-template']; '/sso/sso-pro', '/more/update-log', '/more/common-questions', '/fun/sa-token-test', '/fun/issue-template'];
if(whiteList.indexOf(vm.route.path) >= 0 && getParam('code') === null) { if(whiteList.indexOf(vm.route.path) >= 0 && getParam('code') === null) {
console.log('white route ...'); console.log('white route ...');
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册