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', // 目标服务器地址