update
This commit is contained in:
parent
a11ed17417
commit
1068b19d3c
19
README.md
19
README.md
@ -1,2 +1,19 @@
|
||||
# demo-project
|
||||
存放学习过程中的demo项目
|
||||
用于存放demo代码。
|
||||
- **1. SSO单端登陆 : 基于jwt的单点登陆实现demo**,[点击跳转](https://github.com/FleyX/demo-project/tree/master/1.SSO%E5%8D%95%E7%82%B9%E7%99%BB%E5%BD%95)
|
||||
- **2. dxfl : spring boot 2.x + mybatis + mysql(基于主从备份) 读写分离demo**,[点击跳转](https://github.com/FleyX/demo-project/tree/master/dxfl)
|
||||
|
||||
- **3. h5websocket : spring boot 2.x 原生websocket实现demo**,[点击跳转](https://github.com/FleyX/demo-project/tree/master/h5websocket)
|
||||
|
||||
- **4. jms_demo : spring boot 2.x 整合使用activemq教程**,[点击跳转](https://github.com/FleyX/demo-project/tree/master/jms_demo)
|
||||
|
||||
- **5. mybatis-test : springboot 2.x 整合使用mybatis教程(xml和注解两种方式)** , [点击跳转](https://github.com/FleyX/demo-project/tree/master/mybatis-test)
|
||||
|
||||
- **6. springboot_springsecurity_demo : sping boot 2.下整合使用springsecurity demo**,点击跳转
|
||||
|
||||
- **7. springcloud: spring cloud学习过程中的demo项目**,[点击跳转](https://github.com/FleyX/demo-project/tree/master/springcloud)<br/>注意其中licensingservice为配置中心git集中配置的样例配置。configFolder为配置中心磁盘文件集中式配置的样例。
|
||||
|
||||
- **8. 杂项**,[点击跳转](https://github.com/FleyX/demo-project/tree/master/%E6%9D%82%E9%A1%B9)
|
||||
- excel导出 : java 导出excel,支持百万级别数据导出
|
||||
|
||||
|
||||
|
@ -1,2 +0,0 @@
|
||||
server:
|
||||
port: 123
|
@ -1,2 +0,0 @@
|
||||
server:
|
||||
port: 1010
|
85
自动创建目录.html
85
自动创建目录.html
@ -1,85 +0,0 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>原生js获取目录</title>
|
||||
<meta charset="utf-8">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<style>
|
||||
#sum {
|
||||
position: fixed;
|
||||
right: 10px;
|
||||
top: 10px;
|
||||
}
|
||||
</style>
|
||||
<div id="sum"></div>
|
||||
<div id="cnblogs_post_body" style="margin-top:1000px;margin-bottom: 1000px">
|
||||
<h1>标题1</h1>
|
||||
<h2>标题1.1</h2>
|
||||
<h1>表题2</h1>
|
||||
<h3>标题2.1</h3>
|
||||
<h4>标题2.1.1</h4>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
|
||||
createContents("cnblogs_post_body");
|
||||
|
||||
function createContents(id) {
|
||||
let sum = [];
|
||||
var ele = document.getElementById("cnblogs_post_body");
|
||||
console.log(ele.attributes);
|
||||
for (let i = 0; i < ele.children.length; i++) {
|
||||
let item = ele.children[i];
|
||||
if (item.tagName.length == 2 && item.tagName.startsWith("H")) {
|
||||
item.setAttribute("id", item.innerText);
|
||||
let temp = {
|
||||
level: item.tagName.substring(1),
|
||||
content: item.innerText,
|
||||
children: []
|
||||
}
|
||||
insertTo(sum, temp);
|
||||
}
|
||||
}
|
||||
let str = printSum(sum,0);
|
||||
console.log(str);
|
||||
var a = document.createElement("div");
|
||||
a.style="position:fixed;right:10px;top:10px";
|
||||
a.innerHTML=str;
|
||||
document.getElementById("sum").appendChild(a);
|
||||
|
||||
}
|
||||
|
||||
function insertTo(sum, temp) {
|
||||
if (sum.length == 0) {
|
||||
sum.push(temp);
|
||||
return;
|
||||
}
|
||||
if (sum[0].level == temp.level) {
|
||||
sum.push(temp);
|
||||
} else {
|
||||
insertTo(sum[sum.length - 1].children, temp);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function printSum(sum,count) {
|
||||
let str = '';
|
||||
if (sum.length == 0)
|
||||
return str;
|
||||
count++;
|
||||
for(let i=0;i<sum.length;i++){
|
||||
for(let j=0;j<count;j++){
|
||||
str += " ";
|
||||
}
|
||||
str += `<a href="#${sum[i].content}">${sum[i].content}</a><br/>`;
|
||||
str+=printSum(sum[i].children,count);
|
||||
count = 0;
|
||||
}
|
||||
return str;
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
Loading…
x
Reference in New Issue
Block a user