04 2022 档案
摘要:错误读法(小文件可以)int filesize = Integer.parseInt(recBodyEmt.element("filesize").getText());byte[] buffer = new byte[filesize];din.read(buffer); FileUtil.wri
阅读全文
摘要:登录成功 创建token String token = JwtUtils.create(customer.getCompanyId(), customer.getId(), mobile); 需要认证的接口加上认证注解 @Auth@RequestMapping("save")@ResponseBod
阅读全文
摘要:启动类 public static void main(String[] args) { SpringApplication.run(ZSClientApplication.class, args); System.out.println("Client OK"); try { ZSServerSo
阅读全文
摘要:编写一个认证拦截器 public class Auth implements HandlerInterceptor { private static Logger log = Logger.getLogger(Auth.class); //获取密钥 private String secretKey
阅读全文
摘要:自定义注解@Retention(RetentionPolicy.RUNTIME)@Target(ElementType.METHOD)@Documentedpublic @interface OperationLog { //请求方法名称 String operationName() default
阅读全文
摘要:错误代码: int i =1;bre = new BufferedReader(new FileReader(request.getBody().getLocalpath()+request.getBody().getFilename()));//此时获取到的bre就是整个文件的缓存流String
阅读全文
摘要:@ControllerAdvicepublic class GlobalExceptionHandler { Logger logger = LoggerFactory.getLogger(GlobalExceptionHandler.class); /** * 返回的Map对象会被@Respons
阅读全文
摘要:上图中zsBankService使用@Autowired是null值,原因是SignInOut类不在spring容器中。解决方法1:在SignInOut类上加上@Component注解解决方法2:写一个应用上下文的工具类 @Componentpublic class SpringContextUti
阅读全文

浙公网安备 33010602011771号