Skip to content

Commit 234c1d1

Browse files
committed
feat: the cache can be configured to be encrypted
1 parent 3a132f3 commit 234c1d1

File tree

20 files changed

+300
-185
lines changed

20 files changed

+300
-185
lines changed

CHANGELOG.zh_CN.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
## Wip
22

3+
### ✨ Features
4+
5+
- 缓存可以配置是否加密
6+
- 多语言支持
7+
38
### 🎫 Chores
49

510
- 移除 messageSetting 配置

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,16 @@
3737
"vditor": "^3.6.3",
3838
"vue": "^3.0.2",
3939
"vue-i18n": "^9.0.0-beta.8",
40-
"vue-router": "^4.0.0-rc.3",
40+
"vue-router": "^4.0.0-rc.5",
4141
"vuex": "^4.0.0-rc.1",
4242
"vuex-module-decorators": "^1.0.1",
43-
"xlsx": "^0.16.8",
43+
"xlsx": "^0.16.9",
4444
"zxcvbn": "^4.4.2"
4545
},
4646
"devDependencies": {
4747
"@commitlint/cli": "^11.0.0",
4848
"@commitlint/config-conventional": "^11.0.0",
49-
"@iconify/json": "^1.1.261",
49+
"@iconify/json": "^1.1.262",
5050
"@ls-lint/ls-lint": "^1.9.2",
5151
"@purge-icons/generated": "^0.4.1",
5252
"@types/echarts": "^4.9.1",
@@ -72,7 +72,7 @@
7272
"cross-env": "^7.0.2",
7373
"dot-prop": "^6.0.1",
7474
"dotenv": "^8.2.0",
75-
"eslint": "^7.13.0",
75+
"eslint": "^7.14.0",
7676
"eslint-config-prettier": "^6.15.0",
7777
"eslint-plugin-prettier": "^3.1.4",
7878
"eslint-plugin-vue": "^7.1.0",
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
import AppLocalPicker from './src/AppLocalPicker.vue';
2+
import AppFooterToolbar from './src/AppFooterToolbar.vue';
3+
import { withInstall } from '../util';
24

3-
export { AppLocalPicker };
5+
export { AppLocalPicker, AppFooterToolbar };
6+
7+
export default withInstall(AppLocalPicker, AppFooterToolbar);

src/components/Footer/src/index.vue renamed to src/components/Application/src/AppFooterToolbar.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,14 @@
1010
</template>
1111
<script lang="ts">
1212
import { defineComponent, computed, unref } from 'vue';
13+
1314
import { SIDE_BAR_MINI_WIDTH, SIDE_BAR_SHOW_TIT_MINI_WIDTH } from '/@/enums/appEnum';
15+
1416
import { appStore } from '/@/store/modules/app';
1517
import { menuStore } from '/@/store/modules/menu';
18+
1619
export default defineComponent({
17-
name: 'AppFooter',
20+
name: 'AppFooterToolbar',
1821
setup() {
1922
const getMiniWidth = computed(() => {
2023
const {

src/components/Authority/index.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
import type { App } from 'vue';
21
import Authority from './src/index.vue';
32

4-
export default (app: App): void => {
5-
app.component(Authority.name, Authority);
6-
};
3+
import { withInstall } from '../util';
4+
5+
export default withInstall(Authority);
76

87
export { Authority };

src/components/Footer/index.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/components/registerGlobComp.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import Icon from './Icon/index';
22
import Button from './Button/index.vue';
3-
import { AppFooter } from './Footer';
43
import {
54
// Need
65
Button as AntButton,
@@ -35,7 +34,7 @@ import {
3534
} from 'ant-design-vue';
3635
import { getApp } from '/@/setup/App';
3736

38-
const compList = [Icon, Button, AntButton.Group, AppFooter];
37+
const compList = [Icon, Button, AntButton.Group];
3938

4039
// Fix hmr multiple registered components
4140
let registered = false;

src/components/util.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
11
import type { VNodeChild } from 'vue';
2+
import type { App, Component } from 'vue';
3+
4+
export function withInstall(...components: Component[]) {
5+
return (app: App) => {
6+
components.forEach((comp) => {
7+
comp.name && app.component(comp.name, comp);
8+
});
9+
};
10+
}
211

312
export function convertToUnit(
413
str: string | number | null | undefined,

src/settings/cipherSetting.ts

Lines changed: 0 additions & 10 deletions
This file was deleted.

src/settings/encryptionSetting.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { isDevMode } from '/@/utils/env';
2+
3+
// System default cache time, in seconds
4+
export const DEFAULT_CACHE_TIME = 60 * 60 * 24 * 7;
5+
6+
// aes encryption key
7+
export const cacheCipher = {
8+
key: '_12345678901234@',
9+
iv: '@12345678901234_',
10+
};
11+
12+
// Whether the system cache is encrypted using aes
13+
export const enableStorageEncryption = !isDevMode();

0 commit comments

Comments
 (0)