Web 端数据交互与 design2 布局修复
统一门户 JSON 契约:新增 GET /templates/{id},模板/云文件/保存/打开走虚拟 key;
layer 保存弹层替代 prompt,本地 .soon 已登录后台 POST 登记;修复保存静默失败与 design2 全宽布局。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1345,7 +1345,7 @@ $("#open").click(function () {
|
||||
OpenDialog();
|
||||
return;
|
||||
}
|
||||
layer.confirm('<font style="color:black">' + language_str("whetherSave") + '</font>', function (index) {//confirm 是否保存当前文件�?
|
||||
layer.confirm(language_str("whetherSave"), function (index) {//confirm 是否保存当前文件�?
|
||||
if (typeof window.output === 'function') {
|
||||
window.output(OpenDialog);
|
||||
}
|
||||
@@ -1375,18 +1375,14 @@ $("#open").click(function () {
|
||||
}
|
||||
}
|
||||
function importAndOpen(j, fileName) {
|
||||
var tok = typeof window.soonGetAccessToken === 'function'
|
||||
? window.soonGetAccessToken()
|
||||
: (localStorage.getItem('soon_access') || '');
|
||||
if (!tok && typeof window.soonPutSoonSession === 'function') {
|
||||
if (typeof window.soonPutSoonSession === 'function') {
|
||||
var localKey = window.soonPutSoonSession(j, fileName || 'design.soon');
|
||||
if (localKey) openWithKey(localKey, j);
|
||||
return;
|
||||
if (!localKey) return;
|
||||
if (typeof window.soonScheduleCloudImport === 'function') {
|
||||
window.soonScheduleCloudImport(localKey, fileName || 'design.soon');
|
||||
}
|
||||
openWithKey(localKey, j);
|
||||
}
|
||||
if (!window.platformBridge || !window.platformBridge.importSoonFile) return;
|
||||
window.platformBridge.importSoonFile(fileName || 'design.soon', j).then(function(res) {
|
||||
if (res && res.fileKey) openWithKey(res.fileKey, j);
|
||||
}).catch(function () {});
|
||||
}
|
||||
if (file && file.text) {
|
||||
file.text().then(function(t) {
|
||||
@@ -1445,7 +1441,7 @@ $("#new").click(function () {
|
||||
else if (window.platformBridge) window.platformBridge.openFirstPage();
|
||||
return;
|
||||
}
|
||||
layer.confirm('<font style="color:black">' + language_str("whetherSave") + '</font>', function (index) {//confirm 是否保存当前文件�?
|
||||
layer.confirm(language_str("whetherSave"), function (index) {//confirm 是否保存当前文件�?
|
||||
if (typeof window.output === 'function') {
|
||||
window.output(function() { if (ipcRenderer) ipcRenderer.send('open-first-page'); else if (window.platformBridge) window.platformBridge.openFirstPage(); });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user