Merge branch 'yangjie' of https://gitea.23544.com/marking/WGShare.Client.Electron into yangjie
This commit is contained in:
commit
5e6af34fe5
|
|
@ -10,7 +10,7 @@
|
||||||
"publish": [
|
"publish": [
|
||||||
{
|
{
|
||||||
"provider": "generic",
|
"provider": "generic",
|
||||||
"url": "https://meeting-api.23544.com/meeting/update"
|
"url": "https://meeting-api.23544.com/meeting/update/syzh"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"files": [
|
"files": [
|
||||||
|
|
|
||||||
1
main.js
1
main.js
|
|
@ -11,6 +11,7 @@ const {
|
||||||
desktopCapturer,
|
desktopCapturer,
|
||||||
} = require('electron');
|
} = require('electron');
|
||||||
const path = require('node:path')
|
const path = require('node:path')
|
||||||
|
const updateJs = require('./src/utils/package/update')
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const Registry = require('winreg');
|
const Registry = require('winreg');
|
||||||
const { autoUpdater, CancellationToken } = require('electron-updater');
|
const { autoUpdater, CancellationToken } = require('electron-updater');
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
import styles from '@/components/UpdateModal/index.module.scss'
|
import styles from '@/components/UpdateModal/index.module.scss'
|
||||||
import ImageUrl from '@/utils/package/imageUrl';
|
import ImageUrl from '@/utils/package/imageUrl';
|
||||||
|
import { getUpdateUrl } from '@/utils/package/public';
|
||||||
import { Button, Flex, Modal, Progress } from 'antd';
|
import { Button, Flex, Modal, Progress } from 'antd';
|
||||||
import { forwardRef, useImperativeHandle, useState } from "react";
|
import { forwardRef, useImperativeHandle, useState } from "react";
|
||||||
|
|
||||||
|
|
@ -22,7 +23,7 @@ const UpdateModal = forwardRef((props: any, ref: any) => {
|
||||||
const [updateContent, setUpdateContent] = useState('') // 版本更新内容
|
const [updateContent, setUpdateContent] = useState('') // 版本更新内容
|
||||||
|
|
||||||
function getContent() {
|
function getContent() {
|
||||||
fetch(`https://meeting-api.23544.com/meeting/update/update.txt?t=${+new Date()}`) // 配置服务器地址
|
fetch(`${getUpdateUrl(import.meta.env.VITE_ENV)}/update.txt?t=${+new Date()}`) // 配置服务器地址
|
||||||
.then(async response => {
|
.then(async response => {
|
||||||
if (response.status === 200) {
|
if (response.status === 200) {
|
||||||
return setUpdateContent(await response.text())
|
return setUpdateContent(await response.text())
|
||||||
|
|
|
||||||
|
|
@ -53,4 +53,13 @@ export const storageSeeting: any = {
|
||||||
color: '0xFFFFFF', // 纯色
|
color: '0xFFFFFF', // 纯色
|
||||||
sourceIndex: '', // 背景图下标
|
sourceIndex: '', // 背景图下标
|
||||||
},
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
export const getUpdateUrl = (env: string) => {
|
||||||
|
switch (env) {
|
||||||
|
case 'xy':
|
||||||
|
return 'https://meeting-api.23544.com/meeting/update/syzh'
|
||||||
|
default:
|
||||||
|
return 'https://meeting-api.23544.com/meeting/update'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
module.exports = {
|
||||||
|
getUpdateUrl(env) {
|
||||||
|
switch (env) {
|
||||||
|
case 'xy':
|
||||||
|
return 'https://meeting-api.23544.com/meeting/update/syzh'
|
||||||
|
default:
|
||||||
|
return 'https://meeting-api.23544.com/meeting/update'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue