fix: fix after hook not work problem

pull/90/head
moonrailgun 2 years ago
parent d83300e141
commit 3f220373c7

@ -71,12 +71,13 @@ type ServiceActionSchema = Pick<
*/ */
function generateAfterHookKey(actionName: string, serviceName = '') { function generateAfterHookKey(actionName: string, serviceName = '') {
if (serviceName) { if (serviceName) {
return `${CONFIG_GATEWAY_AFTER_HOOK}.${serviceName}.${actionName}`.replaceAll( return encodeNoConflictServiceNameKey(
'.', `${CONFIG_GATEWAY_AFTER_HOOK}.${serviceName}.${actionName}`
'-'
); );
} else { } else {
return `${CONFIG_GATEWAY_AFTER_HOOK}.${actionName}`.replaceAll('.', '-'); return encodeNoConflictServiceNameKey(
`${CONFIG_GATEWAY_AFTER_HOOK}.${actionName}`
);
} }
} }

@ -1,4 +1,4 @@
const noConflictKey = '$'; const noConflictKey = '__';
/** /**
* `.` , `.` (lodash.set) * `.` , `.` (lodash.set)

Loading…
Cancel
Save