Commit afa298b27767e8a56b0bcd8d2aa06897962f909c
Merge branch 'ww' into 'main'
perf: create terant react set tenantProfileId field default select Default option See merge request yunteng/thingskit-front!479
Showing
6 changed files
with
22 additions
and
6 deletions
| @@ -52,7 +52,7 @@ export const getTableTenantProfileApi = (params?: QueryTenantProfilesParam) => { | @@ -52,7 +52,7 @@ export const getTableTenantProfileApi = (params?: QueryTenantProfilesParam) => { | ||
| 52 | ...params, | 52 | ...params, |
| 53 | orderFiled: 'createdTime', | 53 | orderFiled: 'createdTime', |
| 54 | }; | 54 | }; |
| 55 | - return defHttp.get<PaginationResult>({ | 55 | + return defHttp.get<PaginationResult<{ default: boolean; id: { id: string } }>>({ |
| 56 | url: Api.getTenantProfile, | 56 | url: Api.getTenantProfile, |
| 57 | params: param, | 57 | params: param, |
| 58 | }); | 58 | }); |
| @@ -81,7 +81,7 @@ | @@ -81,7 +81,7 @@ | ||
| 81 | <template> | 81 | <template> |
| 82 | <BasicModal | 82 | <BasicModal |
| 83 | @register="register" | 83 | @register="register" |
| 84 | - title="关于我们" | 84 | + :title="handleDecode(t('routes.aboutSoftware.aboutSoftware'))" |
| 85 | width="50%" | 85 | width="50%" |
| 86 | cancel-text="关闭" | 86 | cancel-text="关闭" |
| 87 | :show-ok-btn="false" | 87 | :show-ok-btn="false" |
| @@ -37,7 +37,11 @@ | @@ -37,7 +37,11 @@ | ||
| 37 | :text="t('layout.header.dropdownItemChangePassword')" | 37 | :text="t('layout.header.dropdownItemChangePassword')" |
| 38 | icon="ant-design:unlock-twotone" | 38 | icon="ant-design:unlock-twotone" |
| 39 | /> | 39 | /> |
| 40 | - <MenuItem key="aboutSoftware" text="关于软件" icon="ant-design:message-outline" /> | 40 | + <MenuItem |
| 41 | + key="aboutSoftware" | ||
| 42 | + :text="handleDecode(t('routes.aboutSoftware.aboutSoftware'))" | ||
| 43 | + icon="ant-design:message-outline" | ||
| 44 | + /> | ||
| 41 | <MenuItem | 45 | <MenuItem |
| 42 | v-if="getUseLockPage" | 46 | v-if="getUseLockPage" |
| 43 | key="lock" | 47 | key="lock" |
| @@ -77,6 +81,8 @@ | @@ -77,6 +81,8 @@ | ||
| 77 | import { useRouter } from 'vue-router'; | 81 | import { useRouter } from 'vue-router'; |
| 78 | import { usePermission } from '/@/hooks/web/usePermission'; | 82 | import { usePermission } from '/@/hooks/web/usePermission'; |
| 79 | import AboutSoftwareModal from '../AboutSoftwareModal.vue'; | 83 | import AboutSoftwareModal from '../AboutSoftwareModal.vue'; |
| 84 | + import { AesEncryption } from '/@/utils/cipher'; | ||
| 85 | + import { cacheCipher } from '/@/settings/encryptionSetting'; | ||
| 80 | 86 | ||
| 81 | type MenuEvent = 'logout' | 'doc' | 'lock' | 'personal' | 'changePassword' | 'aboutSoftware'; | 87 | type MenuEvent = 'logout' | 'doc' | 'lock' | 'personal' | 'changePassword' | 'aboutSoftware'; |
| 82 | 88 | ||
| @@ -176,7 +182,15 @@ | @@ -176,7 +182,15 @@ | ||
| 176 | router.push('/system/changePassword'); | 182 | router.push('/system/changePassword'); |
| 177 | }; | 183 | }; |
| 178 | 184 | ||
| 185 | + const encryption = new AesEncryption(cacheCipher); | ||
| 186 | + const handleDecode = (string: string) => { | ||
| 187 | + return encryption.decryptByAES(string); | ||
| 188 | + }; | ||
| 189 | + | ||
| 190 | + console.log(encryption.encryptByAES('关于软件')); | ||
| 191 | + | ||
| 179 | return { | 192 | return { |
| 193 | + handleDecode, | ||
| 180 | updataPersonlData, | 194 | updataPersonlData, |
| 181 | refreshPersonlData, | 195 | refreshPersonlData, |
| 182 | refreshPersonalFunc, | 196 | refreshPersonalFunc, |
| 1 | export default { | 1 | export default { |
| 2 | + aboutSoftware: 'M2e/fueM5gOxek1+Cqh5CA==', | ||
| 2 | copyrightLabel: 'euVkVv2k+9lAoBFk2/IcAg==', | 3 | copyrightLabel: 'euVkVv2k+9lAoBFk2/IcAg==', |
| 3 | websiteLabel: 'Lg18XskCEQMA57HJp/kFSg==', | 4 | websiteLabel: 'Lg18XskCEQMA57HJp/kFSg==', |
| 4 | authorizationLabel: 'RgtDsxIoA+6FMp4Ani+utw==', | 5 | authorizationLabel: 'RgtDsxIoA+6FMp4Ani+utw==', |
| 1 | export default { | 1 | export default { |
| 2 | + aboutSoftware: 'M2e/fueM5gOxek1+Cqh5CA==', | ||
| 2 | copyrightLabel: 'euVkVv2k+9lAoBFk2/IcAg==', | 3 | copyrightLabel: 'euVkVv2k+9lAoBFk2/IcAg==', |
| 3 | websiteLabel: 'Lg18XskCEQMA57HJp/kFSg==', | 4 | websiteLabel: 'Lg18XskCEQMA57HJp/kFSg==', |
| 4 | authorizationLabel: 'RgtDsxIoA+6FMp4Ani+utw==', | 5 | authorizationLabel: 'RgtDsxIoA+6FMp4Ani+utw==', |
| @@ -130,9 +130,9 @@ export const tenantFormSchema: FormSchema[] = [ | @@ -130,9 +130,9 @@ export const tenantFormSchema: FormSchema[] = [ | ||
| 130 | return { | 130 | return { |
| 131 | api: async (params: QueryTenantProfilesParam) => { | 131 | api: async (params: QueryTenantProfilesParam) => { |
| 132 | const { items, total } = await getTableTenantProfileApi(params); | 132 | const { items, total } = await getTableTenantProfileApi(params); |
| 133 | - const firstRecord = items.at(0); | ||
| 134 | - if (firstRecord) { | ||
| 135 | - setFieldsValue({ tenantProfileId: firstRecord.id.id }); | 133 | + const defaultRecord = items.find((item) => item.default); |
| 134 | + if (defaultRecord) { | ||
| 135 | + setFieldsValue({ tenantProfileId: defaultRecord.id.id }); | ||
| 136 | } | 136 | } |
| 137 | return { items, total }; | 137 | return { items, total }; |
| 138 | }, | 138 | }, |