启动类优化&修改密码接口加权限

This commit is contained in:
linfeng 2022-10-10 17:10:20 +08:00
parent 84c89d95bc
commit b63c3f1903
8 changed files with 30 additions and 36 deletions

10
pom.xml
View File

@ -6,7 +6,7 @@
<artifactId>linfeng-community</artifactId>
<version>3.0.0</version>
<packaging>jar</packaging>
<description>林风社交论坛项目</description>
<description>林风社交论坛项目开源版</description>
<parent>
<groupId>org.springframework.boot</groupId>
@ -272,14 +272,6 @@
<groupId>com.spotify</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>0.4.14</version>
<!--<executions>-->
<!--<execution>-->
<!--<phase>package</phase>-->
<!--<goals>-->
<!--<goal>build</goal>-->
<!--</goals>-->
<!--</execution>-->
<!--</executions>-->
<configuration>
<imageName>project/fast</imageName>
<dockerDirectory>${project.basedir}</dockerDirectory>

View File

@ -12,19 +12,36 @@
*/
package io.linfeng;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.core.env.Environment;
import java.net.InetAddress;
import java.net.UnknownHostException;
@Slf4j
@EnableAsync
@EnableTransactionManagement
@SpringBootApplication
public class Applications {
public static void main(String[] args) {
SpringApplication.run(Applications.class, args);
public static void main(String[] args) throws UnknownHostException {
ConfigurableApplicationContext application = SpringApplication.run(Applications.class, args);
Environment env = application.getEnvironment();
log.info("\n----------------------------------------------------------------\n\t" +
"林风社交论坛开源版 '{}' 运行成功! 访问连接:\n\t" +
"Swagger文档: \t\thttp://{}:{}/doc.html\n\t" +
"数据库监控: \t\thttp://{}:{}/druid\n" +
"----------------------------------------------------------------",
env.getProperty("spring.application.name"),
InetAddress.getLocalHost().getHostAddress(),
env.getProperty("server.port"),
"127.0.0.1",
env.getProperty("server.port"));
}
}

View File

@ -47,7 +47,7 @@ public class SwaggerConfig implements WebMvcConfigurer {
return new ApiInfoBuilder()
.title("林风社交论坛项目接口文档")
.description("林风社交论坛项目开源版接口文档 演示地址 https://www.linfeng.tech")
.contact(new Contact("linfeng","http:localhost:8080/doc.html","3582996245@qq.com"))
.contact(new Contact("linfeng","http:localhost:8080/doc.html","linfengtech001@163.com"))
.version("1.0")
.build();

View File

@ -66,16 +66,7 @@ public class SensitiveController {
return R.ok().put("sensitive", sensitive);
}
/**
* 保存
*/
@RequestMapping("/save")
@RequiresPermissions("admin:sensitive:save")
public R save(@RequestBody SensitiveEntity sensitive){
sensitiveService.save(sensitive);
return R.ok();
}
/**
* 修改
@ -88,15 +79,6 @@ public class SensitiveController {
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
@RequiresPermissions("admin:sensitive:delete")
public R delete(@RequestBody Long[] ids){
sensitiveService.removeByIds(Arrays.asList(ids));
return R.ok();
}
}

View File

@ -69,6 +69,7 @@ public class SysUserController extends AbstractController {
@ApiOperation("修改密码")
@SysLog("修改密码")
@PostMapping("/password")
@RequiresPermissions("sys:user:update")
public R password(@RequestBody PasswordForm form){
Assert.isBlank(form.getNewPassword(), "新密码不为能空");

View File

@ -9,6 +9,8 @@ server:
context-path:
spring:
application:
name: linfeng-community-ky
# 环境 dev|test|prod
profiles:
active: dev

View File

@ -1,6 +1,6 @@
===================================================================================================================================
欢迎使用林风社交论坛项目开源版后端api
https://www.linfeng.tech
欢迎使用林风社交论坛项目开源版后端服务
演示站点: https://www.linfeng.tech
===================================================================================================================================

View File

@ -3,12 +3,12 @@ const shareH5Url = "https://www.linfeng.tech/#/"; //H5分享路径
//本地环境配置
const baseUrl = "localhost:8080";
const domain = 'http://' + baseUrl + "/app/";
// const baseUrl = "localhost:8080";
// const domain = 'http://' + baseUrl + "/app/";
//线上环境配置
// const baseUrl = "wxapi.linfeng.tech";
// const domain = 'https://' + baseUrl + "/app/";
const baseUrl = "wxapi.linfeng.tech";
const domain = 'https://' + baseUrl + "/app/";
export default {