diff --git a/.env.dev b/.env.dev index 5141f5a..d3d9618 100644 --- a/.env.dev +++ b/.env.dev @@ -12,8 +12,8 @@ VITE_ROUTER_BASE=/ VITE_ROUTER_HISTORY=hash # api -VITE_API_BASIC=https://zh.shibeitong.com -# VITE_API_BASIC=http://10.10.1.6:8070 +# VITE_API_BASIC=https://zh.shibeitong.com +VITE_API_BASIC=http://10.10.1.6:8070 VITE_API_HTTP=/api/v1/ # storage VITE_STORAGE_NAMESPACE = gin-admin_local_ diff --git a/src/utils/util.js b/src/utils/util.js index 6151abb..004f469 100644 --- a/src/utils/util.js +++ b/src/utils/util.js @@ -336,11 +336,13 @@ export const spliceUrl=(fullUrl)=>{ return pathOnly } /**加密 */ -export function encryptString(plaintext, secretKey) { +export function encryptString(plaintext) { + if(!plaintext) return null return CryptoJS.AES.encrypt(plaintext, 'gxzhonghai12345678',{mode: CryptoJS.mode.ECB,padding: CryptoJS.pad.Pkcs7,iv: CryptoJS.enc.Utf8.parse('0000000000000000'),format: CryptoJS.format.OpenSSL}).toString(); } /**解密 */ -export function decryptString(ciphertext, secretKey) { +export function decryptString(ciphertext) { + if(!ciphertext) return null const bytes = CryptoJS.AES.decrypt(ciphertext, 'gxzhonghai12345678',{mode: CryptoJS.mode.ECB,padding: CryptoJS.pad.Pkcs7,iv: CryptoJS.enc.Utf8.parse('0000000000000000'),format: CryptoJS.format.OpenSSL}); return bytes.toString(CryptoJS.enc.Utf8); } \ No newline at end of file diff --git a/src/views/equiteMgt/components/EditDialog.vue b/src/views/equiteMgt/components/EditDialog.vue index 2aed9cc..a2a74a7 100644 --- a/src/views/equiteMgt/components/EditDialog.vue +++ b/src/views/equiteMgt/components/EditDialog.vue @@ -140,7 +140,7 @@ import { useI18n } from 'vue-i18n' import dayjs from 'dayjs' import GxUpload from '@/components/GxUpload/index.vue' import { typerEnum, areaEnum } from "@/enums/useEnum" -import { spliceUrl } from "@/utils/util" +import { spliceUrl,decryptString,encryptString } from "@/utils/util" const emit = defineEmits(['ok']) const { t } = useI18n() // 解构出t方法 const { modal, showModal, hideModal, showLoading, hideLoading } = useModal() @@ -212,7 +212,7 @@ async function handleEdit(record = {}) { hideSpining() formData.value = { ...data } formData.value.expireAt = data?.expireAt ? dayjs(data?.expireAt) : '' - editorContent.value = data.details + editorContent.value = decryptString(data.details) if (data.cover && data.cover.length > 0) { formData.value.fileList = [data.cover].map(item => config('http.apiBasic') + item) } @@ -235,7 +235,7 @@ function handleOk() { const params = { ...values, cover: spliceUrl(formData.value.fileList[0]), - details: editorContent.value, + details: encryptString(editorContent.value), } let result = null switch (modal.value.type) { diff --git a/src/views/prizeDraw/lotteryRules/components/EditDialog.vue b/src/views/prizeDraw/lotteryRules/components/EditDialog.vue index b6ddc6a..9f43886 100644 --- a/src/views/prizeDraw/lotteryRules/components/EditDialog.vue +++ b/src/views/prizeDraw/lotteryRules/components/EditDialog.vue @@ -134,7 +134,7 @@ import { useI18n } from 'vue-i18n' import { PlusOutlined, MinusOutlined, SettingOutlined } from '@ant-design/icons-vue'; import dayjs from 'dayjs' import { customersEnum, areaEnum } from "@/enums/useEnum" -import { spliceUrl } from "@/utils/util.js" +import { spliceUrl,decryptString,encryptString } from "@/utils/util.js" const emit = defineEmits(['ok']) const { t } = useI18n() // 解构出t方法 const { modal, showModal, hideModal, showLoading, hideLoading } = useModal() @@ -203,8 +203,8 @@ async function handleEdit(record = {}) { formData.value = { ...data, startAt:dayjs(data.startAt), - endAt:dayjs(data.endAt) - + endAt:dayjs(data.endAt), + reason:decryptString(data.reason), } } catch (error) { message.error({ content: error.message }) @@ -221,7 +221,8 @@ function handleOk() { showLoading() const params = { ...values, - roles:formData.value.roles + roles:formData.value.roles, + reason:encryptString(formData.value.reason), } let result = null switch (modal.value.type) { diff --git a/src/views/prizeDraw/lotteryRules/index.vue b/src/views/prizeDraw/lotteryRules/index.vue index 24b9852..3f963b3 100644 --- a/src/views/prizeDraw/lotteryRules/index.vue +++ b/src/views/prizeDraw/lotteryRules/index.vue @@ -44,7 +44,7 @@