优化更新
This commit is contained in:
parent
1e3107d0e2
commit
ed2c39e7fc
|
|
@ -1,17 +1,17 @@
|
||||||
{
|
{
|
||||||
"name": "WGShare.Metting",
|
"name": "WGShare.Metting",
|
||||||
"version": "0.4.8",
|
"version": "0.7.1",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "WGShare.Metting",
|
"name": "WGShare.Metting",
|
||||||
"version": "0.4.8",
|
"version": "0.7.1",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@ant-design/icons": "^5.3.7",
|
"@ant-design/icons": "^5.3.7",
|
||||||
"@microsoft/signalr": "^8.0.0",
|
"@microsoft/signalr": "^8.0.0",
|
||||||
"@types/node": "^20.14.9",
|
"@types/node": "^20.14.9",
|
||||||
"agora-electron-sdk": "^4.4.0",
|
"agora-electron-sdk": "4.4.0",
|
||||||
"animate.css": "^4.1.1",
|
"animate.css": "^4.1.1",
|
||||||
"antd": "^5.18.2",
|
"antd": "^5.18.2",
|
||||||
"axios": "^1.7.2",
|
"axios": "^1.7.2",
|
||||||
|
|
@ -19,6 +19,7 @@
|
||||||
"dayjs": "^1.11.11",
|
"dayjs": "^1.11.11",
|
||||||
"electron-squirrel-startup": "^1.0.1",
|
"electron-squirrel-startup": "^1.0.1",
|
||||||
"electron-updater": "^6.2.1",
|
"electron-updater": "^6.2.1",
|
||||||
|
"js-yaml": "^4.1.0",
|
||||||
"os": "^0.1.2",
|
"os": "^0.1.2",
|
||||||
"path": "^0.12.7",
|
"path": "^0.12.7",
|
||||||
"postcss-px-to-viewport-8-plugin": "^1.2.5",
|
"postcss-px-to-viewport-8-plugin": "^1.2.5",
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "WGShare.Metting",
|
"name": "WGShare.Metting",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.7.1",
|
"version": "0.7.0",
|
||||||
"main": "main.js",
|
"main": "main.js",
|
||||||
"authors": "yj",
|
"authors": "yj",
|
||||||
"description": "智汇享",
|
"description": "智汇享",
|
||||||
|
|
@ -34,6 +34,7 @@
|
||||||
"dayjs": "^1.11.11",
|
"dayjs": "^1.11.11",
|
||||||
"electron-squirrel-startup": "^1.0.1",
|
"electron-squirrel-startup": "^1.0.1",
|
||||||
"electron-updater": "^6.2.1",
|
"electron-updater": "^6.2.1",
|
||||||
|
"js-yaml": "^4.1.0",
|
||||||
"os": "^0.1.2",
|
"os": "^0.1.2",
|
||||||
"path": "^0.12.7",
|
"path": "^0.12.7",
|
||||||
"postcss-px-to-viewport-8-plugin": "^1.2.5",
|
"postcss-px-to-viewport-8-plugin": "^1.2.5",
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,8 @@ import { GetSubDpList } from '@/api/Home/User';
|
||||||
import FeedBackModel from '@/components/FeedBackModel';
|
import FeedBackModel from '@/components/FeedBackModel';
|
||||||
import { PostHomeVerLog } from '@/api/Meeting';
|
import { PostHomeVerLog } from '@/api/Meeting';
|
||||||
import Code from '@/components/Code';
|
import Code from '@/components/Code';
|
||||||
|
import { isVersion } from "@/utils/package/public";
|
||||||
|
|
||||||
const { setInterval, clearInterval } = require('timers');
|
const { setInterval, clearInterval } = require('timers');
|
||||||
const fs = require('fs').promises;
|
const fs = require('fs').promises;
|
||||||
const { exec } = require('child_process');
|
const { exec } = require('child_process');
|
||||||
|
|
@ -308,6 +310,12 @@ const Index: React.FC = () => {
|
||||||
<Button type="primary"
|
<Button type="primary"
|
||||||
iconPosition={'end'}
|
iconPosition={'end'}
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
|
storage.setItem('loading', true)
|
||||||
|
isVersion((bool: boolean) => {
|
||||||
|
storage.setItem('loading', false)
|
||||||
|
if (bool) {
|
||||||
|
window.electron.onDownload('3')
|
||||||
|
} else {
|
||||||
if (role.ID.includes(userInfo.roleId)) {
|
if (role.ID.includes(userInfo.roleId)) {
|
||||||
joinSettingRef.current.changeModal(item.roomNum)
|
joinSettingRef.current.changeModal(item.roomNum)
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -337,6 +345,8 @@ const Index: React.FC = () => {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
}}
|
}}
|
||||||
icon={<img src={ImageUrl.icon9} alt="" />}
|
icon={<img src={ImageUrl.icon9} alt="" />}
|
||||||
className='m-ant-btn'>
|
className='m-ant-btn'>
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ import ImageUrl from '@/utils/package/imageUrl'
|
||||||
import { v4 as uuidv4 } from 'uuid';
|
import { v4 as uuidv4 } from 'uuid';
|
||||||
import { GetCheckoutRoomNum, GetRoomInfo, GetRoomRtcToken } from '@/api/Home/Index';
|
import { GetCheckoutRoomNum, GetRoomInfo, GetRoomRtcToken } from '@/api/Home/Index';
|
||||||
import { ExclamationCircleFilled } from '@ant-design/icons';
|
import { ExclamationCircleFilled } from '@ant-design/icons';
|
||||||
|
import { isVersion } from '@/utils/package/public';
|
||||||
const { confirm } = Modal;
|
const { confirm } = Modal;
|
||||||
const Login: React.FC = () => {
|
const Login: React.FC = () => {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
@ -345,6 +346,12 @@ const Login: React.FC = () => {
|
||||||
if (anonInfo.nickName.length > 10) {
|
if (anonInfo.nickName.length > 10) {
|
||||||
return message.error('参会昵称最多10个字!')
|
return message.error('参会昵称最多10个字!')
|
||||||
}
|
}
|
||||||
|
storage.setItem('loading', true)
|
||||||
|
isVersion((bool: boolean) => {
|
||||||
|
storage.setItem('loading', false)
|
||||||
|
if (bool) {
|
||||||
|
window.electron.onDownload('3')
|
||||||
|
} else {
|
||||||
storage.setItem('loading', true)
|
storage.setItem('loading', true)
|
||||||
PostAnonLogin(anonInfo).then(async (res) => {
|
PostAnonLogin(anonInfo).then(async (res) => {
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
|
|
@ -387,6 +394,8 @@ const Login: React.FC = () => {
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
storage.setItem('loading', false)
|
storage.setItem('loading', false)
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
}}>进入</Button>
|
}}>进入</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
declare module 'react-dom/client';
|
declare module 'react-dom/client';
|
||||||
declare module 'crypto-js';
|
declare module 'crypto-js';
|
||||||
|
declare module 'js-yaml';
|
||||||
declare module 'uuid';
|
declare module 'uuid';
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
import path from "path";
|
import path from "path";
|
||||||
import storage from "./storage";
|
import storage from "./storage";
|
||||||
|
import axios from "axios";
|
||||||
|
import yaml from 'js-yaml'
|
||||||
export const setKeyOpenChildWindow = async (key: string, bool: boolean) => {
|
export const setKeyOpenChildWindow = async (key: string, bool: boolean) => {
|
||||||
const openChildWindow = await JSON.parse(storage.getItem('openChildWindow') as string)
|
const openChildWindow = await JSON.parse(storage.getItem('openChildWindow') as string)
|
||||||
openChildWindow[key] = bool;
|
openChildWindow[key] = bool;
|
||||||
|
|
@ -72,3 +74,35 @@ export const getTitle = (env: string) => {
|
||||||
return '智汇享'
|
return '智汇享'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
export const compareVersions = (version1: string, version2: string): number => {
|
||||||
|
const v1Parts = version1.split('.').map(Number);
|
||||||
|
const v2Parts = version2.split('.').map(Number);
|
||||||
|
const maxLength = Math.max(v1Parts.length, v2Parts.length);
|
||||||
|
for (let i = 0; i < maxLength; i++) {
|
||||||
|
const v1 = v1Parts[i] || 0;
|
||||||
|
const v2 = v2Parts[i] || 0;
|
||||||
|
if (v1 > v2) {
|
||||||
|
return 1;
|
||||||
|
} else if (v1 < v2) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const isVersion = (callBack: Function) => {
|
||||||
|
axios.get(import.meta.env.VITE_ENV !== 'development' ? 'https://meeting-api.23544.com/meeting/update' : 'http://192.168.2.9:8827/latest.yml').then(res => {
|
||||||
|
if (res.status === 200 && res.data) {
|
||||||
|
const data = yaml.load(res.data); // 解析 YAML 内容
|
||||||
|
window.electron.getVersion().then(req => {
|
||||||
|
if (compareVersions(data.version, req) === -1) {
|
||||||
|
callBack(false)
|
||||||
|
} else {
|
||||||
|
callBack(true)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}).catch(() => {
|
||||||
|
callBack(true)
|
||||||
|
})
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue