Web 端数据交互与 design2 布局修复
统一门户 JSON 契约:新增 GET /templates/{id},模板/云文件/保存/打开走虚拟 key;
layer 保存弹层替代 prompt,本地 .soon 已登录后台 POST 登记;修复保存静默失败与 design2 全宽布局。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1299,7 +1299,7 @@ $('#open').click(function () {
|
||||
return;
|
||||
}
|
||||
layer.confirm(
|
||||
'<font style="color:black">' + language_str('whetherSave') + '</font>',
|
||||
language_str('whetherSave'),
|
||||
function (index) {
|
||||
if (typeof window.output === 'function') {
|
||||
window.output(OpenDialog);
|
||||
@@ -1326,18 +1326,14 @@ $('#open').click(function () {
|
||||
if (typeof window.openFile === 'function') window.openFile(fileKey, j);
|
||||
}
|
||||
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) {
|
||||
@@ -1364,7 +1360,7 @@ $('#new').click(function () {
|
||||
return;
|
||||
}
|
||||
layer.confirm(
|
||||
'<font style="color:black">' + language_str('whetherSave') + '</font>',
|
||||
language_str('whetherSave'),
|
||||
function (index) {
|
||||
if (typeof window.output === 'function') {
|
||||
window.output(goFirstPage);
|
||||
|
||||
Reference in New Issue
Block a user