码农笔录博客源码
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.

105 rivejä
4.0 KiB

6 vuotta sitten
{{template "header" .}}
6 vuotta sitten
<title>我的资料 - 码农随笔</title>
6 vuotta sitten
<script type="text/javascript" src="/static/js/upload.js"></script>
</head>
<body style="background-color: #f9f9f9">
<div class="root-container">
{{template "nav" .}}
{{template "memenu" .}}
<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/info">我的资料</a>
<a><cite>个人信息</cite></a>
</span>
</div>
6 vuotta sitten
<div style="display: flex">
6 vuotta sitten
<div style="width: 160px">
6 vuotta sitten
<img src="{{.HeadImg}}" alt="头像" class="img-circle img-circle-large">
<div id="drop_area" style="margin-top: 15px"></div>
6 vuotta sitten
</div>
<div class="info-header">
<div style="display: flex">
<p style="flex: 1;color: #888">ID: {{.User.UserName}}</p>
6 vuotta sitten
<p><a href="/u/{{.User.Id}}" style="text-decoration: none">个人主页 ></a></p>
6 vuotta sitten
</div>
<div>
<span>博客 {{.User.BlogCount}}</span>
<span>浏览量 {{.User.BlogBrowes}}</span>
<span>博客 {{.User.BlogCount}}</span>
<span>博客 {{.User.BlogCount}}</span>
</div>
6 vuotta sitten
<hr style="height:1px;border:none;border-top:1px solid #EEE;margin: 10px 0 5px 0;"/>
<div>
<div style="display: flex">
<p style="flex: 1">昵称 :{{.User.NickName}}</p>
<p><a href="javascript:void(0)" style="text-decoration: none" id="editBtn">修改资料</a></p>
</div>
<p>生日 :{{.User.Birthday.Format "2006-01-02"}}</p>
<p>邮箱 :{{.User.Email}}</p>
<p>手机 :{{.User.Mobile}}</p>
<p>Q Q :{{.User.QQ}}</p>
{{if eq 0 .User.Sex}}
<p>性别 :女</p>
{{else}}
<p>性别 :男</p>
{{end}}
<p>简介 :{{.User.DescInfo}}</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
6 vuotta sitten
<script>
6 vuotta sitten
var dragImgUpload = new DragImgUpload("#drop_area",{
callback:function (files) {
//回调函数,可以传递给后台等等
var file = files[0];
console.log(file.name);
6 vuotta sitten
var formData = new FormData();
formData.append("imgfile",file );
if(!/\.(gif|jpg|jpeg|png|GIF|JPG|PNG)$/.test(file.name))
{
return false;
}else{
$.ajax({
url: '/himg/upload',
type:'POST',
contentType: false,
processData: false,
data: formData,
success:function(data,textstatus){
if (data.Status == 0){
this.$message.success("上传成功")
6 vuotta sitten
}else{
this.$message.error("上传失败")
6 vuotta sitten
}
}
});
}
}
})
6 vuotta sitten
function refresh() {
window.location.href = window.location.href
}
$(function () {
$("#editBtn").click(function () {
layer.open({
type: 2,
title: '修改个人资料',
shadeClose: true,
shade: 0.5,
area: ['450px', '415px'],
content: '/iframe/user.html' //iframe的url
});
})
})
</script>
</html>