Skip to content

Commit 229308a

Browse files
authored
Merge pull request #57 from ZyqGitHub1/dev
Dev
2 parents 0b04a62 + 3c7d711 commit 229308a

File tree

7 files changed

+13
-21
lines changed

7 files changed

+13
-21
lines changed

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
"dependencies": {
1616
"@quasar/extras": "^1.3.1",
1717
"axios": "^0.19.0",
18-
"electron-positioner": "^4.1.0",
1918
"electron-store": "^5.0.0",
2019
"electron-util": "^0.12.1",
2120
"fs-extra": "^8.1.0",

src/layouts/Config.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -476,8 +476,8 @@ export default {
476476
properties: ['openFile'],
477477
filters: [{ name: 'JSON', extensions: ['json'] }],
478478
});
479-
if (dialogResult) {
480-
const importedFile = await fs.readJSON(dialogResult[0]);
479+
if (!dialogResult.canceled && dialogResult.filePaths) {
480+
const importedFile = await fs.readJSON(dialogResult.filePaths[0]);
481481
this.data = clonedeep(importedFile);
482482
}
483483
},
@@ -486,8 +486,8 @@ export default {
486486
const dialogResult = await dialog.showSaveDialog({
487487
defaultPath: 'source.json',
488488
});
489-
if (dialogResult) {
490-
await fs.writeJson(dialogResult, this.siteList);
489+
if (!dialogResult.canceled && dialogResult.filePath) {
490+
await fs.writeJson(dialogResult.filePath, this.siteList);
491491
}
492492
},
493493
closeConfig() {

src/layouts/Import.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,12 @@ export default {
5151
...mapMutations(['setSiteList']),
5252
async openDialog() {
5353
const { dialog } = this.$q.electron.remote;
54-
const dialogResult = dialog.showOpenDialog({
54+
const dialogResult = await dialog.showOpenDialog({
5555
properties: ['openFile'],
5656
filters: [{ name: 'JSON', extensions: ['json'] }],
5757
});
58-
if (dialogResult) {
59-
const importedFile = await fs.readJSON(dialogResult[0]);
58+
if (!dialogResult.canceled && dialogResult.filePaths) {
59+
const importedFile = await fs.readJSON(dialogResult.filePaths[0]);
6060
this.setSiteList(importedFile);
6161
this.$router.push('/');
6262
}

src/pages/MiniVideo.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export default {
6262
normalizeUrl(url) {
6363
if (isAbsoluteUrl(url)) {
6464
const pureUrl = url.replace(/(.*?)\$/, '').replace(/\$(.*)/, '');
65-
return normalizeUrl(pureUrl);
65+
return normalizeUrl(pureUrl, { stripWWW: false });
6666
}
6767
6868
return '';

src/pages/Video.vue

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ import normalizeUrl from 'normalize-url';
105105
import isAbsoluteUrl from 'is-absolute-url';
106106
import { mapState } from 'vuex';
107107
import { stringify } from 'query-string';
108-
import Positioner from 'electron-positioner';
108+
109109
import _find from 'lodash/find';
110110
import _get from 'lodash/get';
111111
@@ -205,7 +205,7 @@ export default {
205205
},
206206
normalizeUrl(url) {
207207
if (isAbsoluteUrl(url)) {
208-
return normalizeUrl(url);
208+
return normalizeUrl(url, { stripWWW: false });
209209
}
210210
return '';
211211
},
@@ -227,8 +227,8 @@ export default {
227227
const encodeUrl = stringify({ video: videoInfo, episode: episodeInfo });
228228
const parentWindow = getCurrentWindow();
229229
const win = new BrowserWindow({
230-
width: 800,
231-
height: 600,
230+
width: 400,
231+
height: 300,
232232
useContentSize: true,
233233
webPreferences: {
234234
nodeIntegration: true,
@@ -237,8 +237,6 @@ export default {
237237
parent: parentWindow,
238238
});
239239
win.removeMenu();
240-
const positioner = new Positioner(win);
241-
positioner.move('bottomRight');
242240
win.loadURL(`${process.env.APP_URL}#/mini-video?${encodeUrl}`);
243241
},
244242
errorHandler(event, data) {

src/pages/directVideo.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export default {
5050
normalizeUrl(url) {
5151
if (isAbsoluteUrl(url)) {
5252
const pureUrl = url.replace(/(.*?)\$/, '').replace(/\$(.*)/, '');
53-
return normalizeUrl(pureUrl);
53+
return normalizeUrl(pureUrl, { stripWWW: false });
5454
}
5555
5656
return '';

yarn.lock

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3436,11 +3436,6 @@ electron-packager@^14.0.6:
34363436
semver "^6.0.0"
34373437
yargs-parser "^13.0.0"
34383438

3439-
electron-positioner@^4.1.0:
3440-
version "4.1.0"
3441-
resolved "https://registry.npm.taobao.org/electron-positioner/download/electron-positioner-4.1.0.tgz#e158f8f6aabd6725a8a9b4f2279b9504bcbea1b0"
3442-
integrity sha1-4Vj49qq9ZyWoqbTyJ5uVBLy+obA=
3443-
34443439
electron-publish@21.2.0:
34453440
version "21.2.0"
34463441
resolved "https://registry.npm.taobao.org/electron-publish/download/electron-publish-21.2.0.tgz#cc225cb46aa62e74b899f2f7299b396c9802387d"

0 commit comments

Comments
 (0)