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