Skip to content

Commit

Permalink
fix: 解决codecc安全工单,更新了admin中对编辑器的一些用法
Browse files Browse the repository at this point in the history
  • Loading branch information
parisma authored and roymondchen committed Mar 6, 2023
1 parent 2a457c9 commit a840750
Show file tree
Hide file tree
Showing 9 changed files with 28,775 additions and 8,948 deletions.
16,627 changes: 16,520 additions & 107 deletions magic-admin/server/package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion magic-admin/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"log4js": "^6.3.0",
"mysql2": "^2.3.3",
"reflect-metadata": "^0.1.13",
"sequelize": "^6.6.2",
"sequelize": "^6.29.0",
"sequelize-typescript": "^2.1.0",
"tslib": "^2.4.0"
},
Expand Down
21,057 changes: 12,234 additions & 8,823 deletions magic-admin/web/package-lock.json

Large diffs are not rendered by default.

19 changes: 10 additions & 9 deletions magic-admin/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,26 @@
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "node --max_old_space_size=4096 node_modules/@vue/cli-service/bin/vue-cli-service.js serve --open",
"serve": "node --max_old_space_size=4096 node_modules/@vue/cli-service/bin/vue-cli-service.js serve",
"build": "vue-cli-service build",
"test": "vue-cli-service test:unit --maxWorkers=8 --coverage",
"lint": "vue-cli-service lint"
},
"dependencies": {
"@tmagic/design": "1.2.0",
"@tmagic/editor": "1.2.0",
"@tmagic/element-plus-adapter": "1.2.0",
"@tmagic/form": "1.2.0",
"@tmagic/schema": "1.2.0",
"@tmagic/stage": "1.2.0",
"@tmagic/table": "1.2.0",
"@tmagic/utils": "1.2.0",
"@tmagic/design": "^1.2.8",
"@tmagic/editor": "^1.2.8",
"@tmagic/element-plus-adapter": "^1.2.8",
"@tmagic/form": "^1.2.8",
"@tmagic/schema": "^1.2.8",
"@tmagic/stage": "^1.2.8",
"@tmagic/table": "^1.2.8",
"@tmagic/utils": "^1.2.8",
"axios": "^0.27.2",
"axios-jsonp": "^1.0.4",
"core-js": "^3.20.0",
"element-plus": "^2.2.32",
"js-cookie": "^3.0.0",
"monaco-editor": "^0.36.1",
"serialize-javascript": "^6.0.0",
"vue": "^3.2.26",
"vue-router": "^4.0.3"
Expand Down
5 changes: 3 additions & 2 deletions magic-admin/web/src/components/publish-page-list.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,11 @@ import { View } from '@element-plus/icons-vue';
import { ElMessage } from 'element-plus';

import { editorService } from '@tmagic/editor';
import { MPage } from '@tmagic/schema';

import publishApi from '@src/api/publish';
import magicStore from '@src/store/index';
import type { ABTest, ActInfo, EditorInfo, PageInfo } from '@src/typings';
import type { ABTest, ActInfo, EditorInfo } from '@src/typings';
import { Res } from '@src/util/request';
import { serializeConfig } from '@src/util/utils';

Expand Down Expand Up @@ -105,7 +106,7 @@ export default defineComponent({
const getPageName = () => {
// 从magic-editor root 拿到最新的页面名字
state.pageList = [];
root.value?.items.forEach((item: PageInfo) => {
root.value?.items.forEach((item: MPage) => {
state.pageList.push(item.name as string);
});
const actInfo = magicStore.get('actInfo') as ActInfo;
Expand Down
2 changes: 1 addition & 1 deletion magic-admin/web/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ app.use(ElementPlus);
app.use(TMagicDesign, MagicElementPlusAdapter);
app.use(MagicEditor);
editorService.usePlugin(editorPlugin);
app.use(MagicForm);
app.use(MagicForm, {});
app.use(router);
installComponents(app);
app.mount('#app');
6 changes: 3 additions & 3 deletions magic-admin/web/src/views/editor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@ export default defineComponent({
await initConfigByActId({ actId: Number(route.params.actId) });
};
asyncLoadJs('/static/vue3/entry/config/index.umd.js').then(() => {
asyncLoadJs('/static/vue3/entry/config/index.umd.cjs').then(() => {
magicPresetConfigs.value = (window as any).magicPresetConfigs;
});
asyncLoadJs('/static/vue3/entry/value/index.umd.js').then(() => {
asyncLoadJs('/static/vue3/entry/value/index.umd.cjs').then(() => {
magicPresetValues.value = (window as any).magicPresetValues;
});
asyncLoadJs('/static/vue3/entry/event/index.umd.js').then(() => {
asyncLoadJs('/static/vue3/entry/event/index.umd.cjs').then(() => {
magicPresetEvents.value = (window as any).magicPresetEvents;
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { nextTick, ref } from 'vue';
import { mount } from '@vue/test-utils';

import { editorService } from '@tmagic/editor';
import { MApp } from '@tmagic/schema';

import publishApi from '@src/api/publish';
import PublishPageList from '@src/components/publish-page-list.vue';
Expand Down Expand Up @@ -74,7 +75,7 @@ const actInfo = {
},
],
};
editorService.set('root', root);
editorService.set('root', root as MApp);
magicStore.set('actInfo', actInfo);

jest.mock('vue-router', () => {
Expand Down
2 changes: 1 addition & 1 deletion magic-admin/web/vue.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ module.exports = defineConfig({
},
},

plugins: [new MonacoWebpackPlugin()],
plugins: [new MonacoWebpackPlugin({ languages: ['javascript'] })],
},
});

0 comments on commit a840750

Please sign in to comment.