田源
2023-09-22 5f06c56fd6273a34a502ea730382296cf1c1707f
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";
  //解密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('解密后的数据:', decrypted);
      },
      getTime() {
        setInterval(() => {
          this.time = dateFormat(new Date());