yangjie #37
|
|
@ -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": [
|
||||||
|
|
|
||||||
3
main.js
3
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');
|
||||||
|
|
@ -626,7 +627,7 @@ function updateHandle() {
|
||||||
updateAva: '检测到新版本,正在下载……',
|
updateAva: '检测到新版本,正在下载……',
|
||||||
updateNotAva: '已经是最新版本,不用更新'
|
updateNotAva: '已经是最新版本,不用更新'
|
||||||
}
|
}
|
||||||
autoUpdater.setFeedURL('https://meeting-api.23544.com/meeting/update')
|
autoUpdater.setFeedURL(updateJs.getUpdateUrl(env))
|
||||||
autoUpdater.autoDownload = false // 不自动下载安装包
|
autoUpdater.autoDownload = false // 不自动下载安装包
|
||||||
autoUpdater.autoInstallOnAppQuit = false // 不自动安装
|
autoUpdater.autoInstallOnAppQuit = false // 不自动安装
|
||||||
autoUpdater.on('error', function (error) {
|
autoUpdater.on('error', function (error) {
|
||||||
|
|
|
||||||
|
|
@ -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())
|
||||||
|
|
|
||||||
|
|
@ -54,3 +54,12 @@ export const storageSeeting: any = {
|
||||||
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