mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-29 18:48:45 +08:00
docs: 支持爱速搭嵌入 (#2391)
This commit is contained in:
parent
1ae1d4a837
commit
e87e050d03
19
fis-conf.js
19
fis-conf.js
@ -729,6 +729,13 @@ if (fis.project.currentMedia() === 'publish') {
|
|||||||
release: '/$1'
|
release: '/$1'
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 在爱速搭中不用 cfc,而是放 amis 目录下的路由接管
|
||||||
|
let cfcAddress =
|
||||||
|
'https://3xsw4ap8wah59.cfc-execute.bj.baidubce.com/api/amis-mock';
|
||||||
|
if (process.env.IS_AISUDA) {
|
||||||
|
cfcAddress = '/amis/api';
|
||||||
|
}
|
||||||
|
|
||||||
ghPages.match('/{examples,docs}/**', {
|
ghPages.match('/{examples,docs}/**', {
|
||||||
preprocessor: function (contents, file) {
|
preprocessor: function (contents, file) {
|
||||||
if (!file.isText() || typeof contents !== 'string') {
|
if (!file.isText() || typeof contents !== 'string') {
|
||||||
@ -739,21 +746,13 @@ if (fis.project.currentMedia() === 'publish') {
|
|||||||
.replace(
|
.replace(
|
||||||
/(\\?(?:'|"))((?:get|post|delete|put)\:)?\/api\/mock2?/gi,
|
/(\\?(?:'|"))((?:get|post|delete|put)\:)?\/api\/mock2?/gi,
|
||||||
function (_, qutoa, method) {
|
function (_, qutoa, method) {
|
||||||
return (
|
return qutoa + (method || '') + `${cfcAddress}/mock2`;
|
||||||
qutoa +
|
|
||||||
(method || '') +
|
|
||||||
'https://3xsw4ap8wah59.cfc-execute.bj.baidubce.com/api/amis-mock/mock2'
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
.replace(
|
.replace(
|
||||||
/(\\?(?:'|"))((?:get|post|delete|put)\:)?\/api\/sample/gi,
|
/(\\?(?:'|"))((?:get|post|delete|put)\:)?\/api\/sample/gi,
|
||||||
function (_, qutoa, method) {
|
function (_, qutoa, method) {
|
||||||
return (
|
return qutoa + (method || '') + `${cfcAddress}/sample`;
|
||||||
qutoa +
|
|
||||||
(method || '') +
|
|
||||||
'https://3xsw4ap8wah59.cfc-execute.bj.baidubce.com/api/amis-mock/sample'
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user