提交 7caa697d 编写于 作者: 智布道's avatar 智布道 👁

💩 change: Optimize code

上级 935a9713
...@@ -32,6 +32,17 @@ ...@@ -32,6 +32,17 @@
<dependency> <dependency>
<groupId>com.warrenstrange</groupId> <groupId>com.warrenstrange</groupId>
<artifactId>googleauth</artifactId> <artifactId>googleauth</artifactId>
<exclusions>
<exclusion>
<artifactId>httpclient</artifactId>
<groupId>org.apache.httpcomponents</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.13</version>
</dependency> </dependency>
</dependencies> </dependencies>
......
...@@ -28,13 +28,13 @@ public enum JapMfaAlgorithm { ...@@ -28,13 +28,13 @@ public enum JapMfaAlgorithm {
/** /**
* SHA1 * SHA1
*/ */
HMACSHA1, HmacSHA1,
/** /**
* SHA256 * SHA256
*/ */
HMACSHA256, HmacSHA256,
/** /**
* SHA512 * SHA512
*/ */
HMACSHA512 HmacSHA512
} }
...@@ -38,7 +38,7 @@ public class JapMfaConfig { ...@@ -38,7 +38,7 @@ public class JapMfaConfig {
/** /**
* the crypto algorithm (HMACSHA1, HMACSHA256, HMACSHA512) * the crypto algorithm (HMACSHA1, HMACSHA256, HMACSHA512)
*/ */
private JapMfaAlgorithm algorithm = JapMfaAlgorithm.HMACSHA1; private JapMfaAlgorithm algorithm = JapMfaAlgorithm.HmacSHA1;
private String qrcodeTempPath = System.getProperties().getProperty("user.home") + File.separator + "jap" + File.separator + "temp"; private String qrcodeTempPath = System.getProperties().getProperty("user.home") + File.separator + "jap" + File.separator + "temp";
......
...@@ -46,8 +46,8 @@ public class JapMfaTest { ...@@ -46,8 +46,8 @@ public class JapMfaTest {
private static void varifyCode(JapMfa japMfa) { private static void varifyCode(JapMfa japMfa) {
String secretKey = japMfa.getSecretKey(username); String secretKey = japMfa.getSecretKey(username);
System.out.println("1. 你需要打开生成的文件(或者将 Base64 字符串直接粘贴到浏览器地址会回车)"); System.out.println("1. 点击上方打印的URL链接");
System.out.println("2. 然后使用 OTP 工具扫描二维码"); System.out.println("2. 然后使用 OTP 工具扫描二维码(如果无法识别,请保存到本地后打开本地文件重新进行识别)");
System.out.println("3. 在控制台输入 code"); System.out.println("3. 在控制台输入 code");
Scanner scanner = new Scanner(System.in); Scanner scanner = new Scanner(System.in);
Integer consoleInput = null; Integer consoleInput = null;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册