diff --git a/ruoyi-admin/src/main/resources/application-druid.yml b/ruoyi-admin/src/main/resources/application-druid.yml index e47a9bd75779ad8fecffb2195b497f47fed338e4..db006f466648472d0a25f5fe3f4d7fc06960654b 100644 --- a/ruoyi-admin/src/main/resources/application-druid.yml +++ b/ruoyi-admin/src/main/resources/application-druid.yml @@ -6,16 +6,16 @@ spring: druid: # 主库数据源 master: - url: jdbc:mysql://172.10.62.97:3306/xzf?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 + url: jdbc:mysql://127.0.0.1:3306/xzf?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 username: root - password: mysqlLan2vWfdstv8 + password: 123456 # 从库数据源 slave: # 从数据源开关/默认关闭 enabled: false url: jdbc:mysql://106.75.92.230:3306/ry?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 - username: - password: + username: + password: # 初始连接数 initialSize: 1 # 最小连接池数量 @@ -35,7 +35,7 @@ spring: testWhileIdle: true testOnBorrow: false testOnReturn: false - webStatFilter: + webStatFilter: enabled: true statViewServlet: enabled: true @@ -54,4 +54,4 @@ spring: merge-sql: true wall: config: - multi-statement-allow: true \ No newline at end of file + multi-statement-allow: true diff --git a/sql/xzf.sql b/sql/xzf.sql index d39e6a0aa24329d7984ab462ff9cc94ea016f125..97f8bf8bf81ad4241205317377ea712161f9d572 100644 --- a/sql/xzf.sql +++ b/sql/xzf.sql @@ -169,6 +169,7 @@ INSERT INTO `sys_dict_data`(`dict_sort`, `dict_label`, `dict_value`, `dict_type` INSERT INTO `sys_dict_type`(`dict_id`, `dict_name`, `dict_type`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (12, '登录类型', 'login_type', '0', 'admin', sysdate(), '', NULL, '登录类型列表'); INSERT INTO `sys_dict_data`(`dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1, '小钻风登录', 'XZF', 'login_type', '', 'primary', 'N', '0', 'admin', sysdate(), '', NULL, '小钻风用户登录'); +INSERT INTO `sys_dict_data`(`dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (2, 'WWS登录', 'WWS', 'login_type', '', 'primary', 'N', '0', 'admin', sysdate(), '', NULL, 'WWS用户登录'); -- 插入任务执行进度类型 diff --git a/tester/src/main/java/com/ruoyi/tester/login/WwsLogin.java b/tester/src/main/java/com/ruoyi/tester/login/WwsLogin.java new file mode 100644 index 0000000000000000000000000000000000000000..cea14a9b694cc4b86ccc612d1d8ddbc4598960e7 --- /dev/null +++ b/tester/src/main/java/com/ruoyi/tester/login/WwsLogin.java @@ -0,0 +1,53 @@ +package com.ruoyi.tester.login; + +import com.ruoyi.tester.domain.TesterLoginConfig; +import com.ruoyi.tester.domain.TesterLoginRst; +import com.ruoyi.tester.executor.http.HttpUtils; +import com.ruoyi.tester.executor.http.HttpUtilsFactory; +import com.ruoyi.tester.executor.http.XzfHttpResult; +import org.json.JSONObject; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Component; + +import java.util.HashMap; +import java.util.Map; + +@Component +public class WwsLogin implements Login { + private Logger logger = LoggerFactory.getLogger(this.getClass()); + + @Override + public String getLoginType() { + return "WWS"; + } + + @Override + public TesterLoginRst doLogin(Long loginConfigId) { + TesterLoginConfig loginBaseInfo = LoginCache.getLoginBaseInfo(loginConfigId); + logger.info("WWS登录,loginUrl={}, loginParam={}", loginBaseInfo.getLoginUrl(), loginBaseInfo.getLoginParam()); + HttpUtils httpUtils = HttpUtilsFactory.getHttpUtils(); + XzfHttpResult xzfHttpResult = httpUtils.post(loginBaseInfo.getLoginUrl(), "application/x-www-form-urlencoded; charset=UTF-8", null, null, loginBaseInfo.getLoginParam(), null); + logger.info("登录结果result={}", xzfHttpResult.getBody()); + JSONObject rstJson = new JSONObject(xzfHttpResult.getBody()); + if ("0".equals(rstJson.getString("code"))) { + String token = rstJson.getString("data"); + TesterLoginRst loginRst = new TesterLoginRst(token, System.currentTimeMillis(), loginBaseInfo); + return loginRst; + } + return null; + } + + @Override + public Map makeHeaders(Long loginConfigId) { + Map headers = new HashMap<>(); + if(loginConfigId != null){ + TesterLoginRst cache = LoginCache.getCache(loginConfigId); + if(cache != null){ + String token = (String)cache.getLoginResponse(); + headers.put("Cookie", "token=" + token); + } + } + return headers; + } +} diff --git a/tester/src/main/resources/templates/tester/task_interface_relation/task_interface_relation.html b/tester/src/main/resources/templates/tester/task_interface_relation/task_interface_relation.html index 9d299be08bbb40bdb3ca6490099f0af768f68f0b..dabdb705ff78c76b31e9d2e001649fb19fc05113 100644 --- a/tester/src/main/resources/templates/tester/task_interface_relation/task_interface_relation.html +++ b/tester/src/main/resources/templates/tester/task_interface_relation/task_interface_relation.html @@ -88,26 +88,10 @@ title: '关系id', visible: true }, - { - field: 'taskId', - title: '任务id' - }, - { - field: 'interfaceId', - title: '接口id' - }, { field: 'description', title: '描述信息' }, - { - field: 'host', - title: '主机' - }, - { - field: 'port', - title: '端口' - }, { field: 'dependRelationIds', title: '依赖关系id' @@ -116,22 +100,6 @@ field: 'dependParam', title: '依赖参数' }, - { - field: 'queryParam', - title: 'query参数' - }, - { - field: 'bodyParam', - title: 'body参数' - }, - { - field: 'pathParam', - title: 'path参数' - }, - { - field: 'loginConfigId', - title: '登录配置id' - }, { field: 'status', title: '状态', @@ -154,4 +122,4 @@ }); - \ No newline at end of file +