@blocklet/pages-kit-block-studio 0.1.28 → 0.1.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -109,6 +109,7 @@ let tempStates: any[] = [];
|
|
|
109
109
|
let allResourcesComponents: any[] = [];
|
|
110
110
|
|
|
111
111
|
const PAGES_KIT_BLOCKLET_DID = 'z8iZiDFg3vkkrPwsiba1TLXy3H9XHzFERsP8o';
|
|
112
|
+
const PROJECT_ID = '${project.id}';
|
|
112
113
|
|
|
113
114
|
initPackResourceStates(({ states }: any) => {
|
|
114
115
|
allResourcesComponents = states.reduce((acc, { state }) => {
|
|
@@ -131,7 +132,8 @@ router.get('/api/pages', async (req, res) => {
|
|
|
131
132
|
}
|
|
132
133
|
|
|
133
134
|
// Case 2: Using projectId
|
|
134
|
-
|
|
135
|
+
const tmpProjectId = projectId || PROJECT_ID;
|
|
136
|
+
if (tmpProjectId) {
|
|
135
137
|
let pagesKitBaseUrl = siteFrom as string;
|
|
136
138
|
if (!pagesKitBaseUrl) {
|
|
137
139
|
// 获取当前请求的 origin
|
|
@@ -145,7 +147,7 @@ router.get('/api/pages', async (req, res) => {
|
|
|
145
147
|
}
|
|
146
148
|
}
|
|
147
149
|
|
|
148
|
-
const apiUrl = joinURL(pagesKitBaseUrl, 'api/projects',
|
|
150
|
+
const apiUrl = joinURL(pagesKitBaseUrl, 'api/projects', tmpProjectId, 'pages');
|
|
149
151
|
console.log('apiUrl', apiUrl);
|
|
150
152
|
|
|
151
153
|
// 使用 axios 发起请求
|