diff --git a/kicc-register/src/main/resources/bootstrap.yml b/kicc-register/src/main/resources/bootstrap.yml index eb6497b7..529290f1 100644 --- a/kicc-register/src/main/resources/bootstrap.yml +++ b/kicc-register/src/main/resources/bootstrap.yml @@ -5,9 +5,9 @@ server: db: num: 1 user: ${MYSQL_USER:root} - password: ${MYSQL_PWD:kanglai@2022} + password: ${MYSQL_PWD:root} url: - 0: jdbc:mysql://${MYSQL_HOST:120.26.168.56}:${MYSQL_PORT:8052}/${MYSQL_DB:kicc_config}?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true + 0: jdbc:mysql://${MYSQL_HOST:127.0.0.1}:${MYSQL_PORT:3306}/${MYSQL_DB:kicc_config}?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true nacos: core: diff --git a/kicc-ui/src/utils/cipher.ts b/kicc-ui/src/utils/cipher.ts index f493725c..dd77d2df 100644 --- a/kicc-ui/src/utils/cipher.ts +++ b/kicc-ui/src/utils/cipher.ts @@ -58,14 +58,17 @@ export function encryptByMd5(password: string) { export const encryptionLogin = (params: encryptionLoginModel): LoginParams => { let { data, param, key } = params; const result = JSON.parse(JSON.stringify(data)); - const aesEncryption = new AesEncryption({ key }); param.forEach(ele => { const data = result[ele]; - result[ele] = aesEncryption.encryptByAES(data, { - mode: CryptoJS.mode.ECB, - padding: CryptoJS.pad.NoPadding, - iv: CryptoJS.enc.Latin1.parse(key) - }).toString(); + const encryptKey= CryptoJS.enc.Latin1.parse(key); + const iv = encryptKey; + // 加密 + const encrypted = CryptoJS.AES.encrypt(data, encryptKey, { + iv: iv, + mode: CryptoJS.mode.CFB, + padding: CryptoJS.pad.NoPadding + }); + result[ele] = encrypted.toString(); }); return result; };