'use strict' // 普通 ERP 通讯由站点转发到 8030,受信员工处理程序仍使用同源 /submit。 module.exports = function configureErpGateway(source) { const declaration = /^([ \t]*(?:var|let|const) url\s*=).*$/gm if ((source.match(declaration) || []).length !== 1) throw new Error('请核对主通讯变量 url 的声明') return source.replace(declaration, "$1 window.location.origin + '/erp-service'") }