我在我的应用程序中使用PhotoEditorSDK ,但出现附加错误。在附件中还遵循了我用来得出这些结果的代码。
好像是跨域问题
但是 SDK 有一个特定的部分。我在公司的支持下打开了电话,但到目前为止还没有。如果有人已经遇到过这个问题,知道原因,或者如何解决。请帮我 ;-;
"use stricts";
/*link = http://localhost:8080/editar?&page=1&url=https://photos.google.com/lr/photo/AGj1epXDcMoRlOQ7QcWY9dZ2ALBIqhfJuTSz-ywrilsUhstrZ7wo26XkgDSBk4Jx2nJuIPm3LCFoKuo
*/
var editor;
var vars = getUrlVars();
var page = vars.page;
var url = vars.url;
window.onload = function () {
var container = document.getElementById('editor');
var img = new Image();
img.src = url;
editor = new PhotoEditorSDK.UI.ReactUI({
container: container,
enableUpload: false,
crossOrigin: 'anonymous',
editor: {
image: img,
responsive: true,
enableZoom: false,
controlsOrder: ['transform', 'filter', 'adjustments', 'focus'],
export: {
download: false,
format: 'image/jpeg',
type: PhotoEditorSDK.RenderType.BLOB
},
},
//your license below
license: 'license',
assets: {
baseUrl: '/assets'
},
});
}
function getUrlVars() {
console.log(window.location.href);
var vars = [], hash;
var hashes = window.location.href.slice(window.location.href.indexOf("#") + 1).split("&");
for (var i = 0; i < hashes.length; i++) {
hash = hashes[i].split("=");
vars.push(hash[0]);
vars[hash[0]] = hash[1];
}
return vars;
}
<html>
<head>
<script src="/js/jquery-1.11.3.min.js"></script>
<!-- React Dependencies for the SDK UI -->
<script src="js/vendor/react.production.min.js"></script>
<script src="js/vendor/react-dom.production.min.js"></script>
<!-- PhotoEditor SDK-->
<script src="js/PhotoEditorSDK.min.js"></script>
<!-- PhotoEditor SDK UI -->
<script src="js/PhotoEditorSDK.UI.ReactUI.min.js"></script>
<link rel="stylesheet" href="css/PhotoEditorSDK.UI.ReactUI.min.css" />
</head>
<body>
<div id="editor" style="width: 100%; height: 100%; padding-top: 65px;"></div>
<script src="js/editar.js"></script>
</body>
</html>