{"action":"opened","issue":{"url":"https://api.github.com/repos/think2011/localResizeIMG/issues/59","labels_url":"https://api.github.com/repos/think2011/localResizeIMG/issues/59/labels{/name}","comments_url":"https://api.github.com/repos/think2011/localResizeIMG/issues/59/comments","events_url":"https://api.github.com/repos/think2011/localResizeIMG/issues/59/events","html_url":"https://github.com/think2011/localResizeIMG/issues/59","id":119359338,"number":59,"title":"不能预览图片","user":{"login":"zwl1619","id":13177997,"avatar_url":"https://avatars.githubusercontent.com/u/13177997?v=3","gravatar_id":"","url":"https://api.github.com/users/zwl1619","html_url":"https://github.com/zwl1619","followers_url":"https://api.github.com/users/zwl1619/followers","following_url":"https://api.github.com/users/zwl1619/following{/other_user}","gists_url":"https://api.github.com/users/zwl1619/gists{/gist_id}","starred_url":"https://api.github.com/users/zwl1619/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zwl1619/subscriptions","organizations_url":"https://api.github.com/users/zwl1619/orgs","repos_url":"https://api.github.com/users/zwl1619/repos","events_url":"https://api.github.com/users/zwl1619/events{/privacy}","received_events_url":"https://api.github.com/users/zwl1619/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-11-29T12:59:20Z","updated_at":"2015-11-29T12:59:20Z","closed_at":null,"body":"这样写的代码，但不能预览图片，怎么的？\r\n1、引入js\r\n<script src=\"/js/dist/lrz.bundle.js\"></script>\r\n2、view\r\n<input onchange=\"upload().bind(this)\" type=\"file\" accept=\"image/*\" />\r\n3、script\r\nfunction upload () {\r\n    lrz(this.files[0])\r\n        .then(function (rst) {\r\n           var img = new Image();\r\n            img.src = rst.base64;\r\n\r\n            img.onload = function () {\r\n                document.body.appendChild(img);\r\n            };\r\n\r\n            return rst;\r\n        })\r\n        .catch(function (err) {\r\n           alert(err);\r\n        })\r\n        .always(function () {\r\n            // 不管是成功失败，都会执行\r\n        });\r\n});"}}