-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a896322
commit b971cab
Showing
2 changed files
with
57 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,66 @@ | ||
const data={ | ||
const data = { | ||
userName: "菜菜", | ||
job:"后端开发工程师", | ||
address:"成都", | ||
age:"24岁", | ||
sex:"男", | ||
tel:15984426676, | ||
email:"[email protected]", | ||
skills:[ | ||
job: "后端开发工程师", | ||
address: "成都", | ||
age: "24岁", | ||
sex: "男", | ||
tel: 15984426676, | ||
email: "[email protected]", | ||
lastCommit: [], | ||
skills: [ | ||
{ | ||
name:"JAVA", | ||
per:88 | ||
name: "JAVA", | ||
per: 88 | ||
}, | ||
{ | ||
name:"Golang", | ||
per:88 | ||
name: "Golang", | ||
per: 88 | ||
}, | ||
{ | ||
name:"Linux", | ||
per:85 | ||
name: "Linux", | ||
per: 85 | ||
}, | ||
{ | ||
name:"Mysql", | ||
per:83 | ||
name: "Mysql", | ||
per: 83 | ||
}, | ||
{ | ||
name:"Oracle", | ||
per:80 | ||
name: "Oracle", | ||
per: 80 | ||
}, | ||
] | ||
} | ||
function TimestampToDate(Timestamp) { | ||
let date1 = new Date(Timestamp); | ||
return date1.toLocaleDateString().replace(/\//g, "-") + " " + date1.toTimeString().substr(0, 8); | ||
} | ||
console.log("感谢您的浏览,期待能够加入贵公司!"); | ||
layui.use(function(){ | ||
var laytpl = layui.laytpl,$=layui.jquery | ||
layui.use(function () { | ||
var laytpl = layui.laytpl, $ = layui.jquery | ||
$('#view').html("渲染中...") | ||
$.ajax({ | ||
url: ".git/logs/HEAD", | ||
success: function (res) { | ||
//去掉最后一行的换行符 | ||
x = res.substring(0, res.lastIndexOf("\n")) | ||
if (x.lastIndexOf("\n") > 0) { | ||
data.lastCommit = x.substring(x.lastIndexOf("\n"), x.length).trim().split(" "); | ||
console.log("上一次提交信息", data.lastCommit) | ||
console.log("上一次提交时间", data.lastCommit[4] + '000') | ||
console.log("当前时间", new Date().getTime()) | ||
let datet=TimestampToDate(parseInt(data.lastCommit[4]+'000')) | ||
data.lastCommit[4] = datet | ||
|
||
} | ||
} | ||
}) | ||
//引入外部html | ||
$.get('assets/pages/home.html',function(homePage){ | ||
$.get('assets/pages/home.html', function (homePage) { | ||
//渲染并输出结果 | ||
laytpl(homePage).render(data, function(str){ | ||
laytpl(homePage).render(data, function (str) { | ||
$('#view').html(str); | ||
}); | ||
}); | ||
|
||
}); | ||
}) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters