fix(rdesign): use relative path for API fetch to avoid mixed content
The bare-domain router redirects /demo/... paths to demo.rspace.online with http:// protocol, causing mixed content errors. Use the current page path as the base URL instead of constructing an absolute path. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
bfbf1d14cd
commit
c2b5820f8a
|
|
@ -215,7 +215,8 @@ const RDESIGN_JS = `
|
|||
var space = document.getElementById('rdesign-app').dataset.space || 'demo';
|
||||
var fetchHeaders = { 'Content-Type': 'application/json' };
|
||||
try { var sess = JSON.parse(localStorage.getItem('encryptid_session') || '{}'); if (sess.accessToken) fetchHeaders['Authorization'] = 'Bearer ' + sess.accessToken; } catch(e) {}
|
||||
fetch('/' + space + '/rdesign/api/design-agent', {
|
||||
var basePath = window.location.pathname.replace(/\\/$/, '');
|
||||
fetch(basePath + '/api/design-agent', {
|
||||
method: 'POST',
|
||||
headers: fetchHeaders,
|
||||
body: JSON.stringify({ brief: text, space: space }),
|
||||
|
|
|
|||
Loading…
Reference in New Issue