Compare commits
3 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
54769b7feb | |
|
|
40f2183d6e | |
|
|
12e3e954eb |
|
|
@ -41,7 +41,10 @@
|
|||
</dependency>
|
||||
|
||||
<!-- SpringBoot Actuator -->
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- bonus Common Security-->
|
||||
<dependency>
|
||||
|
|
|
|||
|
|
@ -169,17 +169,15 @@ public class TokenController {
|
|||
log.info("ticket=" + ticket);
|
||||
if (StringUtils.isNotEmpty(ticket)) {
|
||||
LoginUser loginUser = new LoginUser();
|
||||
SysUser sysUser = new SysUser();
|
||||
if (form.getSysType()!=null && "1".equals(form.getSysType())){
|
||||
log.info("app端登录");
|
||||
//loginUser = sysLoginService.iwsH5Login(ticket,iwsH5AppId,iwsH5Url);
|
||||
//h5和web端调用同一个接口
|
||||
loginUser = sysLoginService.iwsWebLogin(ticket,iwsH5AppId,iwsWebUrl);
|
||||
sysLoginService.iwsH5Login(ticket,iwsH5AppId,iwsH5Url,loginUser,sysUser);
|
||||
} else if (form.getSysType()!=null && "0".equals(form.getSysType())) {
|
||||
loginUser = sysLoginService.iwsWebLogin(ticket,iwsWebAppId,iwsWebUrl);
|
||||
sysLoginService.iwsWebLogin(ticket,iwsWebAppId,iwsWebUrl,loginUser,sysUser);
|
||||
}else {
|
||||
throw new ServiceException("登录失败,请稍后重试");
|
||||
}
|
||||
logService.saveLogin(loginUser.getSysUser().getUserName(), "登录", "登录成功", null, "成功");
|
||||
logService.saveLogin(sysUser.getUserName(), "登录", "登录成功", null, "成功");
|
||||
//生成系统token
|
||||
return R.ok(tokenService.createToken(loginUser));
|
||||
|
||||
|
|
|
|||
|
|
@ -47,8 +47,4 @@ public class LoginBody {
|
|||
* i皖送登录方式 0:web端登录 1:H5登录
|
||||
*/
|
||||
private String sysType;
|
||||
/**
|
||||
* i皖送登录数据库中没有用心信息的时候给个默认公司
|
||||
*/
|
||||
private Long deptId;
|
||||
}
|
||||
}
|
||||
|
|
@ -93,7 +93,6 @@ public class SysLoginService {
|
|||
* @param registerBody 注册信息
|
||||
*/
|
||||
public void register(RegisterBody registerBody) {
|
||||
log.info("开始进行注册===============");
|
||||
long startTime = System.currentTimeMillis(); // 记录开始时间
|
||||
String result = convertAndAppend(registerBody.getNickName(), registerBody.getMobile());
|
||||
int contactType = getContactType(registerBody.getMobile());
|
||||
|
|
@ -129,7 +128,7 @@ public class SysLoginService {
|
|||
SysUser sysUser = new SysUser();
|
||||
sysUser.setUserName(registerBody.getUsername());
|
||||
sysUser.setNickName(registerBody.getNickName());
|
||||
sysUser.setDeptId(registerBody.getDeptId());
|
||||
|
||||
if (systemConfig.getRegistersConfig().isApprovalStatus()){
|
||||
sysUser.setApprovalStatus("0");
|
||||
sysUser.setStatus("1");
|
||||
|
|
@ -157,7 +156,6 @@ public class SysLoginService {
|
|||
recordLogService.saveLogs(registerBody.getUsername(), startTime, "注册异常", e.getMessage(), null, "失败");
|
||||
throw new ServiceException("注册失败,请稍后重试");
|
||||
}
|
||||
log.info("结束进行注册===============");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -205,30 +203,26 @@ public class SysLoginService {
|
|||
* @param iwsWebUrl
|
||||
* @return
|
||||
*/
|
||||
public LoginUser iwsWebLogin(String ticket, String iwsWebAppId, String iwsWebUrl) {
|
||||
public void iwsWebLogin(String ticket, String iwsWebAppId, String iwsWebUrl,LoginUser loginUser,SysUser sysUser) {
|
||||
Map<String, Object> paramMap = new HashMap<>();
|
||||
LoginUser loginUser = new LoginUser();
|
||||
SysUser sysUser = new SysUser();
|
||||
paramMap.put("ticket", ticket);
|
||||
paramMap.put("appId", iwsWebAppId);
|
||||
RestTemplate restTemplate = new RestTemplate();
|
||||
ResponseEntity<String> authResponse = restTemplate.getForEntity(iwsWebUrl, String.class, paramMap);
|
||||
log.info("authResponse:" + authResponse.toString());
|
||||
// 根据ResponseEntity<String> responseEntity对象,获取body部分,body为json格式字符串
|
||||
String content = authResponse.getBody();
|
||||
// 将json字符串转化为json对象
|
||||
JSONObject json = JSONObject.parseObject(content);
|
||||
// 取出data部分对象
|
||||
JSONObject data = json.getJSONObject("data");
|
||||
|
||||
if ("200".equals(json.getInteger("code").toString())){
|
||||
if ("200".equals(authResponse.getStatusCode())){
|
||||
// 根据ResponseEntity<String> responseEntity对象,获取body部分,body为json格式字符串
|
||||
String content = authResponse.getBody();
|
||||
// 将json字符串转化为json对象
|
||||
JSONObject json = JSONObject.parseObject(content);
|
||||
// 取出data部分对象
|
||||
JSONObject data = json.getJSONObject("data");
|
||||
sysUser.setUserName(data.get("userName").toString());
|
||||
sysUser.setNickName(data.get("name").toString());
|
||||
sysUser.setPhonenumber(data.get("mobile").toString());
|
||||
loginUser.setSysUser(sysUser);
|
||||
loginUser = createUser(sysUser,loginUser);
|
||||
createUser(sysUser,loginUser);
|
||||
}
|
||||
return loginUser;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -236,51 +230,40 @@ public class SysLoginService {
|
|||
* @param sysUser
|
||||
* @param loginUser
|
||||
*/
|
||||
private LoginUser createUser(SysUser sysUser, LoginUser loginUser) {
|
||||
private void createUser(SysUser sysUser, LoginUser loginUser) {
|
||||
//通过用户名获取人员信息
|
||||
LoginUser loginUserNew = new LoginUser();
|
||||
SysUser sysUserNew = new SysUser();
|
||||
String resultName = convertAndAppend(sysUser.getNickName(), sysUser.getPhonenumber());
|
||||
R<LoginUser> userResult = remoteUserService.getUserInfo(resultName, SecurityConstants.INNER);
|
||||
|
||||
R<LoginUser> userResult = remoteUserService.getUserInfo(sysUser.getUserName(), SecurityConstants.INNER);
|
||||
if (userResult.getData() == null || R.FAIL == userResult.getCode()) {
|
||||
log.info("登录用户不存在,进行创建----");
|
||||
RegisterBody registerBody = new RegisterBody();
|
||||
registerBody.setUsername(sysUser.getUserName());
|
||||
registerBody.setNickName(sysUser.getNickName());
|
||||
registerBody.setMobile(sysUser.getPhonenumber());
|
||||
registerBody.setDeptId(1L);
|
||||
registerBody.setPassword("Bonus@Max2024");
|
||||
//获取配置中的初始密码
|
||||
AjaxResult result = configService.getConfigKey("sys.user.initPassword");
|
||||
if ("200".equals(result.get("code").toString()))
|
||||
if (result.isSuccess())
|
||||
{
|
||||
registerBody.setPassword(result.get("msg").toString());
|
||||
sysUser.setPassword(result.get("msg").toString());
|
||||
}
|
||||
log.info("开始进行注册{}",registerBody);
|
||||
//新用户注册
|
||||
try {
|
||||
register(registerBody);
|
||||
log.info("注册成功!");
|
||||
//查询用户信息
|
||||
userResult = remoteUserService.getUserInfo(resultName, SecurityConstants.INNER);
|
||||
loginUserNew = userResult.getData();
|
||||
sysUserNew = loginUserNew.getSysUser();
|
||||
log.info("获取用户信息成功!{}",loginUserNew.getSysUser());
|
||||
userResult = remoteUserService.getUserInfo(sysUser.getUserName(), SecurityConstants.INNER);
|
||||
loginUser = userResult.getData();
|
||||
sysUser = loginUser.getSysUser();
|
||||
//初始化一个角色
|
||||
Long[] roleIds = new Long[5];
|
||||
// 将数组的第一个元素赋值为 2
|
||||
roleIds[0] = 2L;
|
||||
log.info("开始绑定角色信息{}",roleIds);
|
||||
remoteUserService.insertAuthRole(sysUserNew.getUserId(),roleIds,SecurityConstants.INNER);
|
||||
log.info("角色信息绑定成功!");
|
||||
remoteUserService.insertAuthRole(sysUser.getUserId(),roleIds,SecurityConstants.INNER);
|
||||
}catch (Exception e){
|
||||
throw new ServiceException("登录失败,请稍后重试");
|
||||
}
|
||||
}else {
|
||||
loginUserNew = userResult.getData();
|
||||
loginUser = userResult.getData();
|
||||
sysUser = loginUser.getSysUser();
|
||||
}
|
||||
return loginUserNew;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -290,31 +273,26 @@ public class SysLoginService {
|
|||
* @param iwsH5Url
|
||||
* @return
|
||||
*/
|
||||
public LoginUser iwsH5Login(String ticket, String iwsH5AppId, String iwsH5Url) {
|
||||
public void iwsH5Login(String ticket, String iwsH5AppId, String iwsH5Url,LoginUser loginUser,SysUser sysUser) {
|
||||
Map<String, Object> paramMap = new HashMap<>();
|
||||
LoginUser loginUser = new LoginUser();
|
||||
SysUser sysUser = new SysUser();
|
||||
paramMap.put("ticket", ticket);
|
||||
paramMap.put("appId", iwsH5AppId);
|
||||
RestTemplate restTemplate = new RestTemplate();
|
||||
ResponseEntity<String> authResponse = restTemplate.getForEntity(iwsH5Url, String.class, paramMap);
|
||||
log.info("authResponse:" + authResponse.toString());
|
||||
// 根据ResponseEntity<String> responseEntity对象,获取body部分,body为json格式字符串
|
||||
String content = authResponse.getBody();
|
||||
// 将json字符串转化为json对象
|
||||
JSONObject json = JSONObject.parseObject(content);
|
||||
// 取出data部分对象
|
||||
JSONObject data = json.getJSONObject("data");
|
||||
log.info("返回的数据:" + data);
|
||||
if ("200".equals(json.getInteger("code").toString())){
|
||||
|
||||
if ("200".equals(authResponse.getStatusCode())){
|
||||
// 根据ResponseEntity<String> responseEntity对象,获取body部分,body为json格式字符串
|
||||
String content = authResponse.getBody();
|
||||
// 将json字符串转化为json对象
|
||||
JSONObject json = JSONObject.parseObject(content);
|
||||
// 取出data部分对象
|
||||
JSONObject data = json.getJSONObject("data");
|
||||
JSONObject userInfo = data.getJSONObject("userInfo");
|
||||
sysUser.setUserName(userInfo.get("userName").toString());
|
||||
sysUser.setNickName(userInfo.get("name").toString());
|
||||
sysUser.setPhonenumber(userInfo.get("mobile").toString());
|
||||
loginUser.setSysUser(sysUser);
|
||||
loginUser = createUser(sysUser,loginUser);
|
||||
createUser(sysUser,loginUser);
|
||||
}
|
||||
return loginUser;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import com.bonus.common.core.exception.CaptchaException;
|
|||
import com.bonus.common.core.exception.ServiceException;
|
||||
import com.bonus.common.core.utils.StringUtils;
|
||||
import com.bonus.common.core.utils.VerificationCodeUtils;
|
||||
import com.bonus.common.core.utils.sms.SmsConfig;
|
||||
import com.bonus.common.core.utils.sms.SmsUtils;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.redis.service.RedisService;
|
||||
|
|
@ -41,6 +42,9 @@ public class SysPasswordService {
|
|||
@Resource
|
||||
private RemoteConfigService configService;
|
||||
|
||||
@Resource
|
||||
private SmsConfig smsConfig;
|
||||
|
||||
/**
|
||||
* 登录账户密码错误次数缓存键名
|
||||
*
|
||||
|
|
@ -107,7 +111,7 @@ public class SysPasswordService {
|
|||
String code = VerificationCodeUtils.generateVerificationCode(VerificationCodeUtils.CodeType.NUMERIC);
|
||||
String str = "您的验证码为" + code + ",尊敬的客户,以上验证码3分钟有效,微服务平台提醒您:转发可能导致账号被盗,请勿将验证码泄露于他人";
|
||||
String verifyKey = CacheConstants.VERIFICATION_CODE + phone;
|
||||
String s = SmsUtils.smsToken(phone, str, "");
|
||||
String s = SmsUtils.smsToken(smsConfig, phone, str, "");
|
||||
if (StringUtils.isNotEmpty(s)) {
|
||||
if (s.contains("ok")) {
|
||||
redisService.setCacheObject(verifyKey, code, Constants.CAPTCHA_EXPIRATION, TimeUnit.MINUTES);
|
||||
|
|
|
|||
|
|
@ -8,16 +8,12 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 192.168.0.16:18848
|
||||
namespace: bonus-ai
|
||||
username: nacos
|
||||
password: nacos
|
||||
server-addr: 192.168.0.14:8848
|
||||
namespace: f648524d-0a7b-449e-8f92-64e05236fd51
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 192.168.0.16:18848
|
||||
namespace: bonus-ai
|
||||
username: nacos
|
||||
password: nacos
|
||||
server-addr: 192.168.0.14:8848
|
||||
namespace: f648524d-0a7b-449e-8f92-64e05236fd51
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
|||
|
|
@ -1,27 +0,0 @@
|
|||
# Tomcat
|
||||
server:
|
||||
port: 58081
|
||||
|
||||
# Spring
|
||||
spring:
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
namespace: jyy_canteen
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
namespace: jyy_canteen
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
shared-configs:
|
||||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||
|
||||
#加密组件
|
||||
jasypt:
|
||||
encryptor:
|
||||
password: Encrypt
|
||||
|
||||
|
|
@ -1,16 +1,23 @@
|
|||
package com.bonus.common.core.utils.sms;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@ConfigurationProperties(prefix = "sms-config")
|
||||
@Data
|
||||
public class SmsConfig {
|
||||
|
||||
public static final String DOMAIN = "http://api.ktsms.cn/";
|
||||
private String domain;
|
||||
|
||||
public static final String DDT_KEY = "bonusyn";
|
||||
private String ddtKey;
|
||||
|
||||
public static final String SECRET_KEY = "IU0ypHbH";
|
||||
private String securityKey;
|
||||
|
||||
public static final String SMS_SIGNATURE = "【博诺思】";
|
||||
private String signature;
|
||||
|
||||
public static final String SMS_TOKEN = "sms_token";
|
||||
private String smsToken;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.bonus.common.core.utils.sms;
|
|||
import com.alibaba.fastjson2.JSON;
|
||||
import com.bonus.common.core.utils.http.HttpRequestHelper;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
|
@ -16,18 +17,18 @@ public class SmsUtils {
|
|||
* @param sendTime 为空表示立即发送,定时发送格式:20101024090810
|
||||
* @return 是否发送成功
|
||||
*/
|
||||
public static String smsToken(String mobile, String content, String sendTime) {
|
||||
public static String smsToken(SmsConfig smsConfig, String mobile, String content, String sendTime) {
|
||||
Map<String, String> headers = new HashMap<>();
|
||||
Map<String, Object> mapJson = new HashMap<>(6);
|
||||
mapJson.put("ddtkey", SmsConfig.DDT_KEY);
|
||||
mapJson.put("secretkey", SmsConfig.SECRET_KEY);
|
||||
mapJson.put("ddtkey", smsConfig.getDdtKey());
|
||||
mapJson.put("secretkey", smsConfig.getSecurityKey());
|
||||
mapJson.put("mobile", mobile);
|
||||
mapJson.put("content", SmsConfig.SMS_SIGNATURE + content);
|
||||
mapJson.put("content", smsConfig.getSignature() + content);
|
||||
mapJson.put("sendTime", sendTime);
|
||||
mapJson.put("extno", "");
|
||||
|
||||
// 将mapJson转换为URL查询参数格式
|
||||
StringBuilder urlBuilder = new StringBuilder(SmsConfig.SMS_TOKEN + "?");
|
||||
StringBuilder urlBuilder = new StringBuilder(smsConfig.getSmsToken() + "?");
|
||||
for (Map.Entry<String, Object> entry : mapJson.entrySet()) {
|
||||
try {
|
||||
String encodedKey = URLEncoder.encode(entry.getKey(), "UTF-8");
|
||||
|
|
@ -43,6 +44,6 @@ public class SmsUtils {
|
|||
String urlWithParams = urlBuilder.toString();
|
||||
|
||||
String json = JSON.toJSONString(mapJson);
|
||||
return HttpRequestHelper.postJson(SmsConfig.DOMAIN, urlWithParams, json, headers);
|
||||
return HttpRequestHelper.postJson(smsConfig.getDomain(), urlWithParams, json, headers);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -186,7 +186,7 @@ public class DateUtilsTest {
|
|||
|
||||
@Test
|
||||
public void testGetMonthOrDay() {
|
||||
String monthOrDay = DateUtils.getMonthOrDay(28, "/");
|
||||
String monthOrDay = DateUtils.getMonthOrDay(30, "/");
|
||||
assertNotNull(monthOrDay);
|
||||
assertTrue(monthOrDay.matches("\\d{2}/\\d{2}"));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import com.bonus.common.core.constant.CacheConstants;
|
|||
import com.bonus.common.core.exception.CaptchaException;
|
||||
import com.bonus.common.core.utils.StringUtils;
|
||||
import com.bonus.common.core.utils.VerificationCodeUtils;
|
||||
import com.bonus.common.core.utils.sms.SmsConfig;
|
||||
import com.bonus.common.core.utils.sms.SmsUtils;
|
||||
import com.bonus.common.redis.service.RedisService;
|
||||
import com.bonus.common.security.config.VerificationCodeConfig;
|
||||
|
|
@ -22,6 +23,8 @@ public class SmsService {
|
|||
@Resource
|
||||
private VerificationCodeConfig verificationCodeConfig;
|
||||
@Resource
|
||||
private SmsConfig smsConfig;
|
||||
@Resource
|
||||
private RedisService redisService;
|
||||
|
||||
/**
|
||||
|
|
@ -37,7 +40,7 @@ public class SmsService {
|
|||
String code = VerificationCodeUtils.generateVerificationCode(NUMERIC);
|
||||
String str = verificationCodeConfig.getContent().replace("<code>", code);
|
||||
str = str.replace("<time>", verificationCodeConfig.getTime().toString());
|
||||
String s = SmsUtils.smsToken(to, str, "");
|
||||
String s = SmsUtils.smsToken(smsConfig, to, str, "");
|
||||
if (StringUtils.isNotEmpty(s)) {
|
||||
if (s.contains("ok")) {
|
||||
String verifyKey = CacheConstants.VERIFICATION_CODE + StringUtils.nvl(to, "");
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
com.bonus.common.security.config.MyFilter
|
||||
com.bonus.common.security.config.WebMvcConfig
|
||||
com.bonus.common.security.config.VerificationCodeConfig
|
||||
com.bonus.common.core.utils.sms.SmsConfig
|
||||
com.bonus.common.security.service.TokenService
|
||||
com.bonus.common.security.service.SmsService
|
||||
com.bonus.common.security.service.EmailService
|
||||
|
|
|
|||
|
|
@ -52,8 +52,11 @@
|
|||
</dependency>
|
||||
|
||||
<!-- SpringBoot Actuator -->
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringCloud Loadbalancer -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
|
|
|
|||
|
|
@ -7,16 +7,12 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 192.168.0.16:18848
|
||||
namespace: bonus-ai
|
||||
username: nacos
|
||||
password: nacos
|
||||
server-addr: 192.168.0.14:8848
|
||||
namespace: f648524d-0a7b-449e-8f92-64e05236fd51
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 192.168.0.16:18848
|
||||
namespace: bonus-ai
|
||||
username: nacos
|
||||
password: nacos
|
||||
server-addr: 192.168.0.14:8848
|
||||
namespace: f648524d-0a7b-449e-8f92-64e05236fd51
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
@ -27,13 +23,13 @@ spring:
|
|||
eager: true
|
||||
transport:
|
||||
# 控制台地址
|
||||
dashboard: 192.168.0.16:18858
|
||||
dashboard: 192.168.0.14:18858
|
||||
# nacos配置持久化
|
||||
datasource:
|
||||
ds1:
|
||||
nacos:
|
||||
server-addr: 192.168.0.16:18848
|
||||
namespace: bonus-ai
|
||||
server-addr: 192.168.0.14:8848
|
||||
namespace: f648524d-0a7b-449e-8f92-64e05236fd51
|
||||
dataId: sentinel-bonus-gateway
|
||||
groupId: DEFAULT_GROUP
|
||||
data-type: json
|
||||
|
|
|
|||
|
|
@ -1,43 +0,0 @@
|
|||
# Tomcat
|
||||
server:
|
||||
port: 58080
|
||||
|
||||
# Spring
|
||||
spring:
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
namespace: jyy_canteen
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
namespace: jyy_canteen
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
shared-configs:
|
||||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||
sentinel:
|
||||
# 取消控制台懒加载
|
||||
eager: true
|
||||
transport:
|
||||
# 控制台地址
|
||||
dashboard: 127.0.0.1:18858
|
||||
# nacos配置持久化
|
||||
datasource:
|
||||
ds1:
|
||||
nacos:
|
||||
server-addr: 127.0.0.1:8848
|
||||
namespace: sgzb_bns
|
||||
dataId: sentinel-bonus-gateway
|
||||
groupId: DEFAULT_GROUP
|
||||
data-type: json
|
||||
rule-type: gw-flow
|
||||
|
||||
#加密组件
|
||||
jasypt:
|
||||
encryptor:
|
||||
password: Encrypt
|
||||
|
||||
|
|
@ -36,10 +36,10 @@
|
|||
</dependency>
|
||||
|
||||
<!-- SpringBoot Actuator -->
|
||||
<!--<dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>-->
|
||||
</dependency>
|
||||
|
||||
<!-- FastDFS -->
|
||||
<dependency>
|
||||
|
|
@ -116,4 +116,4 @@
|
|||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
</project>
|
||||
|
|
@ -16,47 +16,50 @@
|
|||
</description>
|
||||
|
||||
<dependencies>
|
||||
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos Config -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- SpringCloud Alibaba Sentinel -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- SpringBoot Actuator -->
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- FastDFS -->
|
||||
<dependency>
|
||||
<groupId>com.github.tobato</groupId>
|
||||
<artifactId>fastdfs-client</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- Minio -->
|
||||
<dependency>
|
||||
<groupId>io.minio</groupId>
|
||||
<artifactId>minio</artifactId>
|
||||
<version>${minio.version}</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- bonus Api System -->
|
||||
<dependency>
|
||||
<groupId>com.bonus</groupId>
|
||||
<artifactId>bonus-api-system</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- bonus Common Swagger -->
|
||||
<dependency>
|
||||
<groupId>com.bonus</groupId>
|
||||
|
|
@ -133,5 +136,5 @@
|
|||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
|
||||
</project>
|
||||
|
|
@ -6,16 +6,14 @@ server:
|
|||
spring:
|
||||
cloud:
|
||||
nacos:
|
||||
username: nacos
|
||||
password: nacos
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 192.168.0.16:18848
|
||||
namespace: bonus-ai
|
||||
server-addr: 192.168.0.14:8848
|
||||
namespace: f648524d-0a7b-449e-8f92-64e05236fd51
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 192.168.0.16:18848
|
||||
namespace: bonus-ai
|
||||
server-addr: 192.168.0.14:8848
|
||||
namespace: f648524d-0a7b-449e-8f92-64e05236fd51
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
|||
|
|
@ -1,21 +0,0 @@
|
|||
# Tomcat
|
||||
server:
|
||||
port: 59300
|
||||
|
||||
# Spring
|
||||
spring:
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
namespace: jyy_canteen
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
namespace: jyy_canteen
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
shared-configs:
|
||||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||
|
|
@ -16,53 +16,56 @@
|
|||
</description>
|
||||
|
||||
<dependencies>
|
||||
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos Config -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- SpringCloud Alibaba Sentinel -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- SpringBoot Actuator -->
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Swagger UI -->
|
||||
<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-swagger-ui</artifactId>
|
||||
<version>${swagger.fox.version}</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- Apache Velocity -->
|
||||
<dependency>
|
||||
<groupId>org.apache.velocity</groupId>
|
||||
<artifactId>velocity-engine-core</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- Mysql Connector -->
|
||||
<dependency>
|
||||
<groupId>com.mysql</groupId>
|
||||
<artifactId>mysql-connector-j</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- bonus Common Log -->
|
||||
<dependency>
|
||||
<groupId>com.bonus</groupId>
|
||||
<artifactId>bonus-common-log</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- bonus Common Swagger -->
|
||||
<dependency>
|
||||
<groupId>com.bonus</groupId>
|
||||
|
|
@ -92,5 +95,5 @@
|
|||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
|
||||
</project>
|
||||
|
|
@ -16,34 +16,38 @@
|
|||
</description>
|
||||
|
||||
<dependencies>
|
||||
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos Config -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- SpringCloud Alibaba Sentinel -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- SpringBoot Actuator -->
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Swagger UI -->
|
||||
<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-swagger-ui</artifactId>
|
||||
<version>${swagger.fox.version}</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- Quartz -->
|
||||
<dependency>
|
||||
<groupId>org.quartz-scheduler</groupId>
|
||||
|
|
@ -55,19 +59,19 @@
|
|||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- Mysql Connector -->
|
||||
<dependency>
|
||||
<groupId>com.mysql</groupId>
|
||||
<artifactId>mysql-connector-j</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- bonus Common Log -->
|
||||
<dependency>
|
||||
<groupId>com.bonus</groupId>
|
||||
<artifactId>bonus-common-log</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- bonus Common Swagger -->
|
||||
<dependency>
|
||||
<groupId>com.bonus</groupId>
|
||||
|
|
@ -79,10 +83,6 @@
|
|||
<artifactId>jasypt-spring-boot-starter</artifactId>
|
||||
<version>${jasypt-spring-boot-starter.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.bonus</groupId>
|
||||
<artifactId>bonus-api-system</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
|
@ -101,5 +101,5 @@
|
|||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
|
||||
</project>
|
||||
|
|
@ -8,13 +8,13 @@
|
|||
<version>24.12.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
<artifactId>bonus-system</artifactId>
|
||||
|
||||
<description>
|
||||
bonus-modules-system系统模块
|
||||
</description>
|
||||
|
||||
|
||||
<dependencies>
|
||||
|
||||
<!--加密依赖包-->
|
||||
|
|
@ -28,57 +28,57 @@
|
|||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos Config -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- SpringCloud Alibaba Sentinel -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- SpringBoot Actuator -->
|
||||
<!-- <dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>-->
|
||||
|
||||
</dependency>
|
||||
|
||||
<!-- Swagger UI -->
|
||||
<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-swagger-ui</artifactId>
|
||||
<version>${swagger.fox.version}</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- Mysql Connector -->
|
||||
<dependency>
|
||||
<groupId>com.mysql</groupId>
|
||||
<artifactId>mysql-connector-j</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- bonus Common DataSource -->
|
||||
<dependency>
|
||||
<groupId>com.bonus</groupId>
|
||||
<artifactId>bonus-common-datasource</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- bonus Common DataScope -->
|
||||
<dependency>
|
||||
<groupId>com.bonus</groupId>
|
||||
<artifactId>bonus-common-datascope</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- bonus Common Log -->
|
||||
<dependency>
|
||||
<groupId>com.bonus</groupId>
|
||||
<artifactId>bonus-common-log</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
|
||||
<!-- bonus Common Swagger -->
|
||||
<dependency>
|
||||
<groupId>com.bonus</groupId>
|
||||
|
|
@ -128,5 +128,5 @@
|
|||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
|
||||
</project>
|
||||
|
|
@ -8,6 +8,7 @@ import com.bonus.common.core.utils.SpringUtils;
|
|||
import com.bonus.common.core.utils.StringUtils;
|
||||
import com.bonus.common.core.utils.bean.BeanValidators;
|
||||
import com.bonus.common.core.utils.encryption.Sm4Utils;
|
||||
import com.bonus.common.core.utils.sms.SmsConfig;
|
||||
import com.bonus.common.core.utils.sms.SmsUtils;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.core.web.domain.BaseEntity;
|
||||
|
|
@ -77,6 +78,9 @@ public class SysUserServiceImpl implements ISysUserService {
|
|||
@Resource
|
||||
private VerificationCodeConfig verificationCodeConfig;
|
||||
|
||||
@Resource
|
||||
private SmsConfig smsConfig;
|
||||
|
||||
@Autowired
|
||||
private JavaMailSender mailSender; // 自动注入JavaMailSender,用于发送邮件
|
||||
|
||||
|
|
@ -603,7 +607,7 @@ public class SysUserServiceImpl implements ISysUserService {
|
|||
Integer i = userMapper.approvalStatus(userId);
|
||||
if (i > 0) {
|
||||
if (StringUtils.isNotEmpty(sysUser.getPhonenumber())) {
|
||||
SmsUtils.smsToken(sysUser.getPhonenumber(), "您的账号:" + sysUser.getUserName() + "已通过审批,请登录系统", "");
|
||||
SmsUtils.smsToken(smsConfig, sysUser.getPhonenumber(), "您的账号:" + sysUser.getUserName() + "已通过审批,请登录系统", "");
|
||||
}
|
||||
if (StringUtils.isNotEmpty(sysUser.getEmail())) {
|
||||
sendSimpleEmail(sysUser.getEmail(), "您的账号:" + sysUser.getUserName() + "已通过审批,请登录系统");
|
||||
|
|
|
|||
|
|
@ -1,26 +0,0 @@
|
|||
# Tomcat
|
||||
server:
|
||||
port: 58082
|
||||
|
||||
# Spring
|
||||
spring:
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
namespace: jyy_canteen
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
namespace: jyy_canteen
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
shared-configs:
|
||||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||
|
||||
#加密组件
|
||||
jasypt:
|
||||
encryptor:
|
||||
password: Encrypt
|
||||
|
|
@ -96,7 +96,6 @@
|
|||
left join sys_dept d on u.dept_id = d.dept_id
|
||||
left join sys_user_role ur on u.user_id = ur.user_id
|
||||
left join sys_role r on r.role_id = ur.role_id
|
||||
left join sys_dept sd on r.company_id = sd.dept_id
|
||||
</sql>
|
||||
|
||||
<select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult">
|
||||
|
|
@ -214,11 +213,11 @@
|
|||
|
||||
<select id="selectUserByUserName" parameterType="String" resultMap="SysUserResult">
|
||||
<include refid="selectUserVo"/>
|
||||
where u.del_flag = '0' AND u.user_name = #{userName}
|
||||
where u.del_flag = '0'AND u.user_name = #{userName}
|
||||
</select>
|
||||
<select id="selectUserByPhoneNumber" resultMap="SysUserResult">
|
||||
<include refid="selectUserVo"/>
|
||||
where u.del_flag = '0'AND u.phonenumber = #{phoneNumber} AND sd.del_flag = '0' AND sd.status = '0'
|
||||
where u.del_flag = '0'AND u.phonenumber = #{phoneNumber}
|
||||
</select>
|
||||
<select id="selectUserByEmail" resultMap="SysUserResult">
|
||||
<include refid="selectUserVo"/>
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
<version>24.12.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
<artifactId>bonus-visual-monitor</artifactId>
|
||||
|
||||
<description>
|
||||
|
|
@ -15,26 +15,20 @@
|
|||
</description>
|
||||
|
||||
<dependencies>
|
||||
|
||||
|
||||
<!-- SpringBoot Admin -->
|
||||
<dependency>
|
||||
<groupId>de.codecentric</groupId>
|
||||
<artifactId>spring-boot-admin-starter-server</artifactId>
|
||||
<version>${spring-boot-admin.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos Config -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
|
|
@ -46,13 +40,13 @@
|
|||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- SpringBoot Web -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- Spring Security -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
|
|
@ -82,5 +76,5 @@
|
|||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
|
||||
</project>
|
||||
|
|
@ -12,16 +12,14 @@ spring:
|
|||
active: dev
|
||||
cloud:
|
||||
nacos:
|
||||
username: nacos
|
||||
password: nacos
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 192.168.0.16:18848
|
||||
namespace: 0498f4fe-8430-4d43-acfe-f0cdf9a91df4
|
||||
server-addr: 192.168.0.56:8848
|
||||
namespace: 9cde1ce1-98bc-4b9c-9213-f1fbf8a5b3cc
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 192.168.0.16:18848
|
||||
namespace: 0498f4fe-8430-4d43-acfe-f0cdf9a91df4
|
||||
server-addr: 192.168.0.56:8848
|
||||
namespace: 9cde1ce1-98bc-4b9c-9213-f1fbf8a5b3cc
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
export deploy_path=/data/ceshi/gqk/Bonus-Cloud
|
||||
export deploy_path=/opt/webapps/bonus-cloud
|
||||
|
||||
export app_workspace=/home/jenkins/workspace/Bonus-Cloud
|
||||
|
||||
|
|
@ -12,15 +12,15 @@ app_source_jars=(
|
|||
"bonus-modules/bonus-gen/target/bonus-gen.jar"
|
||||
"bonus-modules/bonus-face/target/bonus-face.jar"
|
||||
"bonus-modules/bonus-job/target/bonus-job.jar"
|
||||
"bonus-modules/bonus-oss/target/bonus-oss.jar"
|
||||
"bonus-modules/bonus-system/target/bonus-system.jar"
|
||||
"bonus-visual/bonus-monitor/target/bonus-visual-monitor.jar"
|
||||
)
|
||||
|
||||
for source_jar in "${app_source_jars[@]}"; do
|
||||
scp -P 22 -r root@192.168.0.56:${app_workspace}/${source_jar} $deploy_path
|
||||
cp -f ${app_workspace}/${source_jar} $deploy_path
|
||||
echo "copied ${app_workspace}/${source_jar} to $deploy_path"
|
||||
done
|
||||
|
||||
# Define an array of JAR files to run
|
||||
jars=("bonus-auth.jar --spring.config.location=file:auth_bootstrap.yml"
|
||||
"bonus-gateway.jar --spring.config.location=file:gateway_bootstrap.yml"
|
||||
|
|
@ -60,7 +60,7 @@ cd $deploy_path || { echo "Failed to change directory to $deploy_path"; exit 1;
|
|||
# Iterate over the JAR files array
|
||||
for jar in "${jars[@]}"; do
|
||||
echo "Starting $jar"
|
||||
nohup java -jar $jar >/dev/null 2>&1 &
|
||||
nohup /usr/lib/jvm/jdk1.8.0_381/bin/java -jar $jar >/dev/null 2>&1 &
|
||||
done
|
||||
|
||||
echo "All JARs have been run successfully."
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ server:
|
|||
port: 18087
|
||||
|
||||
# Spring
|
||||
spring:
|
||||
spring:
|
||||
application:
|
||||
# 应用名称
|
||||
name: bonus-face
|
||||
|
|
@ -12,16 +12,14 @@ spring:
|
|||
active: dev
|
||||
cloud:
|
||||
nacos:
|
||||
username: nacos
|
||||
password: nacos
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 192.168.0.16:18848
|
||||
namespace: 0498f4fe-8430-4d43-acfe-f0cdf9a91df4
|
||||
server-addr: 192.168.0.56:8848
|
||||
namespace: 9cde1ce1-98bc-4b9c-9213-f1fbf8a5b3cc
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 192.168.0.16:18848
|
||||
namespace: 0498f4fe-8430-4d43-acfe-f0cdf9a91df4
|
||||
server-addr: 192.168.0.56:8848
|
||||
namespace: 9cde1ce1-98bc-4b9c-9213-f1fbf8a5b3cc
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
|||
|
|
@ -12,16 +12,14 @@ spring:
|
|||
active: dev
|
||||
cloud:
|
||||
nacos:
|
||||
username: nacos
|
||||
password: nacos
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 192.168.0.16:18848
|
||||
namespace: 0498f4fe-8430-4d43-acfe-f0cdf9a91df4
|
||||
server-addr: 192.168.0.56:8848
|
||||
namespace: 9cde1ce1-98bc-4b9c-9213-f1fbf8a5b3cc
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 192.168.0.16:18848
|
||||
namespace: 0498f4fe-8430-4d43-acfe-f0cdf9a91df4
|
||||
server-addr: 192.168.0.56:8848
|
||||
namespace: 9cde1ce1-98bc-4b9c-9213-f1fbf8a5b3cc
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
|||
|
|
@ -13,16 +13,14 @@ spring:
|
|||
active: dev
|
||||
cloud:
|
||||
nacos:
|
||||
username: nacos
|
||||
password: nacos
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 192.168.0.16:18848
|
||||
namespace: 0498f4fe-8430-4d43-acfe-f0cdf9a91df4
|
||||
server-addr: 192.168.0.56:8848
|
||||
namespace: 9cde1ce1-98bc-4b9c-9213-f1fbf8a5b3cc
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 192.168.0.16:18848
|
||||
namespace: 0498f4fe-8430-4d43-acfe-f0cdf9a91df4
|
||||
server-addr: 192.168.0.56:8848
|
||||
namespace: 9cde1ce1-98bc-4b9c-9213-f1fbf8a5b3cc
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
|||
|
|
@ -12,16 +12,14 @@ spring:
|
|||
active: dev
|
||||
cloud:
|
||||
nacos:
|
||||
username: nacos
|
||||
password: nacos
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 192.168.0.16:18848
|
||||
namespace: 0498f4fe-8430-4d43-acfe-f0cdf9a91df4
|
||||
server-addr: 192.168.0.56:8848
|
||||
namespace: 9cde1ce1-98bc-4b9c-9213-f1fbf8a5b3cc
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 192.168.0.16:18848
|
||||
namespace: 0498f4fe-8430-4d43-acfe-f0cdf9a91df4
|
||||
server-addr: 192.168.0.56:8848
|
||||
namespace: 9cde1ce1-98bc-4b9c-9213-f1fbf8a5b3cc
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
|||
|
|
@ -12,16 +12,14 @@ spring:
|
|||
active: dev
|
||||
cloud:
|
||||
nacos:
|
||||
username: nacos
|
||||
password: nacos
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 192.168.0.16:18848
|
||||
namespace: 0498f4fe-8430-4d43-acfe-f0cdf9a91df4
|
||||
server-addr: 192.168.0.56:8848
|
||||
namespace: 9cde1ce1-98bc-4b9c-9213-f1fbf8a5b3cc
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 192.168.0.16:18848
|
||||
namespace: 0498f4fe-8430-4d43-acfe-f0cdf9a91df4
|
||||
server-addr: 192.168.0.56:8848
|
||||
namespace: 9cde1ce1-98bc-4b9c-9213-f1fbf8a5b3cc
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
|||
|
|
@ -1,36 +1,49 @@
|
|||
#!/bin/bash
|
||||
P_ID=$(pgrep -f BonusAuthApplication)
|
||||
if [ -z "$P_ID" ]; then
|
||||
echo "BonusAuthApplication is not running"
|
||||
else
|
||||
kill -9 "$P_ID"
|
||||
fi
|
||||
|
||||
# Define an array of JAR files to run
|
||||
jars=("bonus-auth.jar --spring.config.location=file:auth_bootstrap.yml"
|
||||
"bonus-gateway.jar --spring.config.location=file:gateway_bootstrap.yml"
|
||||
"bonus-system.jar --spring.config.location=file:system_bootstrap.yml"
|
||||
"bonus-gen.jar --spring.config.location=file:gen_bootstrap.yml"
|
||||
"bonus-job.jar --spring.config.location=file:job_bootstrap.yml"
|
||||
"bonus-file.jar --spring.config.location=file:file_bootstrap.yml"
|
||||
"bonus-visual-monitor.jar --spring.config.location=file:visual_bootstrap.yml"
|
||||
"bonus-face.jar --spring.config.location=file:face_bootstrap.yml")
|
||||
P_ID=$(pgrep -f BonusFileApplication)
|
||||
if [ -z "$P_ID" ]; then
|
||||
echo "BonusFileApplication is not running"
|
||||
else
|
||||
kill -9 "$P_ID"
|
||||
fi
|
||||
|
||||
# 遍历数组并检查每个JAR文件的进程
|
||||
for jar_with_args in "${jars[@]}"; do
|
||||
# 提取JAR文件名(不包括参数)
|
||||
jar=$(echo $jar_with_args | awk '{print $1}')
|
||||
P_ID=$(pgrep -f BonusGatewayApplication)
|
||||
if [ -z "$P_ID" ]; then
|
||||
echo "BonusGatewayApplication is not running"
|
||||
else
|
||||
kill -9 "$P_ID"
|
||||
fi
|
||||
|
||||
P_ID=$(pgrep -f BonusGenApplication)
|
||||
if [ -z "$P_ID" ]; then
|
||||
echo "BonusGenApplication is not running"
|
||||
else
|
||||
kill -9 "$P_ID"
|
||||
fi
|
||||
|
||||
P_ID=$(pgrep -f BonusJobApplication)
|
||||
if [ -z "$P_ID" ]; then
|
||||
echo "BonusJobApplication is not running"
|
||||
else
|
||||
kill -9 "$P_ID"
|
||||
fi
|
||||
|
||||
P_ID=$(pgrep -f BonusMonitorApplication)
|
||||
if [ -z "$P_ID" ]; then
|
||||
echo "BonusMonitorApplication is not running"
|
||||
else
|
||||
kill -9 "$P_ID"
|
||||
fi
|
||||
|
||||
P_ID=$(pgrep -f BonusSystemApplication)
|
||||
if [ -z "$P_ID" ]; then
|
||||
echo "BonusSystemApplication is not running"
|
||||
else
|
||||
kill -9 "$P_ID"
|
||||
fi
|
||||
|
||||
# 检查进程是否启动
|
||||
echo "原应用程序1 $jar "
|
||||
pids=$(pgrep -f $jar || true)
|
||||
echo "原应用程序2 $jar "
|
||||
if [ -n "$pids" ]; then
|
||||
echo "$jar is running with PID(s): $pids"
|
||||
# 杀死进程
|
||||
for pid in $pids; do
|
||||
kill -9 $pid
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "Process $pid for $jar killed successfully"
|
||||
else
|
||||
echo "Failed to kill process $pid for $jar"
|
||||
fi
|
||||
done
|
||||
else
|
||||
echo "$jar is not running"
|
||||
fi
|
||||
done
|
||||
|
|
@ -12,16 +12,14 @@ spring:
|
|||
active: dev
|
||||
cloud:
|
||||
nacos:
|
||||
username: nacos
|
||||
password: nacos
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 192.168.0.16:18848
|
||||
namespace: 0498f4fe-8430-4d43-acfe-f0cdf9a91df4
|
||||
server-addr: 192.168.0.56:8848
|
||||
namespace: 9cde1ce1-98bc-4b9c-9213-f1fbf8a5b3cc
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 192.168.0.16:18848
|
||||
namespace: 0498f4fe-8430-4d43-acfe-f0cdf9a91df4
|
||||
server-addr: 192.168.0.56:8848
|
||||
namespace: 9cde1ce1-98bc-4b9c-9213-f1fbf8a5b3cc
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
|||
|
|
@ -12,16 +12,14 @@ spring:
|
|||
active: dev
|
||||
cloud:
|
||||
nacos:
|
||||
username: nacos
|
||||
password: nacos
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 192.168.0.16:18848
|
||||
namespace: 0498f4fe-8430-4d43-acfe-f0cdf9a91df4
|
||||
server-addr: 192.168.0.56:8848
|
||||
namespace: 9cde1ce1-98bc-4b9c-9213-f1fbf8a5b3cc
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 192.168.0.16:18848
|
||||
namespace: 0498f4fe-8430-4d43-acfe-f0cdf9a91df4
|
||||
server-addr: 192.168.0.56:8848
|
||||
namespace: 9cde1ce1-98bc-4b9c-9213-f1fbf8a5b3cc
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
|||
Loading…
Reference in New Issue