From eb416c3ef103ab9e22c678055be1d18c031b140e Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Thu, 4 Mar 2021 16:52:09 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E5=AE=9A=E4=B9=89):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8DBasic=20Auth=20=E8=AE=A4=E8=AF=81=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/dto/definition/request/auth/MsAuthManager.java | 3 +-- .../src/main/java/io/metersphere/commons/utils/DateUtils.java | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/backend/src/main/java/io/metersphere/api/dto/definition/request/auth/MsAuthManager.java b/backend/src/main/java/io/metersphere/api/dto/definition/request/auth/MsAuthManager.java index cae25e201f..abbce6821b 100644 --- a/backend/src/main/java/io/metersphere/api/dto/definition/request/auth/MsAuthManager.java +++ b/backend/src/main/java/io/metersphere/api/dto/definition/request/auth/MsAuthManager.java @@ -84,8 +84,7 @@ public class MsAuthManager extends MsTestElement { authManager.setProperty(TestElement.TEST_CLASS, AuthManager.class.getName()); authManager.setProperty(TestElement.GUI_CLASS, SaveService.aliasToClass("AuthPanel")); Authorization auth = new Authorization(); - auth.setURL(samplerProxy.getUrl().toString()); - auth.setDomain(samplerProxy.getDomain()); + auth.setURL(samplerProxy.getProtocol() + "://" + samplerProxy.getDomain()); auth.setUser(msAuthManager.getUsername()); auth.setPass(msAuthManager.getPassword()); auth.setMechanism(AuthManager.Mechanism.DIGEST); diff --git a/backend/src/main/java/io/metersphere/commons/utils/DateUtils.java b/backend/src/main/java/io/metersphere/commons/utils/DateUtils.java index 1728a2b0e5..62c0af9290 100644 --- a/backend/src/main/java/io/metersphere/commons/utils/DateUtils.java +++ b/backend/src/main/java/io/metersphere/commons/utils/DateUtils.java @@ -45,6 +45,10 @@ public class DateUtils { SimpleDateFormat dateFormat = new SimpleDateFormat(TIME_PATTERN); return dateFormat.format(timeStamp); } + public static String getDataStr(long timeStamp) { + SimpleDateFormat dateFormat = new SimpleDateFormat(DATE_PATTERM); + return dateFormat.format(timeStamp); + } public static Date dateSum (Date date,int countDays){