Commit cbd65cea authored by ZWT's avatar ZWT

feat(吉林演示): 松原

1.修改代码扫描测试账号遗留问题,修改环境配置表增加字段,同时修改对应代码增加字段,修改获取当前配置接口逻辑,完成接口冒烟测试;

BREAKING CHANGE: 无

Closes 无

[skip ci]
parent 7e8e9cbd
......@@ -6,6 +6,8 @@ import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import pps.cloud.base.service.IConfigOilFieldCloudService;
import pps.cloud.base.service.data.config_oil_field.GetConfigOilFieldOutput;
import pps.core.common.constant.BusinessConstant;
import pps.core.common.session.PpsUserSession;
import pps.core.common.utils.VerificationCode;
......@@ -109,13 +111,15 @@ public class LoginService {
@XText("模拟用户登陆")
@XApiGet(anonymous = true)
public XSingleResult<LoginBySimulateOutput> thirdToken(XContext context, LoginBySimulateInput input) {
if (!CharSequenceUtil.equals(input.getAuthKey(), "66b500fcaff049dca77f66733d9bb172")) {
GetConfigOilFieldOutput currentConfig = this.getCurrentConfig(context);
if (ObjectUtil.isNull(currentConfig) || !CharSequenceUtil.isAllNotBlank(currentConfig.getAuthKey(), currentConfig.getSimulateUser())
|| !CharSequenceUtil.equals(input.getAuthKey(), currentConfig.getAuthKey())) {
return XSingleResult.error(context, LoginError.Trade_IpWhiteError);
}
SysUserMapper mapper = context.getBean(SysUserMapper.class);
SysUserEnt sysUserEnt = mapper.selectOne(
new LambdaQueryWrapper<SysUserEnt>()
.eq(SysUserEnt::getLoginName, "cqyanshi")
.eq(SysUserEnt::getLoginName, currentConfig.getSimulateUser())
);
if (ObjectUtil.isNull(sysUserEnt)) {
return XSingleResult.error(context, LoginError.NotExistUserName);
......@@ -127,7 +131,7 @@ public class LoginService {
new Long[]{1L, 1L},
IdWorker.getId(),
sysUserEnt.getId(),
"cqyanshi",
sysUserEnt.getUserName(),
sysUserEnt.getUserName(),
new XSsoAuth(XUuidUtils.randomUUID(), null, null))
, expiresIn);
......@@ -235,4 +239,17 @@ public class LoginService {
}
return count;
}
/**
* 获取当前配置
*
* @param context 上下文
* @return {@link GetConfigOilFieldOutput }
*/
public GetConfigOilFieldOutput getCurrentConfig(XContext context) {
IConfigOilFieldCloudService bean = context.getBean(IConfigOilFieldCloudService.class);
XSingleResult<GetConfigOilFieldOutput> currentConfig = bean.getCurrentConfig(context);
currentConfig.throwIfFail();
return currentConfig.getResult();
}
}
\ No newline at end of file
......@@ -26,6 +26,12 @@ public class GetConfigOilFieldOutput {
@XText("首页路由")
private String homePagePath;
@XText("认证key")
private String authKey;
@XText("模拟用户")
private String simulateUser;
@XText("是否演示修改(1_否,0_是)")
private Integer isDemo;
......
......@@ -44,6 +44,14 @@ public class ConfigOilFieldEnt implements Serializable {
@TableField
private String homePagePath;
@XText("认证key")
@TableField
private String authKey;
@XText("模拟用户")
@TableField
private String simulateUser;
@XText("是否演示修改(1_否,0_是)")
@TableField
private Integer isDemo;
......
......@@ -39,6 +39,14 @@ public class ConfigOilFieldView implements Serializable {
@TableField
private String homePagePath;
@XText("认证key")
@TableField
private String authKey;
@XText("模拟用户")
@TableField
private String simulateUser;
@XText("是否演示修改(1_否,0_是)")
@TableField
private Integer isDemo;
......
......@@ -26,6 +26,12 @@ public class GetConfigOilFieldOutput {
@XText("首页路由")
private String homePagePath;
@XText("认证key")
private String authKey;
@XText("模拟用户")
private String simulateUser;
@XText("是否演示修改(1_否,0_是)")
private Integer isDemo;
......
......@@ -8,6 +8,8 @@
<result column="oil_field_code" property="oilFieldCode" jdbcType="VARCHAR"/>
<result column="province_list" property="provinceList" jdbcType="VARCHAR"/>
<result column="home_page_path" property="homePagePath" jdbcType="VARCHAR"/>
<result column="auth_key" property="authKey" jdbcType="VARCHAR"/>
<result column="simulate_user" property="simulateUser" jdbcType="VARCHAR"/>
<result column="is_demo" property="isDemo" jdbcType="TINYINT"/>
<result column="demo_date" property="demoDate" jdbcType="VARCHAR"/>
</resultMap>
......@@ -19,6 +21,8 @@
oil_field_code,
province_list,
home_page_path,
auth_key,
simulate_user,
is_demo,
demo_date
</sql>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment