Skip to content
This repository has been archived by the owner on Jan 5, 2023. It is now read-only.

Commit

Permalink
Merge pull request #193 from g0v/ie-promise-undefined
Browse files Browse the repository at this point in the history
修正IE瀏覽器Promise無定義,網頁無法顯示
  • Loading branch information
sih4sing5hong5 authored Sep 20, 2016
2 parents e7d698f + 69bfaef commit 6c7a78f
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
},
"homepage": "https://github.com/g0v/itaigi",
"dependencies": {
"babel-polyfill": "^6.13.0",
"raw-loader": "^0.5.1"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions src/App/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export default Transmit.createContainer(App, {
debug('後端網址 %s', 後端網址);
if (!後端網址) return new Promise((cb) => cb(''));
return (
superagent.get(後端網址 + 'csrf/看')
superagent.get(encodeURI(後端網址 + 'csrf/看'))
.withCredentials()
.then(({ body }) => body.csrftoken)
);
Expand All @@ -88,7 +88,7 @@ export default Transmit.createContainer(App, {
編號() {
if (!後端網址) return new Promise((cb)=>cb('無登入'));
return (
superagent.get(後端網址 + '使用者/看編號')
superagent.get(encodeURI(後端網址 + '使用者/看編號'))
.withCredentials()
.then(({ body }) => body.使用者編號)
);
Expand Down
4 changes: 2 additions & 2 deletions src/GuanKiann/Su/Su.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export default Transmit.createContainer(Su, {
});
}

return superagent.get(後端網址 + '平臺項目/看詳細內容?平臺項目編號=' + suId)
return superagent.get(encodeURI(後端網址 + '平臺項目/看詳細內容?平臺項目編號=' + suId))
.then((res) => Object.assign({
'結果': 0,
}, res.body))
Expand All @@ -132,7 +132,7 @@ export default Transmit.createContainer(Su, {
});
}

return superagent.get(後端網址 + '平臺項目列表/揣按呢講列表?關鍵字=' + suText)
return superagent.get(encodeURI(後端網址 + '平臺項目列表/揣按呢講列表?關鍵字=' + suText))
.then(({ body }) => body.列表)
.catch((err) => console.log(err));
},
Expand Down
2 changes: 1 addition & 1 deletion src/Iah/Kong/Kong.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export default Transmit.createContainer(Kong, {
});
}

return superagent.get(後端網址 + '平臺項目列表/揣列表?關鍵字=' + params.k)
return superagent.get(encodeURI(後端網址 + '平臺項目列表/揣列表?關鍵字=' + params.k))
.then(({ body }) => ({
'關鍵字': params.k,
'結果': body.列表.length,
Expand Down
2 changes: 1 addition & 1 deletion src/Iah/The/顯示選單.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export default Transmit.createContainer(顯示選單, {
}

return (
superagent.get(後端網址 + '平臺項目列表/揣無建議的外語')
superagent.get(encodeURI(後端網址 + '平臺項目列表/揣無建議的外語'))
.then(({ body }) => (body))
.catch((err) => ({
'列表': [],
Expand Down
1 change: 1 addition & 0 deletions webpack.config.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ module.exports = {
entry: [
'eventsource-polyfill', // necessary for hot reloading with IE
'webpack-hot-middleware/client',
'babel-polyfill',
'./src',
],
output: {
Expand Down
1 change: 1 addition & 0 deletions webpack.config.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ var webpack = require('webpack');
module.exports = {
devtool: 'source-map',
entry: [
'babel-polyfill',
'./src',
],
output: {
Expand Down

0 comments on commit 6c7a78f

Please sign in to comment.