@aiyiran/myclaw 1.0.239 → 1.0.240
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.
- package/assets/myclaw-artifacts.js +13 -5
- package/package.json +1 -1
|
@@ -47,11 +47,19 @@
|
|
|
47
47
|
return '';
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
// ═══ 构建预览 URL ═══
|
|
50
|
+
// ═══ 构建预览 URL(CDN) ═══
|
|
51
51
|
function buildPreviewUrl(data, assetPath) {
|
|
52
|
-
var
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
var claw = window.location.hostname.split('.')[0];
|
|
53
|
+
if (!claw.includes('claw')) {
|
|
54
|
+
claw = localStorage.getItem(CLAW_STORAGE_KEY);
|
|
55
|
+
}
|
|
56
|
+
if (!claw) {
|
|
57
|
+
console.error('[myclaw-artifacts] ❌ 未配置 claw 名称,无法构建预览链接');
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
var wsName = data.workspace_id || 'main';
|
|
61
|
+
var wsPrefix = wsName === 'main' ? 'workspace' : 'workspace-' + wsName;
|
|
62
|
+
return 'https://cdn.yiranlaoshi.com/' + claw + '/' + wsPrefix + '/' + assetPath;
|
|
55
63
|
}
|
|
56
64
|
|
|
57
65
|
// ═══ 创建按钮 ═══
|
|
@@ -199,7 +207,7 @@
|
|
|
199
207
|
claw = localStorage.getItem(CLAW_STORAGE_KEY);
|
|
200
208
|
if (!claw) {
|
|
201
209
|
console.log('[myclaw-artifacts] ❌ 未配置 claw 名称');
|
|
202
|
-
console.log('[myclaw-artifacts]
|
|
210
|
+
console.log('[myclaw-artifacts] 请在控制台执行: localStorage.setItem("myclaw-claw-name", "你的claw名称")');
|
|
203
211
|
return null;
|
|
204
212
|
}
|
|
205
213
|
}
|