更新地址修改
This commit is contained in:
parent
ccc20c4aab
commit
09d53987b4
|
|
@ -10,7 +10,7 @@
|
|||
"publish": [
|
||||
{
|
||||
"provider": "generic",
|
||||
"url": "https://meeting-api.23544.com/meeting/update"
|
||||
"url": "https://meeting-api.23544.com/meeting/update/syzh"
|
||||
}
|
||||
],
|
||||
"files": [
|
||||
|
|
|
|||
3
main.js
3
main.js
|
|
@ -11,6 +11,7 @@ const {
|
|||
desktopCapturer,
|
||||
} = require('electron');
|
||||
const path = require('node:path')
|
||||
const updateJs = require('./src/utils/package/update')
|
||||
const fs = require('fs');
|
||||
const Registry = require('winreg');
|
||||
const { autoUpdater, CancellationToken } = require('electron-updater');
|
||||
|
|
@ -626,7 +627,7 @@ function updateHandle() {
|
|||
updateAva: '检测到新版本,正在下载……',
|
||||
updateNotAva: '已经是最新版本,不用更新'
|
||||
}
|
||||
autoUpdater.setFeedURL('https://meeting-api.23544.com/meeting/update')
|
||||
autoUpdater.setFeedURL(updateJs.getUpdateUrl(env))
|
||||
autoUpdater.autoDownload = false // 不自动下载安装包
|
||||
autoUpdater.autoInstallOnAppQuit = false // 不自动安装
|
||||
autoUpdater.on('error', function (error) {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import styles from '@/components/UpdateModal/index.module.scss'
|
||||
import ImageUrl from '@/utils/package/imageUrl';
|
||||
import { getUpdateUrl } from '@/utils/package/public';
|
||||
import { Button, Flex, Modal, Progress } from 'antd';
|
||||
import { forwardRef, useImperativeHandle, useState } from "react";
|
||||
|
||||
|
|
@ -22,7 +23,7 @@ const UpdateModal = forwardRef((props: any, ref: any) => {
|
|||
const [updateContent, setUpdateContent] = useState('') // 版本更新内容
|
||||
|
||||
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 => {
|
||||
if (response.status === 200) {
|
||||
return setUpdateContent(await response.text())
|
||||
|
|
|
|||
|
|
@ -53,4 +53,13 @@ export const storageSeeting: any = {
|
|||
color: '0xFFFFFF', // 纯色
|
||||
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