WANG 5 tahun lalu
induk
melakukan
5d1e3d82e7

+ 8 - 1
src/main/java/cn/com/qmth/examcloud/web/bootstrap/BootstrapSecurityUtil.java

@@ -8,6 +8,7 @@ import java.util.Set;
 import com.google.common.collect.Maps;
 import com.google.common.collect.Sets;
 
+import cn.com.qmth.examcloud.commons.exception.ExamCloudRuntimeException;
 import cn.com.qmth.examcloud.commons.util.AES;
 
 /**
@@ -65,7 +66,13 @@ public class BootstrapSecurityUtil {
 			if (key instanceof String && value instanceof String) {
 				if (((String) key).startsWith(ENCRYPTED_HEAD)) {
 					AES aes = new AES(secretKey + RANDOM);
-					String decryptedValue = aes.decrypt((String) value);
+					String decryptedValue = null;
+					try {
+						decryptedValue = aes.decrypt((String) value);
+					} catch (Exception e) {
+						throw new ExamCloudRuntimeException(
+								"fail to decrypt value of '" + key + "'");
+					}
 					String newKey = ((String) key).substring(ENCRYPTED_HEAD.length());
 					map.put(newKey, decryptedValue);
 					set.add((String) key);