Pārlūkot izejas kodu

log => 增加日志打印

JustryDeng 2 gadi atpakaļ
vecāks
revīzija
e522a4c83a

+ 9 - 2
class-winter-core/src/main/java/winter/com/ideaaedi/classwinter/executor/DecryptExecutor.java

@@ -246,9 +246,16 @@ public class DecryptExecutor {
      */
     private static boolean checkPwdConsistency(String projectPath, String classWinterInfoDir, char[] password) {
         // 查看加密时,用户是否主动输入了密码
+        byte[] userIfInputPwdWhileEncryptFlag = IOUtil.readFileFromWorkbenchRoot(new File(projectPath),
+                classWinterInfoDir + Constant.USER_IF_INPUT_PWD_SIMPLE_NAME);
+        if (userIfInputPwdWhileEncryptFlag == null) {
+            Logger.debug(DecryptExecutor.class, "\n\tworkbenchRoot -> "
+                    + projectPath + "\n\t relativeFilePath -> " + (classWinterInfoDir + Constant.USER_IF_INPUT_PWD_SIMPLE_NAME)
+            );
+            throw new ClassWinterException("Not found content  of 'userIfInputPwd.winter'.");
+        }
         boolean userIfInputPwdWhileEncrypt = Boolean.parseBoolean(
-                new String(IOUtil.readFileFromWorkbenchRoot(new File(projectPath),
-                classWinterInfoDir + Constant.USER_IF_INPUT_PWD_SIMPLE_NAME))
+                new String(userIfInputPwdWhileEncryptFlag)
         );
         // 解密时,用户是否主动输入了密码
         boolean userIfInputPwdWhileDecrypt = !StrUtil.isEmpty(password);