saas 优化
parent
0595237e8b
commit
4ff91624fe
|
@ -86,6 +86,12 @@
|
||||||
<groupId>com.muyu</groupId>
|
<groupId>com.muyu</groupId>
|
||||||
<artifactId>cloud-common-rabbit</artifactId>
|
<artifactId>cloud-common-rabbit</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>cloud-common-saas</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|
|
@ -1,9 +1,13 @@
|
||||||
package com.muyu.fence;
|
package com.muyu.fence;
|
||||||
|
|
||||||
|
import com.alibaba.druid.spring.boot3.autoconfigure.DruidDataSourceAutoConfigure;
|
||||||
|
import com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DynamicDataSourceAutoConfiguration;
|
||||||
import com.muyu.common.security.annotation.EnableCustomConfig;
|
import com.muyu.common.security.annotation.EnableCustomConfig;
|
||||||
import com.muyu.common.security.annotation.EnableMyFeignClients;
|
import com.muyu.common.security.annotation.EnableMyFeignClients;
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
||||||
|
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 系统模块
|
* 系统模块
|
||||||
|
@ -13,7 +17,12 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
@EnableCustomConfig
|
@EnableCustomConfig
|
||||||
//@EnableCustomSwagger2
|
//@EnableCustomSwagger2
|
||||||
@EnableMyFeignClients
|
@EnableMyFeignClients
|
||||||
@SpringBootApplication
|
@SpringBootApplication(exclude = {
|
||||||
|
DataSourceAutoConfiguration.class,
|
||||||
|
DruidDataSourceAutoConfigure.class,
|
||||||
|
DynamicDataSourceAutoConfiguration.class
|
||||||
|
})
|
||||||
|
|
||||||
public class CloudElectronicFenceApplication {
|
public class CloudElectronicFenceApplication {
|
||||||
public static void main (String[] args) {
|
public static void main (String[] args) {
|
||||||
SpringApplication.run(CloudElectronicFenceApplication.class, args);
|
SpringApplication.run(CloudElectronicFenceApplication.class, args);
|
||||||
|
|
|
@ -6,7 +6,7 @@ nacos:
|
||||||
addr: 47.101.53.251:8848
|
addr: 47.101.53.251:8848
|
||||||
user-name: nacos
|
user-name: nacos
|
||||||
password: nacos
|
password: nacos
|
||||||
namespace: lgy
|
namespace: four
|
||||||
# SPRING_AMQP_DESERIALIZATION_TRUST_ALL=true spring.amqp.deserialization.trust.all
|
# SPRING_AMQP_DESERIALIZATION_TRUST_ALL=true spring.amqp.deserialization.trust.all
|
||||||
# Spring
|
# Spring
|
||||||
spring:
|
spring:
|
||||||
|
|
|
@ -59,6 +59,18 @@
|
||||||
<groupId>com.muyu</groupId>
|
<groupId>com.muyu</groupId>
|
||||||
<artifactId>cloud-common-api-doc</artifactId>
|
<artifactId>cloud-common-api-doc</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba</groupId>
|
||||||
|
<artifactId>druid-spring-boot-3-starter</artifactId>
|
||||||
|
<version>1.2.23</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.baomidou</groupId>
|
||||||
|
<artifactId>dynamic-datasource-spring-boot3-starter</artifactId>
|
||||||
|
<version>4.3.0</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
|
|
@ -1,15 +1,23 @@
|
||||||
package com.muyu.file;
|
package com.muyu.file;
|
||||||
|
|
||||||
|
import com.alibaba.druid.spring.boot3.autoconfigure.DruidDataSourceAutoConfigure;
|
||||||
|
import com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DynamicDataSourceAutoConfiguration;
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
||||||
|
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 文件服务
|
* 文件服务
|
||||||
*
|
*
|
||||||
* @author muyu
|
* @author muyu
|
||||||
*/
|
*/
|
||||||
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
|
@SpringBootApplication(exclude = {
|
||||||
|
DataSourceAutoConfiguration.class,
|
||||||
|
DruidDataSourceAutoConfigure.class,
|
||||||
|
DynamicDataSourceAutoConfiguration.class
|
||||||
|
})
|
||||||
|
@EnableFeignClients
|
||||||
public class CloudFileApplication {
|
public class CloudFileApplication {
|
||||||
public static void main (String[] args) {
|
public static void main (String[] args) {
|
||||||
SpringApplication.run(CloudFileApplication.class, args);
|
SpringApplication.run(CloudFileApplication.class, args);
|
||||||
|
|
|
@ -78,6 +78,8 @@
|
||||||
<artifactId>cloud-common-xxl</artifactId>
|
<artifactId>cloud-common-xxl</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.muyu.system;
|
package com.muyu.system;
|
||||||
|
|
||||||
|
import com.alibaba.druid.spring.boot3.autoconfigure.DruidDataSourceAutoConfigure;
|
||||||
import com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DynamicDataSourceAutoConfiguration;
|
import com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DynamicDataSourceAutoConfiguration;
|
||||||
import com.muyu.common.security.annotation.EnableCustomConfig;
|
import com.muyu.common.security.annotation.EnableCustomConfig;
|
||||||
import com.muyu.common.security.annotation.EnableMyFeignClients;
|
import com.muyu.common.security.annotation.EnableMyFeignClients;
|
||||||
|
|
|
@ -44,12 +44,8 @@ public class SysProfileController extends BaseController {
|
||||||
*/
|
*/
|
||||||
@GetMapping
|
@GetMapping
|
||||||
public Result profile () {
|
public Result profile () {
|
||||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
String username = SecurityUtils.getUsername();
|
||||||
String username = loginUser.getUsername();
|
SysUser user = userService.selectUserByName(username);
|
||||||
Firm firm = new Firm();
|
|
||||||
|
|
||||||
firm.setUserName(username);
|
|
||||||
SysUser user = userService.selectUserByUserName(firm);
|
|
||||||
return Result.success(
|
return Result.success(
|
||||||
ProfileResp.builder()
|
ProfileResp.builder()
|
||||||
.roleGroup( userService.selectUserRoleGroup(username) )
|
.roleGroup( userService.selectUserRoleGroup(username) )
|
||||||
|
@ -92,9 +88,8 @@ public class SysProfileController extends BaseController {
|
||||||
@PutMapping("/updatePwd")
|
@PutMapping("/updatePwd")
|
||||||
public Result updatePwd (String oldPassword, String newPassword) {
|
public Result updatePwd (String oldPassword, String newPassword) {
|
||||||
String username = SecurityUtils.getUsername();
|
String username = SecurityUtils.getUsername();
|
||||||
Firm firm = new Firm();
|
|
||||||
firm.setUserName(username);
|
SysUser user = userService.selectUserByName(username);
|
||||||
SysUser user = userService.selectUserByUserName(firm);
|
|
||||||
String password = user.getPassword();
|
String password = user.getPassword();
|
||||||
if (!SecurityUtils.matchesPassword(oldPassword, password)) {
|
if (!SecurityUtils.matchesPassword(oldPassword, password)) {
|
||||||
return error("修改密码失败,旧密码错误");
|
return error("修改密码失败,旧密码错误");
|
||||||
|
|
|
@ -46,7 +46,7 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
|
||||||
*
|
*
|
||||||
* @return 用户对象信息
|
* @return 用户对象信息
|
||||||
*/
|
*/
|
||||||
public SysUser selectUserByUserName (String userName);
|
public SysUser selectUserByUserName (@Param("userName") String userName);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过用户ID查询用户
|
* 通过用户ID查询用户
|
||||||
|
|
|
@ -229,4 +229,6 @@ public interface SysUserService extends IService<SysUser> {
|
||||||
|
|
||||||
List<SysUser> selectCompanyList();
|
List<SysUser> selectCompanyList();
|
||||||
|
|
||||||
|
SysUser selectUserByName(String username);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -609,4 +609,9 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
||||||
return userMapper.selectCompanyList();
|
return userMapper.selectCompanyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SysUser selectUserByName(String username) {
|
||||||
|
return userMapper.selectUserByUserName(username);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue