chore: remove console.log
This commit is contained in:
parent
efb0320427
commit
b6cd540f72
@ -288,7 +288,6 @@ export async function get(ctx: Context, next: Next) {
|
|||||||
resourceKeyAttribute,
|
resourceKeyAttribute,
|
||||||
fields = []
|
fields = []
|
||||||
} = ctx.action.params;
|
} = ctx.action.params;
|
||||||
console.log({ associated, resourceField })
|
|
||||||
if (associated && resourceField) {
|
if (associated && resourceField) {
|
||||||
const AssociatedModel = ctx.db.getModel(associatedName);
|
const AssociatedModel = ctx.db.getModel(associatedName);
|
||||||
if (!(associated instanceof AssociatedModel)) {
|
if (!(associated instanceof AssociatedModel)) {
|
||||||
|
@ -19,7 +19,6 @@ export default async (ctx, next) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
const menuIds = menu_permissions.map(item => item.menu_id);
|
const menuIds = menu_permissions.map(item => item.menu_id);
|
||||||
console.log({ resourceKey, roles, menuIds });
|
|
||||||
const Menu = ctx.db.getModel('menus') as ModelCtor<Model>;
|
const Menu = ctx.db.getModel('menus') as ModelCtor<Model>;
|
||||||
const menu = await Menu.findOne({
|
const menu = await Menu.findOne({
|
||||||
where: isRoot ? {
|
where: isRoot ? {
|
||||||
|
@ -397,7 +397,6 @@ export default async (ctx, next) => {
|
|||||||
if (!['subTable', 'linkTo', 'attachment', 'updatedBy', 'createdBy'].includes(child.get('interface'))) {
|
if (!['subTable', 'linkTo', 'attachment', 'updatedBy', 'createdBy'].includes(child.get('interface'))) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
console.log(child.name);
|
|
||||||
appends.push(`${field.name}.${child.name}`);
|
appends.push(`${field.name}.${child.name}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -257,7 +257,7 @@ export async function update(ctx: actions.Context, next: actions.Next) {
|
|||||||
return next();
|
return next();
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(ctx.action.params, { routable_type: tableName, routable_id: resourceKey });
|
// console.log(ctx.action.params, { routable_type: tableName, routable_id: resourceKey });
|
||||||
let [route] = await associated.getRoutes({
|
let [route] = await associated.getRoutes({
|
||||||
where: { routable_type: tableName, routable_id: resourceKey },
|
where: { routable_type: tableName, routable_id: resourceKey },
|
||||||
limit: 1
|
limit: 1
|
||||||
|
@ -51,7 +51,6 @@ export default async function (options = {}) {
|
|||||||
resourcer.use(async (ctx, next) => {
|
resourcer.use(async (ctx, next) => {
|
||||||
const { actionName, resourceName, values } = ctx.action.params;
|
const { actionName, resourceName, values } = ctx.action.params;
|
||||||
if (resourceName === 'menus' && ['create', 'update'].includes(actionName)) {
|
if (resourceName === 'menus' && ['create', 'update'].includes(actionName)) {
|
||||||
console.log({values});
|
|
||||||
if (values.parent) {
|
if (values.parent) {
|
||||||
delete values.parent.children;
|
delete values.parent.children;
|
||||||
ctx.action.mergeParams({
|
ctx.action.mergeParams({
|
||||||
|
@ -125,7 +125,6 @@ export class Permissions {
|
|||||||
});
|
});
|
||||||
if (fps.length) {
|
if (fps.length) {
|
||||||
for (const fp of fps) {
|
for (const fp of fps) {
|
||||||
console.log('fp.actions', fp.actions);
|
|
||||||
if (Array.isArray(fp.actions) && fp.actions.includes(`${resourceField.options.collection_name}:${actionName}`)) {
|
if (Array.isArray(fp.actions) && fp.actions.includes(`${resourceField.options.collection_name}:${actionName}`)) {
|
||||||
return next();
|
return next();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user