From e90006368aeb5638f80434ae630d14cab6e05bff Mon Sep 17 00:00:00 2001 From: fmk1023 Date: Sun, 4 Jan 2026 15:15:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=80=81=E5=8A=BF=E6=84=9F=E7=9F=A5=E5=B9=B3?= =?UTF-8?q?=E5=8F=B0-=E8=B4=A6=E5=8F=B7=E5=AF=86=E7=A0=81=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E5=8F=8A=E9=AA=8C=E8=AF=81=E7=A0=81=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E5=AF=B9=E6=8E=A5=E6=B2=BB=E7=90=86=E5=B9=B3=E5=8F=B0=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Header/index.vue | 8 +- src/components/LoginModal/index.vue | 385 +++++++++++----------------- src/utils/jsencrypt.ts | 11 + vite.config.ts | 12 +- 4 files changed, 167 insertions(+), 249 deletions(-) create mode 100644 src/utils/jsencrypt.ts diff --git a/src/components/Header/index.vue b/src/components/Header/index.vue index 70e189b..de08bd2 100644 --- a/src/components/Header/index.vue +++ b/src/components/Header/index.vue @@ -40,7 +40,8 @@ - 登录 + 登录 + @@ -48,7 +49,12 @@ - - diff --git a/src/utils/jsencrypt.ts b/src/utils/jsencrypt.ts new file mode 100644 index 0000000..3b2686a --- /dev/null +++ b/src/utils/jsencrypt.ts @@ -0,0 +1,11 @@ +import JSEncrypt from 'jsencrypt'; + +const PUBLIC_KEY = + 'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCcXz5g5hNGAOgFOVhiYY8pYlrH3gXmHkYRBqqEHsVaKqjdY9PQbkfSb9VkD78VYwFyTSzMZn5e1A5XXXDTUL3PezflMc/GjvseB87OQ3a6XDHw5tVXiJruc72oN9GKEvh5TjQUzi2S1sTHXg8vdD/niXw+K/icrQFdzSpy1PWc6QIDAQAB'; +const pubKey = `-----BEGIN PUBLIC KEY-----${PUBLIC_KEY}-----END PUBLIC KEY-----`; + +export default (str: string) => { + const encryptStr = new JSEncrypt(); + encryptStr.setPublicKey(pubKey); + return encryptStr.encrypt(str.toString()); +}; diff --git a/vite.config.ts b/vite.config.ts index 6cc4b4e..b920e10 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -38,12 +38,12 @@ export default (config: any) => { }, proxy: { // 配置跨域代理 - '/gateway/official/u-auth/index/getCaptcha': { - // target: 'http://223.76.236.155:20011', // 目标服务器地址 - target: 'http://222.20.126.217:9700', // 目标服务器地址 - changeOrigin: true, // 允许跨域 - rewrite: (path) => path.replace('/gateway/official/u-auth', '/gateway/u-auth') // 重写路径 - }, + // '/gateway/official/u-auth/index/getCaptcha': { + // // target: 'http://223.76.236.155:20011', // 目标服务器地址 + // target: 'http://222.20.126.217:9700', // 目标服务器地址 + // changeOrigin: true, // 允许跨域 + // rewrite: (path) => path.replace('/gateway/official/u-auth', '/gateway/u-auth') // 重写路径 + // }, '/gateway': { // target: 'http://223.76.236.155:20011', // 目标服务器地址 target: 'http://222.20.126.217:10010', // 目标服务器地址