chore:修复编译时的 cfc 链接错误

This commit is contained in:
吴多益 2021-10-14 15:40:57 +08:00 committed by GitHub
parent dc9224bd28
commit 633fd41650
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -755,29 +755,10 @@ if (fis.project.currentMedia() === 'publish') {
return contents;
}
return contents
.replace(
/(\\?(?:'|"))((?:get|post|delete|put)\:)?\/api\/mock2?/gi,
function (_, qutoa, method) {
return qutoa + (method || '') + `${cfcAddress}/mock2`;
}
)
.replace(
/(\\?(?:'|"))((?:get|post|delete|put)\:)?\/api\/sample/gi,
function (_, qutoa, method) {
return qutoa + (method || '') + `${cfcAddress}/sample`;
}
)
.replace(
/(\\?(?:'|"))((?:get|post|delete|put)\:)?\/api\/options/gi,
function (_, qutoa, method) {
return qutoa + (method || '') + `${cfcAddress}/options`;
}
)
.replace(
/(\\?(?:'|"))((?:get|post|delete|put)\:)?\/api\/crud/gi,
function (_, qutoa, method) {
return qutoa + (method || '') + `${cfcAddress}/crud`;
return contents.replace(
/(\\?(?:'|"))((?:get|post|delete|put)\:)?\/api\/(\w+)/gi,
function (_, qutoa, method, path) {
return qutoa + (method || '') + `${cfcAddress}/` + path;
}
);
}