|
@ -1,6 +1,30 @@ |
|
|
{{template "header" .}} |
|
|
{{template "header" .}} |
|
|
<title>我的资料 - 码农随笔</title> |
|
|
<title>我的资料 - 码农随笔</title> |
|
|
<script type="text/javascript" src="/static/js/upload.js"></script> |
|
|
<style> |
|
|
|
|
|
.avatar-uploader .el-upload { |
|
|
|
|
|
border: 1px dashed #d9d9d9; |
|
|
|
|
|
border-radius: 6px; |
|
|
|
|
|
cursor: pointer; |
|
|
|
|
|
position: relative; |
|
|
|
|
|
overflow: hidden; |
|
|
|
|
|
} |
|
|
|
|
|
.avatar-uploader .el-upload:hover { |
|
|
|
|
|
border-color: #409EFF; |
|
|
|
|
|
} |
|
|
|
|
|
.avatar-uploader-icon { |
|
|
|
|
|
font-size: 28px; |
|
|
|
|
|
color: #8c939d; |
|
|
|
|
|
width: 178px; |
|
|
|
|
|
height: 178px; |
|
|
|
|
|
line-height: 178px; |
|
|
|
|
|
text-align: center; |
|
|
|
|
|
} |
|
|
|
|
|
.avatar { |
|
|
|
|
|
width: 178px; |
|
|
|
|
|
height: 178px; |
|
|
|
|
|
display: block; |
|
|
|
|
|
} |
|
|
|
|
|
</style> |
|
|
</head> |
|
|
</head> |
|
|
<body style="background-color: #f9f9f9"> |
|
|
<body style="background-color: #f9f9f9"> |
|
|
<div class="root-container"> |
|
|
<div class="root-container"> |
|
@ -17,9 +41,15 @@ |
|
|
</span> |
|
|
</span> |
|
|
</div> |
|
|
</div> |
|
|
<div style="display: flex"> |
|
|
<div style="display: flex"> |
|
|
<div style="width: 160px"> |
|
|
<div style="width: 200px;margin-top: 10px"> |
|
|
<img src="{{.HeadImg}}" alt="头像" class="img-circle img-circle-large"> |
|
|
<el-upload |
|
|
<div id="drop_area" style="margin-top: 15px"></div> |
|
|
class="avatar-uploader" |
|
|
|
|
|
action="/himg/upload" |
|
|
|
|
|
:show-file-list="false" |
|
|
|
|
|
:on-success="handleAvatarSuccess"> |
|
|
|
|
|
<img v-if="imageUrl" :src="imageUrl" class="avatar"> |
|
|
|
|
|
<i v-else class="el-icon-plus avatar-uploader-icon"></i> |
|
|
|
|
|
</el-upload> |
|
|
</div> |
|
|
</div> |
|
|
<div class="info-header"> |
|
|
<div class="info-header"> |
|
|
<div style="display: flex"> |
|
|
<div style="display: flex"> |
|
@ -29,8 +59,6 @@ |
|
|
<div> |
|
|
<div> |
|
|
<span>博客 {{.User.BlogCount}}</span> |
|
|
<span>博客 {{.User.BlogCount}}</span> |
|
|
<span>浏览量 {{.User.BlogBrowes}}</span> |
|
|
<span>浏览量 {{.User.BlogBrowes}}</span> |
|
|
<span>博客 {{.User.BlogCount}}</span> |
|
|
|
|
|
<span>博客 {{.User.BlogCount}}</span> |
|
|
|
|
|
</div> |
|
|
</div> |
|
|
<hr style="height:1px;border:none;border-top:1px solid #EEE;margin: 10px 0 5px 0;"/> |
|
|
<hr style="height:1px;border:none;border-top:1px solid #EEE;margin: 10px 0 5px 0;"/> |
|
|
<div> |
|
|
<div> |
|
@ -38,54 +66,61 @@ |
|
|
<p style="flex: 1">昵称 :{{.User.NickName}}</p> |
|
|
<p style="flex: 1">昵称 :{{.User.NickName}}</p> |
|
|
<p><a href="javascript:void(0)" style="text-decoration: none" id="editBtn">修改资料</a></p> |
|
|
<p><a href="javascript:void(0)" style="text-decoration: none" id="editBtn">修改资料</a></p> |
|
|
</div> |
|
|
</div> |
|
|
<p>生日 :{{.User.Birthday.Format "2006-01-02"}}</p> |
|
|
|
|
|
<p>邮箱 :{{.User.Email}}</p> |
|
|
<p>邮箱 :{{.User.Email}}</p> |
|
|
<p>手机 :{{.User.Mobile}}</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> |
|
|
<p>简介 :{{.User.DescInfo}}</p> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<!-- <el-dialog title="编辑个人信息" :visible.sync="dialogFormVisible">--> |
|
|
|
|
|
<!-- <el-form :model="form">--> |
|
|
|
|
|
<!-- <el-form-item label="活动名称" :label-width="150px">--> |
|
|
|
|
|
<!-- <el-input v-model="form.nickName"></el-input>--> |
|
|
|
|
|
<!-- </el-form-item>--> |
|
|
|
|
|
<!-- </el-form>--> |
|
|
|
|
|
<!-- <div slot="footer" class="dialog-footer">--> |
|
|
|
|
|
<!-- <el-button @click="dialogFormVisible = false">取 消</el-button>--> |
|
|
|
|
|
<!-- <el-button type="primary" @click="dialogFormVisible = false">确 定</el-button>--> |
|
|
|
|
|
<!-- </div>--> |
|
|
|
|
|
<!-- </el-dialog>--> |
|
|
</div> |
|
|
</div> |
|
|
</body> |
|
|
</body> |
|
|
<script> |
|
|
<script> |
|
|
var dragImgUpload = new DragImgUpload("#drop_area",{ |
|
|
var app = new Vue({ |
|
|
callback:function (files) { |
|
|
el: ".root-container", |
|
|
//回调函数,可以传递给后台等等 |
|
|
delimiters: ['${', '}'], |
|
|
var file = files[0]; |
|
|
data: { |
|
|
console.log(file.name); |
|
|
dialogFormVisible: false, |
|
|
|
|
|
imageUrl: '', |
|
|
|
|
|
form: { |
|
|
|
|
|
nickName: '', |
|
|
|
|
|
email: '', |
|
|
|
|
|
mobile: '' |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
created() { |
|
|
|
|
|
console.log({{.User}}) |
|
|
|
|
|
this.imageUrl = {{.HeadImg}} |
|
|
|
|
|
}, |
|
|
|
|
|
methods: { |
|
|
|
|
|
editBtn(){ |
|
|
|
|
|
|
|
|
var formData = new FormData(); |
|
|
}, |
|
|
formData.append("imgfile",file ); |
|
|
handleAvatarSuccess(res, file){ |
|
|
if(!/\.(gif|jpg|jpeg|png|GIF|JPG|PNG)$/.test(file.name)) |
|
|
if(res.Status === 0){ |
|
|
{ |
|
|
this.imageUrl = res.Data |
|
|
return false; |
|
|
this.$message.success('上传成功') |
|
|
}else{ |
|
|
} else if(res.Status === 401){ |
|
|
$.ajax({ |
|
|
window.location.href = "/login" |
|
|
url: '/himg/upload', |
|
|
} else { |
|
|
type:'POST', |
|
|
this.$message.error('上传成功') |
|
|
contentType: false, |
|
|
|
|
|
processData: false, |
|
|
|
|
|
data: formData, |
|
|
|
|
|
success:function(data,textstatus){ |
|
|
|
|
|
if (data.Status == 0){ |
|
|
|
|
|
this.$message.success("上传成功") |
|
|
|
|
|
}else{ |
|
|
|
|
|
this.$message.error("上传失败") |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
function refresh() { |
|
|
function refresh() { |
|
|
window.location.href = window.location.href |
|
|
window.location.href = window.location.href |
|
|
} |
|
|
} |
|
|