Files
JY1.0/build/8031-service-loader.js

9 lines
428 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
'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'")
}