Browse Source

build: 增量更新版本判断

pull/192/head
xiaojunnuo 3 years ago
parent
commit
e55f67c78b
  1. 2
      packages/gui/build/installer.nsh
  2. 2
      packages/gui/package.json
  3. 10
      packages/gui/src/bridge/update/front.js
  4. 3
      packages/mitmproxy/test/sha256Test.js

2
packages/gui/build/installer.nsh

@ -1,4 +1,4 @@
!macro customUnInit
MessageBox MB_OK "卸载前请务必手动右下角小图标退出DevSidecar之后,再进行下一步(如果已经退出请忽略)↘↘↘↘↘↘↘↘↘"
MessageBox MB_OK "卸载前请务必手动退出DevSidecar之后,再进行下一步(如果已经退出请忽略)"
ExecWait '"$INSTDIR\resources\extra\sysproxy.exe" set 1'
!macroend

2
packages/gui/package.json

@ -1,6 +1,6 @@
{
"name": "@docmirror/dev-sidecar-gui",
"version": "1.7.2",
"version": "1.6.9",
"private": false,
"license": "MPL-2.0",
"main": "background.js",

10
packages/gui/src/bridge/update/front.js

@ -83,14 +83,14 @@ function install (app, api) {
* @param version2
*/
async function isSupportPartUpdate (value) {
const info = await api.info.get()
console.log('升级版本:', value.version)
console.log('增量更新最小版本:', value.partMiniVersion)
console.log('当前版本:', info.version)
if (!value.partPackage) {
return false
}
const info = await this.$api.info.get()
if (value.partMiniVersion && value.partMiniVersion < info.version) {
return true
}
return false
return !!(value.partMiniVersion && value.partMiniVersion < info.version)
}
async function downloadNewVersion (value) {

3
packages/mitmproxy/test/sha256Test.js

@ -2,6 +2,3 @@ const CryptoJs = require('crypto-js')
const ret = CryptoJs.SHA256('111111111111')
console.log(ret.toString(CryptoJs.enc.Base64))
console.log(1 / 2)
const version1 = '1.7.0'
console.log(version1.substring(0, version1.lastIndexOf('.')))

Loading…
Cancel
Save