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/package.json | 2 +- Source/UBCS-WEB/src/page/login/index.vue | 12 ++++++++++++ Source/UBCS-WEB/src/views/integration/systemInfo.vue | 5 +++-- Source/UBCS-WEB/src/main.js | 4 ++-- 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/Source/UBCS-WEB/package.json b/Source/UBCS-WEB/package.json index 9c10428..a168825 100644 --- a/Source/UBCS-WEB/package.json +++ b/Source/UBCS-WEB/package.json @@ -15,7 +15,7 @@ "axios": "^0.18.0", "babel-polyfill": "^6.26.0", "classlist-polyfill": "^1.2.0", - "crypto-js": "^4.0.0", + "crypto-js": "^4.1.1", "element-ui": "^2.15.6", "instead": "^1.0.3", "js-base64": "^2.5.1", diff --git a/Source/UBCS-WEB/src/main.js b/Source/UBCS-WEB/src/main.js index eecd5c0..b4c69fe 100644 --- a/Source/UBCS-WEB/src/main.js +++ b/Source/UBCS-WEB/src/main.js @@ -76,8 +76,8 @@ i18n: (key, value) => i18n.t(key, value) }); //澶嶅埗鎻掍欢 -import VueClipboard from 'vue-clipboard2' -Vue.use( VueClipboard ) + import VueClipboard from 'vue-clipboard2' + Vue.use( VueClipboard ) //鏃堕棿鎻掍欢 import moment from 'moment'; Vue.prototype.$moment = moment; 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()); diff --git a/Source/UBCS-WEB/src/views/integration/systemInfo.vue b/Source/UBCS-WEB/src/views/integration/systemInfo.vue index d816c87..0826c26 100644 --- a/Source/UBCS-WEB/src/views/integration/systemInfo.vue +++ b/Source/UBCS-WEB/src/views/integration/systemInfo.vue @@ -135,7 +135,8 @@ }, } }, - + created() { + }, methods: { empower() { batchAddSave(this.checkAll.oid, this.checkAll.id, this.ParentList).then(res => { @@ -179,7 +180,7 @@ } console.log(this.ParentList); } - }else { + } else { this.ParentList = this.ParentList.filter(res => res.classifyId !== row.classifyId); console.log(this.ParentList); } -- Gitblit v1.9.3