From 5f06c56fd6273a34a502ea730382296cf1c1707f Mon Sep 17 00:00:00 2001
From: 田源 <lastanimals@163.com>
Date: 星期五, 22 九月 2023 14:45:54 +0800
Subject: [PATCH] 单点登录-解密插件js库

---
 Source/UBCS-WEB/src/page/login/index.vue |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/Source/UBCS-WEB/src/page/login/index.vue b/Source/UBCS-WEB/src/page/login/index.vue
index 1ec9a95..576ec66 100644
--- a/Source/UBCS-WEB/src/page/login/index.vue
+++ b/Source/UBCS-WEB/src/page/login/index.vue
@@ -43,6 +43,9 @@
   import topColor from "@/page/index/top/top-color";
   import {getQueryString, getTopUrl} from "@/util/util";
   import "@/styles/login.scss";
+  //瑙e瘑js搴�
+  import CryptoJS from 'crypto-js';
+  import AES from 'crypto-js/aes';
   export default {
     name: "login",
     components: {
@@ -71,6 +74,7 @@
     created() {
       this.handleLogin();
       this.getTime();
+      this.getPassword()
     },
     mounted() {
     },
@@ -79,6 +83,14 @@
     },
     props: [],
     methods: {
+      getPassword(){
+        const plaintext = 'Hello, World!';
+        const key = 'This is a secret key';
+        const encrypted = AES.encrypt(plaintext, key).toString();
+        console.log('鍔犲瘑鍚庣殑鏁版嵁锛�', encrypted);
+        const decrypted = AES.decrypt(encrypted, key).toString(CryptoJS.enc.Utf8);
+        console.log('瑙e瘑鍚庣殑鏁版嵁锛�', decrypted);
+      },
       getTime() {
         setInterval(() => {
           this.time = dateFormat(new Date());

--
Gitblit v1.9.3