Skip to content

Commit fe4d14e

Browse files
Merge pull request #416 from OpenWebGAL/dev
4.5.13
2 parents caf5935 + 7b25ba7 commit fe4d14e

File tree

39 files changed

+1856
-1042
lines changed

39 files changed

+1856
-1042
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "webgal-terre",
3-
"version": "4.5.12",
3+
"version": "4.5.13",
44
"private": true,
55
"scripts": {
66
"dev": "concurrently \"yarn dev:terre\" \"yarn dev:origine\" \"yarn dev:start-dev-server\"",
@@ -31,7 +31,7 @@
3131
"iconv-lite": "^0.6.3"
3232
},
3333
"engines": {
34-
"node": "18"
34+
"node": ">=18"
3535
},
3636
"packageManager": "yarn@1.22.22"
3737
}

packages/WebGAL-electron/main.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,18 @@ const createWindow = () => {
5757

5858
logMessage(message);
5959
});
60+
61+
/**
62+
* 侦听BrowserWindow关闭事件
63+
*/
64+
win.on("close", () => {
65+
app.quit();
66+
});
6067
}
6168

6269
/**
6370
* 在关闭所有窗口时退出应用
6471
*/
6572
app.on('window-all-closed', () => {
6673
if (process.platform !== 'darwin') app.quit()
67-
})
74+
})

packages/origine2/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"name": "webgal-origine-2",
33
"private": true,
4-
"version": "4.5.12",
4+
"version": "4.5.13",
55
"license": "MPL-2.0",
66
"scripts": {
77
"dev": "lingui extract && lingui compile --typescript && vite --host",
8-
"build": "lingui extract && lingui compile --typescript && node version-sync.js && tsc && vite build --base=./",
9-
"build-lowram": "lingui extract && lingui compile --typescript && node version-sync.js && tsc && node --max_old_space_size=512000 ./node_modules/bin/vite build --base=./",
8+
"build": "lingui extract && lingui compile --typescript && tsc && vite build --base=./",
9+
"build-lowram": "lingui extract && lingui compile --typescript && tsc && node --max_old_space_size=512000 ./node_modules/bin/vite build --base=./",
1010
"preview": "vite preview",
1111
"lint": "eslint src/** --fix",
1212
"openapi": "tsx openapi.ts",
@@ -79,6 +79,7 @@
7979
"swagger-typescript-api": "^13.0.3",
8080
"tsx": "^3.14.0",
8181
"typescript": "^4.6.3",
82+
"unplugin-info": "^1.2.1",
8283
"vite": "^4.4.9"
8384
}
8485
}

packages/origine2/src/App.tsx

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -44,42 +44,7 @@ function App() {
4444

4545
// 建立 WS 连接
4646
useEffect(() => {
47-
try {
48-
const loc: string = window.location.hostname;
49-
const protocol: string = window.location.protocol;
50-
const port: string = window.location.port; // 获取端口号
5147

52-
// 默认情况下,不需要在URL中明确指定标准HTTP(80)和HTTPS(443)端口
53-
let defaultPort = '';
54-
if (port && port !== '80' && port !== '443') {
55-
// 如果存在非标准端口号,将其包含在URL中
56-
defaultPort = `:${port}`;
57-
}
58-
59-
if (protocol !== 'http:' && protocol !== 'https:') {
60-
return;
61-
}
62-
63-
// 根据当前协议构建WebSocket URL,并包括端口号(如果有)
64-
let wsUrl = `ws://${loc}${defaultPort}/api/webgalsync`;
65-
if (protocol === 'https:') {
66-
wsUrl = `wss://${loc}${defaultPort}/api/webgalsync`;
67-
}
68-
69-
console.log('正在启动socket连接位于:' + wsUrl);
70-
const socket = new WebSocket(wsUrl);
71-
socket.onopen = () => {
72-
console.log('socket已连接');
73-
socket.send('WebGAL Origine 已和 Terre 建立连接');
74-
};
75-
socket.onmessage = (e) => {
76-
eventBus.emit('get-ws-message', e.data);
77-
};
78-
// @ts-ignore
79-
window['currentWs'] = socket;
80-
} catch (e) {
81-
console.warn('ws连接失败');
82-
}
8348
}, []);
8449

8550
useHashRoute();
Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1+
import { version } from '~build/package';
2+
import now from '~build/time';
3+
14
export interface Info {
25
version: string,
3-
buildTime: string,
6+
buildTime: Date,
47
}
58

69
export const __INFO: Info = {
7-
version: '4.5.12',
8-
buildTime: '2025-03-01T14:52:34.009Z', // 编译时会通过 version-sync.js 自动更新
10+
version,
11+
buildTime: now,
912
};

0 commit comments

Comments
 (0)