优化版本更新

This commit is contained in:
gyq 2024-09-05 16:19:50 +08:00
parent 34f0b306c9
commit e17b12687f
6 changed files with 33 additions and 15841 deletions

View File

@ -11,4 +11,7 @@ VITE_API_PHP_URL = 'https://czgdoumei.sxczgkj.com/index.php/api'
VITE_API_KP_URL = 'https://invoice.sxczgkj.cn/api'
# 线上环境接口地址
VITE_API_URL = 'https://cashierclient.sxczgkj.cn/cashier-client/'
# VITE_API_URL = 'https://cashierclient.sxczgkj.cn/cashier-client/'
# 预发布接口
VITE_API_URL = 'https://pre-cashierclient.sxczgkj.cn/cashier-client/'

File diff suppressed because one or more lines are too long

View File

@ -69,7 +69,7 @@ app.whenReady().then(() => {
setTimeout(() => {
win = null;
app.exit();
}, 1000);
}, 1500);
const installResult = await installExe(tempFilePath);
console.log(`安装结果:${installResult}`);

View File

@ -9,7 +9,7 @@
</div>
<template #footer>
<div class="footer" style="padding: 0 20px 20px;">
<el-button v-if="!updataInfo.isUp && !isUpload" @click="showDialog = false">下次更新</el-button>
<el-button v-if="!updataInfo.isUp && !isUpload" @click="closeHandle">下次更新</el-button>
<el-button type="primary" :loading="isUpload" @click="uplaodHandle">
<template v-if="!uploadSucess">
<template v-if="!isUpload">
@ -33,6 +33,7 @@ import { onMounted, ref } from 'vue'
import { findVersion } from '@/api/user.js'
import packageData from "../../package.json";
import { ipcRenderer } from 'electron'
import useStorage from '@/utils/useStorage.js'
import { useUser } from "@/store/user.js";
@ -46,12 +47,19 @@ const uploadSucess = ref(false)
const uploadResponse = ref({})
const tempFilePath = ref('')
//
function closeHandle() {
showDialog.value = false
useStorage.set('updateFlag', true)
}
//
async function findVersionAjax() {
try {
let updateFlag = useStorage.get('updateFlag')
const res = await findVersion()
let reg = /\./g;
if (res.version.replace(reg, '') > packageData.version.replace(reg, '') && res.url) {
if (res.version.replace(reg, '') > packageData.version.replace(reg, '') && res.url && !updateFlag) {
showDialog.value = true
updataInfo.value = res
}

View File

@ -98,10 +98,10 @@
<div class="btm">
<el-button icon="Edit" @click="remarkRef.show()"></el-button>
<div class="button">
<div class="btn" v-if="global.tableInfo.id">
<!-- <div class="btn" v-if="global.tableInfo.id">
<el-button type="primary" style="width: 100%;" :disabled="!cartList.length"
@click="createOrderHandle(0)">仅下单</el-button>
</div>
</div> -->
<div class="btn">
<el-button type="primary" style="width: 100%;" :disabled="!cartList.length" v-loading="createOrderLoading"
@click="createOrderHandle(1)">

View File

@ -187,6 +187,7 @@ const exit = async () => {
useStorage.del('token')
useStorage.del('douyin')
useStorage.del('categorysActive')
useStorage.del('updateFlag')
ElMessage.success("交班成功");
setTimeout(() => {
@ -217,6 +218,7 @@ const exit = async () => {
useStorage.del('token')
useStorage.del('douyin')
useStorage.del('categorysActive')
useStorage.del('updateFlag')
ElMessage.success("交班成功");
setTimeout(() => {
router.replace({