Spring Boot
to be fan
名乎利乎道路奔波休碌碌,来者往者溪山清净且停停
展开
-
windows下docker部署vue和spring boot以及docker-compose的使用
docker的理解首先,docker是基于linux系统的,它有两个核心images镜像和container容器,镜像就相当于你装系统时的win7系统镜像,容器就是你安装完成后的win7系统,那么docker就是在你真实的系统上,生成了多个虚拟的linux系统,它们之间互相不影响而且还很纯净,如果你想重头再来就把容器删了,用镜像再生成一个,爽哉docker desktop的安装前提:必须是win10系统以上1、下载docker客户端docker desktop,什么也不要更改一路next,强迫症不想原创 2021-11-11 11:56:21 · 3208 阅读 · 0 评论 -
spring boot开启UDP服务
pom<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-integration</artifactId></dependency><dependency> <groupId>org.springframework.integration</group原创 2021-08-26 09:43:05 · 964 阅读 · 0 评论 -
vue+spring boot开启websocket
前端// socketMixin.jsconst BASE_URL = process.env.VUE_APP_REQUEST_BASE_URLexport default { data() { return { socket: null } }, methods: { openSocket() { let base_url = BASE_URL.includes("http") ?原创 2021-08-25 17:27:14 · 107 阅读 · 0 评论 -
spring boot登录流程之登录成功返回token
controller@PostMapping("/login")public Result<JSONObject> login(@RequestBody UserLoginModel userLoginModel) throws Exception { Result<JSONObject> result = new Result<>(); // 解密 String username = userLoginUtil.decrypt(userLog原创 2021-08-25 15:15:57 · 1767 阅读 · 0 评论 -
spring boot登录流程之加密通信
controller @GetMapping("/getSecret") @ApiOperation("获取密钥") public Result<String> getSecret() throws NoSuchAlgorithmException { String publicKey = userLoginUtil.getPublicKey(); Result result = new Result<String>();原创 2021-08-25 14:54:04 · 268 阅读 · 0 评论 -
spring boot登录流程之图片验证码
controller private String codeCheckKey; // redis存储的key,用于验证 private static final String BASE_CHECK_CODES = "qwertyuiplkjhgfdsazxcvbnmQWERTYUPLKJHGFDSAZXCVBNM1234567890"; // 验证码的随机字符串 @ApiOperation("获取验证码") @GetMapping(value = "/randomImage/{ke原创 2021-08-25 14:14:45 · 272 阅读 · 0 评论 -
spring boot请求拦截器与CORS跨域
框架注入@Configurationpublic class AuthorityConfigurer implements WebMvcConfigurer { @Bean public AuthorityInterceptor authorityInterceptor() { return new AuthorityInterceptor(); } @Override // 跨域配置 public void addCorsMapp原创 2021-08-24 17:16:31 · 395 阅读 · 0 评论 -
JAVA的集合遍历
通用遍历不适用于Map,因为它不继承于Collection接口for循环 for (int i = 0; i < list.size(); i++) { int j = (Integer) list.get(i); }增强for for(int i : list) { System.out.println(i); }迭代器遍历 Iterator it = list.iterator(); while (it.ha原创 2021-07-21 15:08:47 · 33 阅读 · 0 评论 -
JAVA中的类型转换
String转Intint i = Integer.parseInt(str);byte[]转String// type[] -> bufferString str = new String(buffer, "GBK").trim();String转Jsonimport com.alibaba.fastjson.JSON;import com.alibaba.fastjson.JSONObject;JSONObject jj = JSON.parseObject(str);Js原创 2021-07-21 13:40:45 · 45 阅读 · 0 评论 -
spring boot图片上传和下载
图片上传流程步骤前端传送图片(base64)到服务器服务器将base64转换为byte []服务器根据存储路径生成文件,然后以流的方式写入byte[]前端请求图片服务器根据路径读取文件,以流的方式返回前端上传图片<input type="file" class="img-upload" @change="uploadChange" accept="image/*"/>uploadChange(el) { let that = this;原创 2021-06-17 19:22:48 · 1551 阅读 · 0 评论 -
Redis工具类
package com.ofilm.ofilmservice.common.util;import org.springframework.beans.factory.annotation.Autowired;import org.springframework.data.redis.core.RedisTemplate;import org.springframework.stereotype.Component;import org.springframework.util.Collectio原创 2021-06-07 15:52:43 · 119 阅读 · 0 评论 -
Mybatais多条件分页查询
Controller@GetMapping("/list")public Result<IPage<AssetsInventory>> inventoryList(@RequestParam(value = "pageNo", required = true) Integer pageNo, @RequestParam(value = "pageSize", required原创 2021-06-04 17:17:53 · 454 阅读 · 0 评论 -
GET请求的参数转义
前端将数组序列化后作为参数传给后台,因为“[ ]”的存在会直接导致报错解决方法:前端:原创 2021-06-04 16:46:53 · 4241 阅读 · 0 评论