xklr/wly 5 months ago
parent
commit
e660640df9

+ 1 - 1
src/main/main.js

@@ -54,7 +54,7 @@ async function createWindow() {
       // partition: String(+new Date()),
       // partition: String(+new Date()),
       nodeIntegration: true,
       nodeIntegration: true,
       enableRemoteModule: true,
       enableRemoteModule: true,
-      devTools: true,
+      devTools: isdev,
       contextIsolation: false,
       contextIsolation: false,
       webviewTag: true,
       webviewTag: true,
       //   preload: path.join(__dirname, '../preload/index.js'),
       //   preload: path.join(__dirname, '../preload/index.js'),

+ 2 - 2
src/main/windows/updater.js

@@ -9,7 +9,7 @@ const loadURL = isdev
 const iconSrc = __static + "/images/icon.ico";
 const iconSrc = __static + "/images/icon.ico";
 // 服务器地址
 // 服务器地址
 const server = 'http://testadmin.xklr.net:8601'
 const server = 'http://testadmin.xklr.net:8601'
-const url = isdev ? __dirname : `${server}/appUpdateSign/`
+const url = isdev ? __dirname : `${server}/appUpdate/sign/`
 console.log(15, url)
 console.log(15, url)
 let updateWin = null;
 let updateWin = null;
 // 自动检测更新
 // 自动检测更新
@@ -61,7 +61,7 @@ export default function checkUpdate() {
             if (!option.url) {
             if (!option.url) {
                 updateWin.webContents.send('state1', 5)
                 updateWin.webContents.send('state1', 5)
             } else {
             } else {
-                autoUpdater.setFeedURL(option.url + '/appUpdateSign/')
+                autoUpdater.setFeedURL(option.url + '/appUpdate/sign/')
                 autoUpdater.checkForUpdates()
                 autoUpdater.checkForUpdates()
             }
             }
         })
         })

+ 3 - 3
src/renderer/pages/index/index.vue

@@ -108,7 +108,7 @@ export default {
       if (!hasid) {
       if (!hasid) {
         return false
         return false
       }
       }
-      console.log(process.env)
+      // console.log(process.env)
       if (1 || process.env.NODE_ENV == "development") {
       if (1 || process.env.NODE_ENV == "development") {
         this.dialogVisible = true
         this.dialogVisible = true
       } else {
       } else {
@@ -137,7 +137,7 @@ export default {
             t.cb(data.idCard, 0)
             t.cb(data.idCard, 0)
           },
           },
           error: (error) => {
           error: (error) => {
-            logfn( { type: 'error', row: 'index-143', msg: error })
+            logfn({ type: 'error', row: 'index-143', msg: error })
             t.setloadingState(false)
             t.setloadingState(false)
           },
           },
           t: this,
           t: this,
@@ -175,7 +175,7 @@ export default {
           if (res.code == 0) {
           if (res.code == 0) {
             t.setloadingState(false)
             t.setloadingState(false)
             t.cb(res.data.idNo, 1)
             t.cb(res.data.idNo, 1)
-          }else{
+          } else {
             t.setloadingState(false)
             t.setloadingState(false)
           }
           }
         }, () => {
         }, () => {

+ 11 - 10
src/renderer/pages/update/index.vue

@@ -1,9 +1,9 @@
 <template>
 <template>
-  <div class="fs-30 px-2 centerd">
-    <div class="mb-2">
+  <div class="fs-12 p-2">
+    <div>
       {{ stateData[state1].msg }}
       {{ stateData[state1].msg }}
     </div>
     </div>
-    <div class="mt-2 text-view1 pl-2" v-if="state1 == 3">
+    <div class="mt-1 text-view1 pl-2" v-if="state1 == 3">
       <el-progress :percentage="percent" class="w-100" color="#67c23a"></el-progress>
       <el-progress :percentage="percent" class="w-100" color="#67c23a"></el-progress>
     </div>
     </div>
   </div>
   </div>
@@ -17,12 +17,13 @@ export default {
   data() {
   data() {
     return {
     return {
       webURL: '',
       webURL: '',
-      stateData: [{ code: 0, msg: '正在查更新...' },
+      stateData: [{ code: 0, msg: '正在查更新...' },
       { code: 1, msg: '更新出错,请重启软件' },
       { code: 1, msg: '更新出错,请重启软件' },
       { code: 2, msg: '无更新可用' },
       { code: 2, msg: '无更新可用' },
       { code: 3, msg: '发现有新版本,正在下载' },
       { code: 3, msg: '发现有新版本,正在下载' },
       { code: 4, msg: '下载完成,重启更新' },
       { code: 4, msg: '下载完成,重启更新' },
-      { code: 5, msg: '未设置更新地址' }],
+      { code: 5, msg: '未设置更新地址' }
+      ],
       state1: 0,
       state1: 0,
       percent: 0,
       percent: 0,
     }
     }
@@ -33,28 +34,28 @@ export default {
     this.webURL = locationpath.webURL || '';
     this.webURL = locationpath.webURL || '';
     this.get1()
     this.get1()
     this.get2()
     this.get2()
-    this.sendurl()
+    this.sendurl(this.webURL)
     // console.log(this.$router)
     // console.log(this.$router)
   },
   },
   methods: {
   methods: {
     ...mapActions({
     ...mapActions({
       getlocationpath: 'user/getlocationpath',
       getlocationpath: 'user/getlocationpath',
     }),
     }),
-    sendurl(){
-      // console.log(111,this.webURL)
-      ipcRenderer.send('sendurl',{url:this.webURL})
+    sendurl(url){
+      ipcRenderer.send('sendurl',{url})
     },
     },
     get1() {
     get1() {
       let t = this
       let t = this
       ipcRenderer.on('state1', (event, data) => {
       ipcRenderer.on('state1', (event, data) => {
         t.state1 = data
         t.state1 = data
+        // console.log(59, data, t.state1)
       })
       })
     },
     },
     get2() {
     get2() {
       let t = this
       let t = this
       ipcRenderer.on('downloadProgress', (event, data) => {
       ipcRenderer.on('downloadProgress', (event, data) => {
         t.percent = (data.percent).toFixed(1);
         t.percent = (data.percent).toFixed(1);
-        // console.log(t.percent)
+        console.log(t.percent)
         if (data.percent >= 100) {
         if (data.percent >= 100) {
           t.state1 = 4;
           t.state1 = 4;
         }
         }