mirror of
https://github.com/201206030/novel-plus.git
synced 2025-04-27 01:30:51 +00:00
个人中心新增头像设置
This commit is contained in:
parent
e673f9be9d
commit
48aff7cf37
@ -7,4 +7,4 @@ pic:
|
||||
save:
|
||||
type: 1 #图片保存方式, 1不保存,使用爬取的网络图片 ,2保存在自己的存储介质
|
||||
storage: local #存储介质,local:本地,OSS:阿里云对象存储,fastDfs:分布式文件系统
|
||||
path: /var/pic #图片保存路径
|
||||
path: /Users/xiongxiaoyang/java #图片保存路径
|
@ -2,6 +2,9 @@ spring:
|
||||
profiles:
|
||||
include: [common-prod]
|
||||
|
||||
#静态文件路径配置
|
||||
resources:
|
||||
static-locations: file:${user.dir}/templates/${templates.name}/static/
|
||||
#thymeleaf模版路径配置
|
||||
thymeleaf:
|
||||
prefix: file:${user.dir}/templates/${templates.name}/html/
|
||||
|
@ -26,9 +26,6 @@ spring:
|
||||
uris: http://192.168.0.105:9200
|
||||
|
||||
|
||||
#静态文件路径配置
|
||||
resources:
|
||||
static-locations: file:${user.dir}/templates/${templates.name}/static/
|
||||
|
||||
redisson:
|
||||
singleServerConfig:
|
||||
|
@ -25,7 +25,14 @@
|
||||
<div class="my_info cf">
|
||||
<div class="my_info_txt">
|
||||
<ul class="mytab_list">
|
||||
<li><i class="tit">我的头像</i><a href="javascript:void(0);"><img id="imgLogo" class="user_img" alt="我的头像" src="/images/man.png" /></a></li>
|
||||
<li ><i class="tit">我的头像</i>
|
||||
<a style="position: relative" >
|
||||
<img id="imgLogo" class="user_img" alt="我的头像" src="/images/man.png" />
|
||||
<input class="opacity" onchange="picChange()" type="file" id="file0" name="file" title="点击上传图片" style="z-index: 100;cursor: pointer;left: 0px; top: -25px; width: 60px; height: 80px; opacity: 0; position: absolute; "/>
|
||||
|
||||
</a>
|
||||
|
||||
</li>
|
||||
<li><i class="tit">我的昵称</i><a href="/user/set_name.html" id="my_name"></a></li>
|
||||
<li style="display:none"><i class="tit">电子邮箱</i><a href="javascript:void(0);"></a></li>
|
||||
<li><i class="tit">我的性别</i><a href="/user/set_sex.html" id="my_sex"></a></li>
|
||||
@ -42,6 +49,7 @@
|
||||
</div>
|
||||
<div th:replace="common/js :: js"></div>
|
||||
<script src="/javascript/user.js" type="text/javascript"></script>
|
||||
<script src="/javascript/ajaxfileupload.js" type="text/javascript"></script>
|
||||
<script type="text/javascript">
|
||||
//查询用户信息
|
||||
$.ajax({
|
||||
@ -82,6 +90,58 @@
|
||||
layer.alert('网络异常');
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
function picChange() {
|
||||
var file = $("#file0").val(); //文件名称
|
||||
if (file != "") {
|
||||
|
||||
$.ajaxFileUpload({
|
||||
url : "/file/upload", //用于文件上传的服务器端请求地址
|
||||
secureuri : false, //是否需要安全协议,一般设置为false
|
||||
fileElementId : "file0", //文件上传域的ID
|
||||
dataType : "json", //返回值类型 一般设置为json
|
||||
type : "post",
|
||||
success : function(data) { //服务器成功响应处理函数
|
||||
if (data.code == 200) {
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/user/updateUserInfo",
|
||||
data: {'userPhoto':data.data},
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
if (data.code == 200) {
|
||||
window.location.href = '/user/setup.html';
|
||||
|
||||
} else if (data.code == 1001) {
|
||||
//未登录
|
||||
location.href = '/user/login.html?originUrl=' + decodeURIComponent(location.href);
|
||||
|
||||
} else {
|
||||
layer.alert(data.msg);
|
||||
}
|
||||
|
||||
},
|
||||
error: function () {
|
||||
layer.alert('网络异常');
|
||||
}
|
||||
})
|
||||
|
||||
}else {
|
||||
layer.alert('图片上传失败');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
} else {
|
||||
alert("请选择上传文件!");
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
Loading…
x
Reference in New Issue
Block a user