FastDFS 笔记(4)—— 防盗链

设置 编辑文件: sudo vim /etc/fdfs/http.conf 修改如下: # 是否启用密钥访问 http.anti_steal.check_token = true # 访问密钥 http.anti_steal.secret_key = FastDFS1234567890 # 错误密钥访问……

FastDFS 笔记(3)—— FastDFS Java Client

依赖(用的其他人传的老版本的): <dependency> <groupId>net.oschina.zcx7878</groupId> <artifactId>fastdfs-client-java</artifactId> <version>1.27.0.0</version> </dependency> 上传 测试代码: @SpringBootTest class FastdfsdemoApplicationTests { @Test void contextLoads() throws IOException, MyException { ClientGlobal.initByProperties("fastdfs-client.properties"); TrackerClient trackerClient……

FastDFS 笔记(1)—— 单机部署

FastDFS # 安装编译所需的库和工具 sudo apt -y install libev-dev git gcc g++ make automake autoconf libtool pcre2-utils libpcre2-dev zlib1g zlib1g-dev openssl libssh-dev wget vim # fastdfs 文件存储路径 sudo……

Spring Security 笔记(3)——授权

测试用户(暂用 inMemoryAuthentication): @Override protected void configure(AuthenticationManagerBuilder auth) throws Exception { auth.inMemoryAuthentication() .withUser("bolitao") .password("bolitao")……

Spring Security 笔记(2)——RESTful

登陆成功返回 json 修改 configure(HttpSecurity http) 如下: @Override protected void configure(HttpSecurity http) throws Exception { http.authorizeRequests() .anyRequest().authenticated() .and() .formLogin() .loginPage("/login.html") .loginProcessingUrl("/login") .usernameParameter("username") .passwordParameter("passwd") .successHandler((req, resp, authentication) -> { resp.setContentType("application/json;charset=utf-8"); PrintWriter writer = resp.getWriter(); writer.write(new ObjectMapper().writeValueAsString(authentication.getPrincipal()));……

ElasticSearch —— 使用 ES 实现一个搜索项目

依赖 spring boot 2.2.5.RELEASE,其他: <dependency> <groupId>com.alibaba</groupId> <artifactId>fastjson</artifactId> <version>1.2.62</version> </dependency> <!-- jsoup --> <dependency> <groupId>org.jsoup</groupId> <artifactId>jsoup</artifactId> <version>1.10.2</version> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-elasticsearch</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency>……