feat(login): #1300 Modify the comments to English

pull/1316/head
Serenity 2 years ago
parent e389c27440
commit 13c03cfd29

@ -37,9 +37,7 @@ const actions = {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
let key = actions.genKey(); let key = actions.genKey();
let encodePassword = actions.encrypt(password, key) let encodePassword = actions.encrypt(password, key)
console.log("enpwd:", encodePassword)
key = key.split("").reverse().join("") key = key.split("").reverse().join("")
login({username: username.trim(), password: encodePassword, tag: key, rememberMe: 1}) login({username: username.trim(), password: encodePassword, tag: key, rememberMe: 1})
.then((response) => { .then((response) => {
const {data} = response; const {data} = response;
@ -51,7 +49,7 @@ const actions = {
resolve(); resolve();
}) })
.catch((error) => { .catch((error) => {
alert('登录失败'); // alert('登录失败');
reject(error); reject(error);
}); });
}); });

@ -11,7 +11,7 @@ import java.security.GeneralSecurityException;
import java.util.Base64; import java.util.Base64;
/** /**
* Aes * AES encryption and decryption algorithm tool class
* *
* @author <a href="mailto:SerenitySir@outlook.com">Serenity</a> * @author <a href="mailto:SerenitySir@outlook.com">Serenity</a>
* @date 2023/5/21 14:37 * @date 2023/5/21 14:37
@ -23,10 +23,10 @@ public class AESUtil {
private static final String AES_GCM_CIPHER = "AES/GCM/PKCS5Padding"; private static final String AES_GCM_CIPHER = "AES/GCM/PKCS5Padding";
/** /**
* * encrypt
* *
* @param data * @param data Content that needs to be encrypted
* @param key * @param key Encrypt the password
* @return byte[] * @return byte[]
*/ */
public static byte[] encrypt(byte[] data, byte[] key) throws GeneralSecurityException { public static byte[] encrypt(byte[] data, byte[] key) throws GeneralSecurityException {
@ -42,10 +42,10 @@ public class AESUtil {
} }
/** /**
* * decrypt
* *
* @param data * @param data The content to be decrypted
* @param key * @param key Decryption key
* @return byte[] * @return byte[]
*/ */
public static byte[] decrypt(byte[] data, byte[] key) throws GeneralSecurityException{ public static byte[] decrypt(byte[] data, byte[] key) throws GeneralSecurityException{
@ -57,10 +57,10 @@ public class AESUtil {
} }
/** /**
* * encrypt
* *
* @param data * @param data Content that needs to be encrypted
* @param key * @param key Encrypt the password
* @return String * @return String
*/ */
public static String encrypt(String data, String key) throws GeneralSecurityException { public static String encrypt(String data, String key) throws GeneralSecurityException {
@ -69,10 +69,10 @@ public class AESUtil {
} }
/** /**
* * decrypt
* *
* @param data base64 * @param data The content to be decrypted is a base64 string
* @param key * @param key Decryption key
* @return String * @return String
*/ */
public static String decrypt(String data, String key) throws GeneralSecurityException { public static String decrypt(String data, String key) throws GeneralSecurityException {
@ -82,9 +82,9 @@ public class AESUtil {
} }
/** /**
* * Generate a random string key
* *
* @return * @return The string key
*/ */
public static String generateRandomKey() { public static String generateRandomKey() {
return IdWorker.get32UUID().substring(0, 16); return IdWorker.get32UUID().substring(0, 16);

Loading…
Cancel
Save