yangjie #49

Merged
yangqiang merged 71 commits from yangjie into master 2025-03-10 14:21:26 +08:00
5 changed files with 12 additions and 10 deletions
Showing only changes of commit c69d965183 - Show all commits

View File

@ -25,7 +25,7 @@ app.allowRendererProcessReuse = false;
let mainWindow = null;
let childWindow = {}
let isMaximized = false;
let env = 'production'; //development production xy
let env = 'development'; //development production xy
let regKey;
let connection = null;
let startNumber = 0;
@ -77,7 +77,7 @@ let tray;
// 检查网络状态
function checkNetworkStatus() {
if (!net.isOnline()) {
dialog.showErrorBox('智汇享-网络连接错误', '当前无网络连接,请检查您的网络设置。');
dialog.showErrorBox(`${env === 'xy' ? '湖北襄阳四中教研平台' : '智汇享'}-网络连接错误', '当前无网络连接,请检查您的网络设置。`);
app.quit();
return false;
}

View File

@ -201,7 +201,7 @@ const App: React.FC = () => {
event.preventDefault();
}
});
document.getElementsByTagName('title')[0].innerText = getTitle(storage.getItem('env') as string)
document.getElementsByTagName('title')[0].innerText = getTitle()
}, [])
const handleResize = (): void => {
setWindowSize({

View File

@ -47,7 +47,7 @@ const UpdateModal = forwardRef((props: any, ref: any) => {
const [updateContent, setUpdateContent] = useState('') // 版本更新内容
function getContent() {
fetch(`${getUpdateUrl(storage.getItem('env') as string)}/update.txt?t=${+new Date()}`) // 配置服务器地址
fetch(`${getUpdateUrl()}/update.txt?t=${+new Date()}`) // 配置服务器地址
.then(async response => {
if (response.status === 200) {
return setUpdateContent(await response.text())

View File

@ -40,6 +40,7 @@ const Login: React.FC = () => {
roomNum: '',
})
const [nameModal, setNameModal] = useState(false)
const [env, setEnv] = useState('')
useEffect(() => {
window.electron.setMainWindowSize({
@ -47,6 +48,7 @@ const Login: React.FC = () => {
height: 520,
key: 'login'
})
setEnv(storage.getItem('env') as string)
if (storage.getItem('login')) {
const login = JSON.parse(storage.getItem('login') as string);
const data = {
@ -201,7 +203,7 @@ const Login: React.FC = () => {
<>
<div className={styles.login}>
<div className={styles.loginBg}>
<img src={storage.getItem('env') === 'xy' ? ImageUrl.icon53 : ImageUrl.icon1} alt="" />
<img src={env === 'xy' ? ImageUrl.icon53 : ImageUrl.icon1} alt="" />
</div>
<div className={styles.loginContent}>
<div>

View File

@ -58,8 +58,8 @@ export const storageSeeting: any = {
},
}
export const getUpdateUrl = (env: string) => {
switch (env) {
export const getUpdateUrl = () => {
switch (storage.getItem('env')) {
case 'xy':
return 'https://meeting-api.23544.com/meeting/xysz'
case 'development':
@ -68,8 +68,8 @@ export const getUpdateUrl = (env: string) => {
return 'https://meeting-api.23544.com/meeting/update'
}
}
export const getTitle = (env: string) => {
switch (env) {
export const getTitle = () => {
switch (storage.getItem('env')) {
case 'xy':
return '湖北襄阳四中教研平台'
case 'development':
@ -95,7 +95,7 @@ export const compareVersions = (version1: string, version2: string): number => {
}
export const isVersion = (callBack: Function) => {
axios.get(`${getUpdateUrl(storage.getItem('env') as string)}/latest.yml`).then(res => {
axios.get(`${getUpdateUrl()}/latest.yml`).then(res => {
if (res.status === 200 && res.data) {
const data = yaml.load(res.data); // 解析 YAML 内容
window.electron.getVersion().then(req => {