Merge remote-tracking branch 'origin/main' into main
This commit is contained in:
commit
2e3d3e26e4
|
|
@ -169,15 +169,17 @@ 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())){
|
||||
sysLoginService.iwsH5Login(ticket,iwsH5AppId,iwsH5Url,loginUser,sysUser);
|
||||
log.info("app端登录");
|
||||
//loginUser = sysLoginService.iwsH5Login(ticket,iwsH5AppId,iwsH5Url);
|
||||
//h5和web端调用同一个接口
|
||||
loginUser = sysLoginService.iwsWebLogin(ticket,iwsH5AppId,iwsWebUrl);
|
||||
} else if (form.getSysType()!=null && "0".equals(form.getSysType())) {
|
||||
sysLoginService.iwsWebLogin(ticket,iwsWebAppId,iwsWebUrl,loginUser,sysUser);
|
||||
loginUser = sysLoginService.iwsWebLogin(ticket,iwsWebAppId,iwsWebUrl);
|
||||
}else {
|
||||
throw new ServiceException("登录失败,请稍后重试");
|
||||
}
|
||||
logService.saveLogin(sysUser.getUserName(), "登录", "登录成功", null, "成功");
|
||||
logService.saveLogin(loginUser.getSysUser().getUserName(), "登录", "登录成功", null, "成功");
|
||||
//生成系统token
|
||||
return R.ok(tokenService.createToken(loginUser));
|
||||
|
||||
|
|
|
|||
|
|
@ -47,4 +47,8 @@ public class LoginBody {
|
|||
* i皖送登录方式 0:web端登录 1:H5登录
|
||||
*/
|
||||
private String sysType;
|
||||
}
|
||||
/**
|
||||
* i皖送登录数据库中没有用心信息的时候给个默认公司
|
||||
*/
|
||||
private Long deptId;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -93,6 +93,7 @@ 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());
|
||||
|
|
@ -128,7 +129,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");
|
||||
|
|
@ -156,6 +157,7 @@ public class SysLoginService {
|
|||
recordLogService.saveLogs(registerBody.getUsername(), startTime, "注册异常", e.getMessage(), null, "失败");
|
||||
throw new ServiceException("注册失败,请稍后重试");
|
||||
}
|
||||
log.info("结束进行注册===============");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -203,26 +205,30 @@ public class SysLoginService {
|
|||
* @param iwsWebUrl
|
||||
* @return
|
||||
*/
|
||||
public void iwsWebLogin(String ticket, String iwsWebAppId, String iwsWebUrl,LoginUser loginUser,SysUser sysUser) {
|
||||
public LoginUser iwsWebLogin(String ticket, String iwsWebAppId, String iwsWebUrl) {
|
||||
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());
|
||||
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");
|
||||
// 根据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())){
|
||||
sysUser.setUserName(data.get("userName").toString());
|
||||
sysUser.setNickName(data.get("name").toString());
|
||||
sysUser.setPhonenumber(data.get("mobile").toString());
|
||||
loginUser.setSysUser(sysUser);
|
||||
createUser(sysUser,loginUser);
|
||||
loginUser = createUser(sysUser,loginUser);
|
||||
}
|
||||
return loginUser;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -230,40 +236,51 @@ public class SysLoginService {
|
|||
* @param sysUser
|
||||
* @param loginUser
|
||||
*/
|
||||
private void createUser(SysUser sysUser, LoginUser loginUser) {
|
||||
private LoginUser createUser(SysUser sysUser, LoginUser loginUser) {
|
||||
//通过用户名获取人员信息
|
||||
R<LoginUser> userResult = remoteUserService.getUserInfo(sysUser.getUserName(), SecurityConstants.INNER);
|
||||
LoginUser loginUserNew = new LoginUser();
|
||||
SysUser sysUserNew = new SysUser();
|
||||
String resultName = convertAndAppend(sysUser.getNickName(), sysUser.getPhonenumber());
|
||||
R<LoginUser> userResult = remoteUserService.getUserInfo(resultName, 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 (result.isSuccess())
|
||||
if ("200".equals(result.get("code").toString()))
|
||||
{
|
||||
sysUser.setPassword(result.get("msg").toString());
|
||||
registerBody.setPassword(result.get("msg").toString());
|
||||
}
|
||||
log.info("开始进行注册{}",registerBody);
|
||||
//新用户注册
|
||||
try {
|
||||
register(registerBody);
|
||||
log.info("注册成功!");
|
||||
//查询用户信息
|
||||
userResult = remoteUserService.getUserInfo(sysUser.getUserName(), SecurityConstants.INNER);
|
||||
loginUser = userResult.getData();
|
||||
sysUser = loginUser.getSysUser();
|
||||
userResult = remoteUserService.getUserInfo(resultName, SecurityConstants.INNER);
|
||||
loginUserNew = userResult.getData();
|
||||
sysUserNew = loginUserNew.getSysUser();
|
||||
log.info("获取用户信息成功!{}",loginUserNew.getSysUser());
|
||||
//初始化一个角色
|
||||
Long[] roleIds = new Long[5];
|
||||
// 将数组的第一个元素赋值为 2
|
||||
roleIds[0] = 2L;
|
||||
remoteUserService.insertAuthRole(sysUser.getUserId(),roleIds,SecurityConstants.INNER);
|
||||
log.info("开始绑定角色信息{}",roleIds);
|
||||
remoteUserService.insertAuthRole(sysUserNew.getUserId(),roleIds,SecurityConstants.INNER);
|
||||
log.info("角色信息绑定成功!");
|
||||
}catch (Exception e){
|
||||
throw new ServiceException("登录失败,请稍后重试");
|
||||
}
|
||||
}else {
|
||||
loginUser = userResult.getData();
|
||||
sysUser = loginUser.getSysUser();
|
||||
loginUserNew = userResult.getData();
|
||||
}
|
||||
return loginUserNew;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -273,26 +290,31 @@ public class SysLoginService {
|
|||
* @param iwsH5Url
|
||||
* @return
|
||||
*/
|
||||
public void iwsH5Login(String ticket, String iwsH5AppId, String iwsH5Url,LoginUser loginUser,SysUser sysUser) {
|
||||
public LoginUser iwsH5Login(String ticket, String iwsH5AppId, String iwsH5Url) {
|
||||
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());
|
||||
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");
|
||||
// 根据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())){
|
||||
|
||||
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);
|
||||
createUser(sysUser,loginUser);
|
||||
loginUser = createUser(sysUser,loginUser);
|
||||
}
|
||||
return loginUser;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,12 +8,16 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 192.168.0.14:8848
|
||||
namespace: f648524d-0a7b-449e-8f92-64e05236fd51
|
||||
server-addr: 192.168.0.16:18848
|
||||
namespace: bonus-ai
|
||||
username: nacos
|
||||
password: nacos
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 192.168.0.14:8848
|
||||
namespace: f648524d-0a7b-449e-8f92-64e05236fd51
|
||||
server-addr: 192.168.0.16:18848
|
||||
namespace: bonus-ai
|
||||
username: nacos
|
||||
password: nacos
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
|||
|
|
@ -7,12 +7,16 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 192.168.0.14:8848
|
||||
namespace: f648524d-0a7b-449e-8f92-64e05236fd51
|
||||
server-addr: 192.168.0.16:18848
|
||||
namespace: bonus-ai
|
||||
username: nacos
|
||||
password: nacos
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 192.168.0.14:8848
|
||||
namespace: f648524d-0a7b-449e-8f92-64e05236fd51
|
||||
server-addr: 192.168.0.16:18848
|
||||
namespace: bonus-ai
|
||||
username: nacos
|
||||
password: nacos
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
@ -23,13 +27,13 @@ spring:
|
|||
eager: true
|
||||
transport:
|
||||
# 控制台地址
|
||||
dashboard: 192.168.0.14:18858
|
||||
dashboard: 192.168.0.16:18858
|
||||
# nacos配置持久化
|
||||
datasource:
|
||||
ds1:
|
||||
nacos:
|
||||
server-addr: 192.168.0.14:8848
|
||||
namespace: f648524d-0a7b-449e-8f92-64e05236fd51
|
||||
server-addr: 192.168.0.16:18848
|
||||
namespace: bonus-ai
|
||||
dataId: sentinel-bonus-gateway
|
||||
groupId: DEFAULT_GROUP
|
||||
data-type: json
|
||||
|
|
|
|||
|
|
@ -6,14 +6,16 @@ server:
|
|||
spring:
|
||||
cloud:
|
||||
nacos:
|
||||
username: nacos
|
||||
password: nacos
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 192.168.0.14:8848
|
||||
namespace: f648524d-0a7b-449e-8f92-64e05236fd51
|
||||
server-addr: 192.168.0.16:18848
|
||||
namespace: bonus-ai
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 192.168.0.14:8848
|
||||
namespace: f648524d-0a7b-449e-8f92-64e05236fd51
|
||||
server-addr: 192.168.0.16:18848
|
||||
namespace: bonus-ai
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
|||
|
|
@ -96,6 +96,7 @@
|
|||
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">
|
||||
|
|
@ -213,11 +214,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}
|
||||
where u.del_flag = '0'AND u.phonenumber = #{phoneNumber} AND sd.del_flag = '0' AND sd.status = '0'
|
||||
</select>
|
||||
<select id="selectUserByEmail" resultMap="SysUserResult">
|
||||
<include refid="selectUserVo"/>
|
||||
|
|
|
|||
|
|
@ -12,14 +12,16 @@ spring:
|
|||
active: dev
|
||||
cloud:
|
||||
nacos:
|
||||
username: nacos
|
||||
password: nacos
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 192.168.0.56:8848
|
||||
namespace: 9cde1ce1-98bc-4b9c-9213-f1fbf8a5b3cc
|
||||
server-addr: 192.168.0.16:18848
|
||||
namespace: 0498f4fe-8430-4d43-acfe-f0cdf9a91df4
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 192.168.0.56:8848
|
||||
namespace: 9cde1ce1-98bc-4b9c-9213-f1fbf8a5b3cc
|
||||
server-addr: 192.168.0.16:18848
|
||||
namespace: 0498f4fe-8430-4d43-acfe-f0cdf9a91df4
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
export deploy_path=/opt/webapps/bonus-cloud
|
||||
export deploy_path=/data/ceshi/gqk/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
|
||||
cp -f ${app_workspace}/${source_jar} $deploy_path
|
||||
scp -P 22 -r "root@192.168.0.56:"${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 /usr/lib/jvm/jdk1.8.0_381/bin/java -jar $jar >/dev/null 2>&1 &
|
||||
nohup 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,14 +12,16 @@ spring:
|
|||
active: dev
|
||||
cloud:
|
||||
nacos:
|
||||
username: nacos
|
||||
password: nacos
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 192.168.0.56:8848
|
||||
namespace: 9cde1ce1-98bc-4b9c-9213-f1fbf8a5b3cc
|
||||
server-addr: 192.168.0.16:18848
|
||||
namespace: 0498f4fe-8430-4d43-acfe-f0cdf9a91df4
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 192.168.0.56:8848
|
||||
namespace: 9cde1ce1-98bc-4b9c-9213-f1fbf8a5b3cc
|
||||
server-addr: 192.168.0.16:18848
|
||||
namespace: 0498f4fe-8430-4d43-acfe-f0cdf9a91df4
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
|||
|
|
@ -12,14 +12,16 @@ spring:
|
|||
active: dev
|
||||
cloud:
|
||||
nacos:
|
||||
username: nacos
|
||||
password: nacos
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 192.168.0.56:8848
|
||||
namespace: 9cde1ce1-98bc-4b9c-9213-f1fbf8a5b3cc
|
||||
server-addr: 192.168.0.16:18848
|
||||
namespace: 0498f4fe-8430-4d43-acfe-f0cdf9a91df4
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 192.168.0.56:8848
|
||||
namespace: 9cde1ce1-98bc-4b9c-9213-f1fbf8a5b3cc
|
||||
server-addr: 192.168.0.16:18848
|
||||
namespace: 0498f4fe-8430-4d43-acfe-f0cdf9a91df4
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
|||
|
|
@ -13,14 +13,16 @@ spring:
|
|||
active: dev
|
||||
cloud:
|
||||
nacos:
|
||||
username: nacos
|
||||
password: nacos
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 192.168.0.56:8848
|
||||
namespace: 9cde1ce1-98bc-4b9c-9213-f1fbf8a5b3cc
|
||||
server-addr: 192.168.0.16:18848
|
||||
namespace: 0498f4fe-8430-4d43-acfe-f0cdf9a91df4
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 192.168.0.56:8848
|
||||
namespace: 9cde1ce1-98bc-4b9c-9213-f1fbf8a5b3cc
|
||||
server-addr: 192.168.0.16:18848
|
||||
namespace: 0498f4fe-8430-4d43-acfe-f0cdf9a91df4
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
|||
|
|
@ -12,14 +12,16 @@ spring:
|
|||
active: dev
|
||||
cloud:
|
||||
nacos:
|
||||
username: nacos
|
||||
password: nacos
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 192.168.0.56:8848
|
||||
namespace: 9cde1ce1-98bc-4b9c-9213-f1fbf8a5b3cc
|
||||
server-addr: 192.168.0.16:18848
|
||||
namespace: 0498f4fe-8430-4d43-acfe-f0cdf9a91df4
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 192.168.0.56:8848
|
||||
namespace: 9cde1ce1-98bc-4b9c-9213-f1fbf8a5b3cc
|
||||
server-addr: 192.168.0.16:18848
|
||||
namespace: 0498f4fe-8430-4d43-acfe-f0cdf9a91df4
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
|||
|
|
@ -12,14 +12,16 @@ spring:
|
|||
active: dev
|
||||
cloud:
|
||||
nacos:
|
||||
username: nacos
|
||||
password: nacos
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 192.168.0.56:8848
|
||||
namespace: 9cde1ce1-98bc-4b9c-9213-f1fbf8a5b3cc
|
||||
server-addr: 192.168.0.16:18848
|
||||
namespace: 0498f4fe-8430-4d43-acfe-f0cdf9a91df4
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 192.168.0.56:8848
|
||||
namespace: 9cde1ce1-98bc-4b9c-9213-f1fbf8a5b3cc
|
||||
server-addr: 192.168.0.16:18848
|
||||
namespace: 0498f4fe-8430-4d43-acfe-f0cdf9a91df4
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
|||
|
|
@ -1,49 +1,36 @@
|
|||
P_ID=$(pgrep -f BonusAuthApplication)
|
||||
if [ -z "$P_ID" ]; then
|
||||
echo "BonusAuthApplication is not running"
|
||||
else
|
||||
kill -9 "$P_ID"
|
||||
fi
|
||||
#!/bin/bash
|
||||
|
||||
P_ID=$(pgrep -f BonusFileApplication)
|
||||
if [ -z "$P_ID" ]; then
|
||||
echo "BonusFileApplication 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 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
|
||||
# 遍历数组并检查每个JAR文件的进程
|
||||
for jar_with_args in "${jars[@]}"; do
|
||||
# 提取JAR文件名(不包括参数)
|
||||
jar=$(echo $jar_with_args | awk '{print $1}')
|
||||
|
||||
# 检查进程是否启动
|
||||
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,14 +12,16 @@ spring:
|
|||
active: dev
|
||||
cloud:
|
||||
nacos:
|
||||
username: nacos
|
||||
password: nacos
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 192.168.0.56:8848
|
||||
namespace: 9cde1ce1-98bc-4b9c-9213-f1fbf8a5b3cc
|
||||
server-addr: 192.168.0.16:18848
|
||||
namespace: 0498f4fe-8430-4d43-acfe-f0cdf9a91df4
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 192.168.0.56:8848
|
||||
namespace: 9cde1ce1-98bc-4b9c-9213-f1fbf8a5b3cc
|
||||
server-addr: 192.168.0.16:18848
|
||||
namespace: 0498f4fe-8430-4d43-acfe-f0cdf9a91df4
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
|||
|
|
@ -12,14 +12,16 @@ spring:
|
|||
active: dev
|
||||
cloud:
|
||||
nacos:
|
||||
username: nacos
|
||||
password: nacos
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 192.168.0.56:8848
|
||||
namespace: 9cde1ce1-98bc-4b9c-9213-f1fbf8a5b3cc
|
||||
server-addr: 192.168.0.16:18848
|
||||
namespace: 0498f4fe-8430-4d43-acfe-f0cdf9a91df4
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 192.168.0.56:8848
|
||||
namespace: 9cde1ce1-98bc-4b9c-9213-f1fbf8a5b3cc
|
||||
server-addr: 192.168.0.16:18848
|
||||
namespace: 0498f4fe-8430-4d43-acfe-f0cdf9a91df4
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
|||
Loading…
Reference in New Issue