fix: re-insert repeat routes (#2018)
This commit is contained in:
parent
9a376e4116
commit
151949362b
@ -1,48 +1,13 @@
|
||||
import { InstallOptions, Plugin } from '@nocobase/server';
|
||||
import { routes } from './routes';
|
||||
|
||||
export class MobileClientPlugin extends Plugin {
|
||||
afterAdd() {}
|
||||
|
||||
async load() {
|
||||
async load() {}
|
||||
|
||||
async install() {
|
||||
const repository = this.app.db.getRepository('uiRoutes');
|
||||
const routes = [
|
||||
{
|
||||
type: 'route',
|
||||
path: '/mobile/:name(.+)?',
|
||||
component: 'MApplication',
|
||||
uiSchema: {
|
||||
type: 'void',
|
||||
'x-component': 'MContainer',
|
||||
'x-designer': 'MContainer.Designer',
|
||||
'x-component-props': {},
|
||||
properties: {
|
||||
page: {
|
||||
type: 'void',
|
||||
'x-component': 'MPage',
|
||||
'x-designer': 'MPage.Designer',
|
||||
'x-component-props': {},
|
||||
properties: {
|
||||
grid: {
|
||||
type: 'void',
|
||||
'x-component': 'Grid',
|
||||
'x-initializer': 'MBlockInitializers',
|
||||
'x-component-props': {
|
||||
showDivider: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
routes: [
|
||||
{
|
||||
type: 'route',
|
||||
path: '',
|
||||
component: 'RouteSchemaComponent',
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
for (const values of routes) {
|
||||
await repository.create({
|
||||
values,
|
||||
@ -50,8 +15,6 @@ export class MobileClientPlugin extends Plugin {
|
||||
}
|
||||
}
|
||||
|
||||
async install(options?: InstallOptions) {}
|
||||
|
||||
async afterEnable() {}
|
||||
|
||||
async afterDisable() {}
|
||||
|
38
packages/plugins/mobile-client/src/server/routes.ts
Normal file
38
packages/plugins/mobile-client/src/server/routes.ts
Normal file
@ -0,0 +1,38 @@
|
||||
export const routes = [
|
||||
{
|
||||
type: 'route',
|
||||
path: '/mobile/:name(.+)?',
|
||||
component: 'MApplication',
|
||||
uiSchema: {
|
||||
type: 'void',
|
||||
'x-component': 'MContainer',
|
||||
'x-designer': 'MContainer.Designer',
|
||||
'x-component-props': {},
|
||||
properties: {
|
||||
page: {
|
||||
type: 'void',
|
||||
'x-component': 'MPage',
|
||||
'x-designer': 'MPage.Designer',
|
||||
'x-component-props': {},
|
||||
properties: {
|
||||
grid: {
|
||||
type: 'void',
|
||||
'x-component': 'Grid',
|
||||
'x-initializer': 'MBlockInitializers',
|
||||
'x-component-props': {
|
||||
showDivider: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
routes: [
|
||||
{
|
||||
type: 'route',
|
||||
path: '',
|
||||
component: 'RouteSchemaComponent',
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
Loading…
Reference in New Issue
Block a user