wei.zhang2 2017-10-16 15:50:29 +08:00
parent 8316472e43
commit 96c601ba12
8 changed files with 14 additions and 8 deletions

View File

@ -55,7 +55,8 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
http.authorizeRequests()
.antMatchers("/", "/*.html", "/favicon.ico", "/css/**", "/js/**", "/fonts/**", "/layui/**", "/img/**",
"/v2/api-docs/**", "/swagger-resources/**", "/webjars/**", "/pages/**", "/druid/**")
"/v2/api-docs/**", "/swagger-resources/**", "/webjars/**", "/pages/**", "/druid/**",
"/statics/**")
.permitAll().anyRequest().authenticated();
http.formLogin().loginPage("/login.html").loginProcessingUrl("/login")
.successHandler(authenticationSuccessHandler).failureHandler(authenticationFailureHandler).and()

View File

@ -63,7 +63,7 @@ public class FileController {
layuiFile.setCode(0);
LayuiFileData data = new LayuiFileData();
layuiFile.setData(data);
data.setSrc(domain + "/files" + fileInfo.getUrl());
data.setSrc(domain + "/statics" + fileInfo.getUrl());
data.setTitle(file.getOriginalFilename());
return layuiFile;

View File

@ -105,7 +105,7 @@ function init(){
var type = row['type'];
var u = "";
if(type == 1) {
var src = domain + "/files" + url;
var src = domain + "/statics" + url;
u = "<a target='_blank' href='" + src +"'><img width='30' src='" + src + "'></img></a>";
} else {
u = url;

View File

@ -56,7 +56,7 @@
layedit = layui.layedit;
layedit.set({
uploadImage: {
url: '/files/layui?domain=' + domain,
url: '/files/layui?domain=' + domain+"&token="+localStorage.getItem("token"),
type: 'post'
}
});

View File

@ -59,7 +59,7 @@
layedit = layui.layedit;
layedit.set({
uploadImage: {
url: '/files/layui?domain=' + domain,
url: '/files/layui?domain=' + domain+"&token="+localStorage.getItem("token"),
type: 'post'
}
});

View File

@ -82,7 +82,7 @@
layedit = layui.layedit;
layedit.set({
uploadImage: {
url: '/files/layui?domain=' + domain,
url: '/files/layui?domain=' + domain+"&token="+localStorage.getItem("token"),
type: 'post'
}
});

View File

@ -29,7 +29,7 @@
success : function(data) {
var url = data.headImgUrl;
if(url!=null && url!=""){
var src = domain + "/files" + url;
var src = domain + "/statics" + url;
var a = "<a target='_blank' href='" + src +"'><img src='" + src + "'></img></a>";
$("#headImgDiv").html(a);
}
@ -52,9 +52,12 @@
async : false,
success : function(data) {
layer.msg("上传成功");
var src = domain + "/files" + url;
var src = domain + "/statics" + url;
var a = "<a target='_blank' href='" + src +"'><img src='" + src + "'></img></a>";
$("#headImgDiv").html(a);
var img = parent.$(".admin-header-user img");
img.attr("src", src);
}
});
}

View File

@ -82,6 +82,8 @@ function showLoginInfo(){
}
url = domain + url;
} else {
url = domain + "/statics" + url;
}
var img = $(".admin-header-user img");
img.attr("src", url);