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

修正IE瀏覽器Promise無定義,網頁無法顯示 #193

Merged
merged 3 commits into from
Sep 20, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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",
Copy link
Contributor

@sih4sing5hong5 sih4sing5hong5 Sep 17, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

是哪些東西需要babel-polyfill呀?
要不要統一放在devDependencies~~

"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 @@ -86,7 +86,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 @@ -95,7 +95,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 @@ -117,7 +117,7 @@ export default Transmit.createContainer(Su, {
});
}

return superagent.get(後端網址 + '平臺項目/看詳細內容?平臺項目編號=' + suId)
return superagent.get(encodeURI(後端網址 + '平臺項目/看詳細內容?平臺項目編號=' + suId))
.then((res) => Object.assign({
'結果': 0,
}, res.body))
Expand All @@ -131,7 +131,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 @@ -52,7 +52,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