|  | @@ -0,0 +1,31 @@
 | 
											
												
													
														|  | 
 |  | +package com.ym.mec.student.interceptor;
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +import com.ym.mec.auth.api.client.SysUserFeignService;
 | 
											
												
													
														|  | 
 |  | +import com.ym.mec.auth.api.entity.SysUser;
 | 
											
												
													
														|  | 
 |  | +import com.yonge.log.interceptor.AuditLogInterceptor;
 | 
											
												
													
														|  | 
 |  | +import org.springframework.beans.factory.annotation.Autowired;
 | 
											
												
													
														|  | 
 |  | +import org.springframework.context.annotation.Lazy;
 | 
											
												
													
														|  | 
 |  | +import org.springframework.stereotype.Component;
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +import javax.servlet.ServletException;
 | 
											
												
													
														|  | 
 |  | +import javax.servlet.http.HttpServletRequest;
 | 
											
												
													
														|  | 
 |  | +import javax.servlet.http.HttpServletResponse;
 | 
											
												
													
														|  | 
 |  | +import java.io.IOException;
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +@Component
 | 
											
												
													
														|  | 
 |  | +public class OperationLogInterceptor extends AuditLogInterceptor {
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +	@Autowired
 | 
											
												
													
														|  | 
 |  | +	@Lazy
 | 
											
												
													
														|  | 
 |  | +	private SysUserFeignService sysUserFeignService;
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +	@Override
 | 
											
												
													
														|  | 
 |  | +	public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws ServletException, IOException {
 | 
											
												
													
														|  | 
 |  | +		SysUser sysUser = sysUserFeignService.queryUserInfo();
 | 
											
												
													
														|  | 
 |  | +		if (sysUser != null) {
 | 
											
												
													
														|  | 
 |  | +			setUsername(sysUser.getRealName());
 | 
											
												
													
														|  | 
 |  | +		}
 | 
											
												
													
														|  | 
 |  | +		return true;
 | 
											
												
													
														|  | 
 |  | +	}
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +}
 |