码农笔录博客源码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

83 rivejä
3.3 KiB

6 vuotta sitten
{{template "header" .}}
6 vuotta sitten
<title>博客 - 码农随笔</title>
6 vuotta sitten
</head>
<body style="background-color: #f9f9f9">
6 vuotta sitten
<div class="root-container">
{{template "nav" .}}
{{template "memenu" .}}
6 vuotta sitten
<div class="me-blog-root">
<div class="me-blog-list">
6 vuotta sitten
<div class="breadcrumb-container">
<span class="layui-breadcrumb">
<a href="/">首页</a>
<a href="">个人中心</a>
<a href="/me/blog">我的博客</a>
<a><cite>博客列表</cite></a>
</span>
</div>
6 vuotta sitten
{{range .Page.List}}
<div>
<p><a href="/blog/{{.Id}}">{{.Title}}</a></p>
<div>
<em>发布时间:{{.Ctime.Format "2006/01/02"}}</em>
<em>浏览量:{{.Browses}}</em>
<span style="width: 35px;margin-left: 30px;"><a href="javascript:void(0)" style="color: #F84822"
onclick="del(this,{{.Id}})">删除</a></span>
6 vuotta sitten
<span style="width: 35px;margin-left: 10px;"><a href="/blog/edit/{{.Id}}" target="_blank" style="color: #F84822">编辑</a></span>
</div>
6 vuotta sitten
</div>
<hr style="height:1px;border:none;border-top:1px solid #EEE;margin: 6px;"/>
{{end}}
<div style="text-align: center">
<nav>
<div class="pagination pagination-lg">
<ul>
{{if .Page.FirstPage}}
{{else}}
<li class="prev">
<a href="/me/blog?num={{ .Page.PageNo | NAdd -1}}&flag={{.Flag}}">&laquo;</a>
</li>
{{end}}
<li class="active"><a href="javascript:void(0)">{{.Page.PageNo}}</a></li>
{{if .Page.LastPage}}
{{else}}
<li class="next">
<a href="/me/blog?num={{ .Page.PageNo | NAdd +1}}&flag={{.Flag}}">&raquo;</a>
</li>
{{end}}
</ul>
</div>
</nav>
</div>
6 vuotta sitten
</div>
</div>
</div>
</div>
</body>
<script>
function del(obj, id) {
layer.confirm('删除后将无法恢复', {
btn: ['确认', '手滑了'] //按钮
}, function () {
6 vuotta sitten
$.post('/api/blog/del/' + id,
function (data) {
if (data.Status == 0) {
$(obj).parent().parent().parent().remove()
layer.msg("删除成功", {icon: 6});
} else if (data.Status == 401) {
window.location.href = "/login"
} else if (data.Status == 403) {
layer.msg("暂无权限", {icon: 5});
this.$message.error("暂无权限")
} else {
this.$message.error("服务器异常")
}
}, 'json')
}, function () {
});
}
</script>
6 vuotta sitten
</html>