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() http.authorizeRequests()
.antMatchers("/", "/*.html", "/favicon.ico", "/css/**", "/js/**", "/fonts/**", "/layui/**", "/img/**", .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(); .permitAll().anyRequest().authenticated();
http.formLogin().loginPage("/login.html").loginProcessingUrl("/login") http.formLogin().loginPage("/login.html").loginProcessingUrl("/login")
.successHandler(authenticationSuccessHandler).failureHandler(authenticationFailureHandler).and() .successHandler(authenticationSuccessHandler).failureHandler(authenticationFailureHandler).and()

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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