fix: fix after hook not work problem

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

@ -71,12 +71,13 @@ type ServiceActionSchema = Pick<
*/
function generateAfterHookKey(actionName: string, serviceName = '') {
if (serviceName) {
return `${CONFIG_GATEWAY_AFTER_HOOK}.${serviceName}.${actionName}`.replaceAll(
'.',
'-'
return encodeNoConflictServiceNameKey(
`${CONFIG_GATEWAY_AFTER_HOOK}.${serviceName}.${actionName}`
);
} 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) 有特殊含义,因此增加一个工具用于解决这个问题

Loading…
Cancel
Save