Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
troyeguo committed Jan 9, 2024
1 parent c499b73 commit 69b364c
Show file tree
Hide file tree
Showing 15 changed files with 2,066 additions and 1,969 deletions.
41 changes: 0 additions & 41 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -439,47 +439,6 @@ const createMainWin = () => {
});
return path;
});

ipcMain.handle("get-url-content", async (event, config) => {
const axios = require("axios");
try {
const response = await axios.get(config.url, {
headers: {
"User-Agent":
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36",
},
});
return response.data;
} catch (error) {
console.error(error);
return null;
}
});
ipcMain.handle("wiki-index", async (event, config) => {
const wiki = require("wikijs").default;
try {
let page = await wiki({
apiUrl: "https://" + config.code + ".wikipedia.org/w/api.php",
}).page(config.text);
let summary = await page.summary();
let image = await page.mainImage();
return { summary, image };
} catch (error) {
console.error(error);
return null;
}
});
ipcMain.handle("wiki-images", async (event, config) => {
const wiki = require("wikijs").default;
try {
return await wiki()
.page("bat")
.then((page) => page.mainImage());
} catch (error) {
console.error(error);
return null;
}
});
ipcMain.on("storage-location", (event, arg) => {
event.returnValue = path.join(dirPath, "data");
});
Expand Down
6 changes: 0 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
},
"dependencies": {
"@aws-sdk/client-s3": "^3.485.0",
"@aws-sdk/s3-request-presigner": "^3.485.0",
"@vitalets/google-translate-api": "^8.0.0",
"adm-zip": "^0.5.2",
"axios": "^0.19.2",
"buffer": "^6.0.3",
Expand All @@ -39,16 +37,13 @@
"ssh2-sftp-client": "^9.1.0",
"uuid": "^9.0.1",
"webdav": "^3.6.2",
"webdav-fs": "3.0.0",
"wikijs": "^6.4.1",
"wink-lemmatizer": "^3.0.4",
"ws": "^8.13.0",
"zip-a-folder": "^0.0.12"
},
"devDependencies": {
"@types/i18next": "^13.0.0",
"@types/iconv-lite": "^0.0.1",
"@types/md5": "^2.2.0",
"@types/node": "^13.13.2",
"@types/react": "17.0.2",
"@types/react-dom": "17.0.2",
Expand All @@ -66,7 +61,6 @@
"hard-source-webpack-plugin": "^0.13.1",
"html-react-parser": "^0.13.0",
"i18next": "^20.2.4",
"md5": "^2.3.0",
"node-sass": "^9.0.0",
"nodemon": "^2.0.6",
"rc-color-picker": "^1.2.6",
Expand Down
8 changes: 6 additions & 2 deletions src/assets/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -388,5 +388,9 @@
"Brief description of the problem": "Brief description of the problem",
"Detailed description of the problem": "Detailed description of the problem",
"Your email(optional), We may contact you for further investigation": "Your email(optional), We may contact you for further investigation",
"Report": "Report"
}
"Report": "Report",
"Sentence": "Sentence",
"Associations": "Associations",
"Explanations": "Sentence",
"Pronunciations": "Pronunciations"
}
8 changes: 6 additions & 2 deletions src/assets/locales/zh-CN/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -392,5 +392,9 @@
"Your email(optional), We may contact you for further investigation": "您的邮箱(可选的),我们可能会进一步联系您",
"Add to favorite": "添加到喜爱",
"Remove from favorite": "移除喜爱",
"Report": "报告问题"
}
"Report": "报告问题",
"Sentence": "例句",
"Associations": "关联",
"Explanations": "解释",
"Pronunciations": "发音"
}
Loading

0 comments on commit 69b364c

Please sign in to comment.