wanglaoye 1 jaar geleden
bovenliggende
commit
21869590fd

+ 0 - 1
.prettierignore

@@ -1,7 +1,6 @@
 build
 coverage
 dist
-docs
 node_modules
 tests
 .idea

+ 14 - 0
log/2023-6-14.log

@@ -0,0 +1,14 @@
+[2023-06-14 17:04:32.434] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-06-14 17:05:06.373] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-06-14 17:05:19.079] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-06-14 17:06:27.614] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-06-14 17:09:25.618] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-06-14 17:42:01.751] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-06-14 17:42:46.815] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-06-14 17:42:56.147] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-06-14 17:44:15.768] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-06-14 17:44:15.776] [info]  49:D:\web\product\electron\doctor-electron\dist\electron
+[2023-06-14 17:44:23.403] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-06-14 17:44:23.411] [info]  49:D:\web\product\electron\doctor-electron\dist\electron
+[2023-06-14 17:44:29.631] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-06-14 17:44:29.641] [info]  updater-49:D:\web\product\electron\doctor-electron\dist\electron

+ 8 - 0
log/2023-6-15.log

@@ -0,0 +1,8 @@
+[2023-06-15 09:49:24.804] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-06-15 09:49:24.815] [info]  updater-49:D:\web\product\electron\doctor-electron\dist\electron
+[2023-06-15 09:56:50.100] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-06-15 09:56:50.109] [info]  updater-49:D:\web\product\electron\doctor-electron\dist\electron
+[2023-06-15 13:03:37.582] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-06-15 13:03:37.597] [info]  updater-49:D:\web\product\electron\doctor-electron\dist\electron
+[2023-06-15 13:04:20.534] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-06-15 13:04:20.543] [info]  updater-49:D:\web\product\electron\doctor-electron\dist\electron

+ 68 - 0
log/2023-6-19.log

@@ -0,0 +1,68 @@
+[2023-06-19 09:33:19.045] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-06-19 09:33:19.054] [info]  updater-49:D:\web\product\electron\doctor-electron\dist\electron
+[2023-06-19 13:28:04.981] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-06-19 13:28:04.989] [info]  updater-49:D:\web\product\electron\doctor-electron\dist\electron
+[2023-06-19 13:28:50.836] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-06-19 13:28:50.856] [info]  updater-49:D:\web\product\electron\doctor-electron\dist\electron
+[2023-06-19 13:29:12.725] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-06-19 13:29:12.749] [info]  updater-49:D:\web\product\electron\doctor-electron\dist\electron
+[2023-06-19 13:54:09.182] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-06-19 13:54:09.193] [info]  updater-49:TypeError [ERR_INVALID_URL]: Invalid URL: latest.yml
+[2023-06-19 13:58:22.477] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-06-19 13:58:22.478] [info]  44:undefined
+[2023-06-19 13:58:22.479] [info]  updater-49:TypeError [ERR_INVALID_URL]: Invalid URL: latest.yml
+[2023-06-19 13:58:22.480] [info]  updater-49:TypeError [ERR_INVALID_URL]: Invalid URL: latest.yml
+[2023-06-19 14:04:17.319] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-06-19 14:04:17.327] [info]  updater-49:TypeError [ERR_INVALID_URL]: Invalid URL: latest.yml
+[2023-06-19 14:05:02.885] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-06-19 14:05:02.886] [info]  44:undefined
+[2023-06-19 14:05:02.886] [info]  updater-49:TypeError [ERR_INVALID_URL]: Invalid URL: latest.yml
+[2023-06-19 14:05:02.887] [info]  updater-49:TypeError [ERR_INVALID_URL]: Invalid URL: latest.yml
+[2023-06-19 14:07:32.789] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-06-19 14:07:32.797] [info]  updater-49:TypeError [ERR_INVALID_URL]: Invalid URL: latest.yml
+[2023-06-19 14:08:45.527] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-06-19 14:08:45.534] [info]  updater-52:TypeError [ERR_INVALID_URL]: Invalid URL: latest.yml
+[2023-06-19 14:25:46.541] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-06-19 14:25:46.542] [info]  42:undefined
+[2023-06-19 14:25:46.543] [info]  updater-52:TypeError [ERR_INVALID_URL]: Invalid URL: latest.yml
+[2023-06-19 14:25:46.544] [info]  updater-52:TypeError [ERR_INVALID_URL]: Invalid URL: latest.yml
+[2023-06-19 14:33:16.013] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-06-19 14:33:16.022] [info]  updater-52:TypeError [ERR_INVALID_URL]: Invalid URL: latest.yml
+[2023-06-19 14:35:37.282] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-06-19 14:35:37.291] [info]  updater-52:TypeError [ERR_INVALID_URL]: Invalid URL: latest.yml
+[2023-06-19 14:36:03.272] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-06-19 14:36:03.280] [info]  updater-52:TypeError [ERR_INVALID_URL]: Invalid URL: latest.yml
+[2023-06-19 14:43:55.126] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-06-19 14:43:55.135] [info]  updater-52:TypeError [ERR_INVALID_URL]: Invalid URL: latest.yml
+[2023-06-19 14:44:19.229] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-06-19 14:44:19.238] [info]  updater-52:TypeError [ERR_INVALID_URL]: Invalid URL: latest.yml
+[2023-06-19 14:44:35.001] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-06-19 14:44:35.010] [info]  updater-52:TypeError [ERR_INVALID_URL]: Invalid URL: latest.yml
+[2023-06-19 14:45:04.512] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-06-19 14:45:04.522] [info]  updater-52:TypeError [ERR_INVALID_URL]: Invalid URL: latest.yml
+[2023-06-19 14:45:23.205] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-06-19 14:45:23.212] [info]  updater-52:TypeError [ERR_INVALID_URL]: Invalid URL: latest.yml
+[2023-06-19 14:46:54.503] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-06-19 14:46:54.512] [info]  updater-52:TypeError [ERR_INVALID_URL]: Invalid URL: latest.yml
+[2023-06-19 16:45:19.928] [info]  报错116:ReferenceError: ipcMain is not defined
+[2023-06-19 16:45:49.400] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-06-19 16:45:49.447] [info]  updater-118:TypeError [ERR_INVALID_URL]: Invalid URL: latest.yml
+[2023-06-19 16:46:17.350] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-06-19 16:48:07.903] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-06-19 16:49:27.288] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-06-19 16:50:50.465] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-06-19 16:51:11.996] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-06-19 16:53:30.554] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-06-19 16:53:37.519] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-06-19 16:54:24.295] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-06-19 16:55:33.644] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-06-19 16:55:44.695] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-06-19 16:56:04.377] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-06-19 16:56:12.805] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-06-19 16:58:25.528] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-06-19 16:59:45.203] [info]  76:undefined
+[2023-06-19 16:59:46.321] [info]  updater-118:Error: This file could not be downloaded, or the latest version (from update server) does not have a valid semver version: "undefined"
+[2023-06-19 17:00:53.863] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-06-19 17:02:15.277] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-06-19 17:03:42.589] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-06-19 17:05:02.124] [info]  38:D:\web\product\electron\doctor-electron\dist\electron

+ 1 - 0
log/2023-6-20.log

@@ -0,0 +1 @@
+[2023-06-20 09:42:48.659] [info]  38:D:\web\product\electron\doctor-electron\dist\electron

+ 4 - 0
log/2023-6-25.log

@@ -0,0 +1,4 @@
+[2023-06-25 09:19:21.055] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-06-25 09:20:00.792] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-06-25 09:20:01.839] [info]  76:undefined
+[2023-06-25 09:20:02.924] [info]  82:[object Object]

+ 13 - 0
log/2023-6-27.log

@@ -0,0 +1,13 @@
+[2023-06-27 10:40:30.898] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-06-27 10:40:31.900] [info]  76:undefined
+[2023-06-27 10:40:33.287] [info]  82:[object Object]
+[2023-06-27 10:42:04.103] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-06-27 10:42:05.302] [info]  76:undefined
+[2023-06-27 10:42:06.394] [info]  82:[object Object]
+[2023-06-27 11:25:58.017] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-06-27 11:25:59.556] [info]  76:undefined
+[2023-06-27 11:26:00.716] [info]  82:[object Object]
+[2023-06-27 11:26:51.959] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-06-27 11:26:52.976] [info]  76:undefined
+[2023-06-27 11:26:54.075] [info]  82:[object Object]
+[2023-06-27 11:48:56.272] [info]  38:D:\web\product\electron\doctor-electron\dist\electron

+ 192 - 0
npminstall-debug.log

@@ -0,0 +1,192 @@
+{
+  root: 'D:\\web\\product\\electron\\doctor-electron',
+  registry: 'https://registry.npmmirror.com',
+  pkgs: [],
+  production: false,
+  cacheStrict: false,
+  cacheDir: null,
+  env: {
+    npm_config_registry: 'https://registry.npmmirror.com',
+    npm_config_argv: '{"remain":[],"cooked":["--fix-bug-versions","--china","--userconfig=C:\\\\Users\\\\15432\\\\.cnpmrc","--disturl=https://npmmirror.com/mirrors/node","--registry=https://registry.npmmirror.com"],"original":["--fix-bug-versions","--china","--userconfig=C:\\\\Users\\\\15432\\\\.cnpmrc","--disturl=https://npmmirror.com/mirrors/node","--registry=https://registry.npmmirror.com"]}',
+    npm_config_user_agent: 'npminstall/7.5.2 npm/? node/v14.21.3 win32 ia32',
+    NODE: 'C:\\Program Files (x86)\\nodejs\\',
+    npm_node_execpath: 'C:\\Program Files (x86)\\nodejs\\',
+    npm_execpath: 'C:\\Users\\15432\\AppData\\Roaming\\npm\\node_modules\\cnpm\\node_modules\\npminstall\\bin\\install.js',
+    npm_config_userconfig: 'C:\\Users\\15432\\.cnpmrc',
+    npm_config_disturl: 'https://npmmirror.com/mirrors/node',
+    npm_config_r: 'https://registry.npmmirror.com',
+    COREPACK_NPM_REGISTRY: 'https://registry.npmmirror.com',
+    NODEJS_ORG_MIRROR: 'https://cdn.npmmirror.com/binaries/node',
+    NVM_NODEJS_ORG_MIRROR: 'https://cdn.npmmirror.com/binaries/node',
+    PHANTOMJS_CDNURL: 'https://cdn.npmmirror.com/binaries/phantomjs',
+    CHROMEDRIVER_CDNURL: 'https://cdn.npmmirror.com/binaries/chromedriver',
+    OPERADRIVER_CDNURL: 'https://cdn.npmmirror.com/binaries/operadriver',
+    CYPRESS_DOWNLOAD_PATH_TEMPLATE: 'https://cdn.npmmirror.com/binaries/cypress/${version}/${platform}-${arch}/cypress.zip',
+    ELECTRON_MIRROR: 'https://cdn.npmmirror.com/binaries/electron/',
+    ELECTRON_BUILDER_BINARIES_MIRROR: 'https://cdn.npmmirror.com/binaries/electron-builder-binaries/',
+    SASS_BINARY_SITE: 'https://cdn.npmmirror.com/binaries/node-sass',
+    SWC_BINARY_SITE: 'https://cdn.npmmirror.com/binaries/node-swc',
+    NWJS_URLBASE: 'https://cdn.npmmirror.com/binaries/nwjs/v',
+    PUPPETEER_DOWNLOAD_HOST: 'https://cdn.npmmirror.com/binaries/chrome-for-testing',
+    PUPPETEER_DOWNLOAD_BASE_URL: 'https://cdn.npmmirror.com/binaries/chrome-for-testing',
+    PLAYWRIGHT_DOWNLOAD_HOST: 'https://cdn.npmmirror.com/binaries/playwright',
+    SENTRYCLI_CDNURL: 'https://cdn.npmmirror.com/binaries/sentry-cli',
+    SAUCECTL_INSTALL_BINARY_MIRROR: 'https://cdn.npmmirror.com/binaries/saucectl',
+    RE2_DOWNLOAD_MIRROR: 'https://cdn.npmmirror.com/binaries/node-re2',
+    RE2_DOWNLOAD_SKIP_PATH: 'true',
+    PRISMA_ENGINES_MIRROR: 'https://cdn.npmmirror.com/binaries/prisma',
+    npm_config_better_sqlite3_binary_host: 'https://cdn.npmmirror.com/binaries/better-sqlite3',
+    npm_config_keytar_binary_host: 'https://cdn.npmmirror.com/binaries/keytar',
+    npm_config_sharp_binary_host: 'https://cdn.npmmirror.com/binaries/sharp',
+    npm_config_sharp_libvips_binary_host: 'https://cdn.npmmirror.com/binaries/sharp-libvips',
+    npm_config_robotjs_binary_host: 'https://cdn.npmmirror.com/binaries/robotjs',
+    npm_rootpath: 'D:\\web\\product\\electron\\doctor-electron',
+    INIT_CWD: 'D:\\web\\product\\electron\\doctor-electron',
+    npm_config_cache: 'C:\\Users\\15432\\.npminstall_tarball'
+  },
+  binaryMirrors: {
+    ENVS: {
+      COREPACK_NPM_REGISTRY: 'https://registry.npmmirror.com',
+      NODEJS_ORG_MIRROR: 'https://cdn.npmmirror.com/binaries/node',
+      NVM_NODEJS_ORG_MIRROR: 'https://cdn.npmmirror.com/binaries/node',
+      PHANTOMJS_CDNURL: 'https://cdn.npmmirror.com/binaries/phantomjs',
+      CHROMEDRIVER_CDNURL: 'https://cdn.npmmirror.com/binaries/chromedriver',
+      OPERADRIVER_CDNURL: 'https://cdn.npmmirror.com/binaries/operadriver',
+      CYPRESS_DOWNLOAD_PATH_TEMPLATE: 'https://cdn.npmmirror.com/binaries/cypress/${version}/${platform}-${arch}/cypress.zip',
+      ELECTRON_MIRROR: 'https://cdn.npmmirror.com/binaries/electron/',
+      ELECTRON_BUILDER_BINARIES_MIRROR: 'https://cdn.npmmirror.com/binaries/electron-builder-binaries/',
+      SASS_BINARY_SITE: 'https://cdn.npmmirror.com/binaries/node-sass',
+      SWC_BINARY_SITE: 'https://cdn.npmmirror.com/binaries/node-swc',
+      NWJS_URLBASE: 'https://cdn.npmmirror.com/binaries/nwjs/v',
+      PUPPETEER_DOWNLOAD_HOST: 'https://cdn.npmmirror.com/binaries/chrome-for-testing',
+      PUPPETEER_DOWNLOAD_BASE_URL: 'https://cdn.npmmirror.com/binaries/chrome-for-testing',
+      PLAYWRIGHT_DOWNLOAD_HOST: 'https://cdn.npmmirror.com/binaries/playwright',
+      SENTRYCLI_CDNURL: 'https://cdn.npmmirror.com/binaries/sentry-cli',
+      SAUCECTL_INSTALL_BINARY_MIRROR: 'https://cdn.npmmirror.com/binaries/saucectl',
+      RE2_DOWNLOAD_MIRROR: 'https://cdn.npmmirror.com/binaries/node-re2',
+      RE2_DOWNLOAD_SKIP_PATH: 'true',
+      PRISMA_ENGINES_MIRROR: 'https://cdn.npmmirror.com/binaries/prisma',
+      npm_config_better_sqlite3_binary_host: 'https://cdn.npmmirror.com/binaries/better-sqlite3',
+      npm_config_keytar_binary_host: 'https://cdn.npmmirror.com/binaries/keytar',
+      npm_config_sharp_binary_host: 'https://cdn.npmmirror.com/binaries/sharp',
+      npm_config_sharp_libvips_binary_host: 'https://cdn.npmmirror.com/binaries/sharp-libvips',
+      npm_config_robotjs_binary_host: 'https://cdn.npmmirror.com/binaries/robotjs'
+    },
+    '@ali/s2': { host: 'https://cdn.npmmirror.com/binaries/looksgood-s2' },
+    sharp: { replaceHostFiles: [Array], replaceHostMap: [Object] },
+    '@tensorflow/tfjs-node': {
+      replaceHostFiles: [Array],
+      replaceHostRegExpMap: [Object],
+      replaceHostMap: [Object]
+    },
+    cypress: {
+      host: 'https://cdn.npmmirror.com/binaries/cypress',
+      newPlatforms: [Object]
+    },
+    'utf-8-validate': {
+      host: 'https://cdn.npmmirror.com/binaries/utf-8-validate/v{version}'
+    },
+    xprofiler: {
+      remote_path: './xprofiler/v{version}/',
+      host: 'https://cdn.npmmirror.com/binaries'
+    },
+    leveldown: { host: 'https://cdn.npmmirror.com/binaries/leveldown/v{version}' },
+    couchbase: { host: 'https://cdn.npmmirror.com/binaries/couchbase/v{version}' },
+    gl: { host: 'https://cdn.npmmirror.com/binaries/gl/v{version}' },
+    sqlite3: {
+      host: 'https://cdn.npmmirror.com/binaries/sqlite3',
+      remote_path: 'v{version}'
+    },
+    '@journeyapps/sqlcipher': { host: 'https://cdn.npmmirror.com/binaries' },
+    grpc: {
+      host: 'https://cdn.npmmirror.com/binaries',
+      remote_path: '{name}/v{version}'
+    },
+    'grpc-tools': { host: 'https://cdn.npmmirror.com/binaries' },
+    wrtc: {
+      host: 'https://cdn.npmmirror.com/binaries',
+      remote_path: '{name}/v{version}'
+    },
+    fsevents: { host: 'https://cdn.npmmirror.com/binaries/fsevents' },
+    nodejieba: { host: 'https://cdn.npmmirror.com/binaries/nodejieba' },
+    canvas: { host: 'https://cdn.npmmirror.com/binaries/canvas' },
+    'skia-canvas': { host: 'https://cdn.npmmirror.com/binaries/skia-canvas' },
+    'flow-bin': {
+      replaceHost: 'https://github.com/facebook/flow/releases/download/v',
+      host: 'https://cdn.npmmirror.com/binaries/flow/v'
+    },
+    'jpegtran-bin': {
+      replaceHost: [Array],
+      host: 'https://cdn.npmmirror.com/binaries/jpegtran-bin'
+    },
+    'cwebp-bin': {
+      replaceHost: [Array],
+      host: 'https://cdn.npmmirror.com/binaries/cwebp-bin'
+    },
+    'zopflipng-bin': {
+      replaceHost: [Array],
+      host: 'https://cdn.npmmirror.com/binaries/zopflipng-bin'
+    },
+    'optipng-bin': {
+      replaceHost: [Array],
+      host: 'https://cdn.npmmirror.com/binaries/optipng-bin'
+    },
+    mozjpeg: {
+      replaceHost: [Array],
+      host: 'https://cdn.npmmirror.com/binaries/mozjpeg-bin'
+    },
+    gifsicle: {
+      replaceHost: [Array],
+      host: 'https://cdn.npmmirror.com/binaries/gifsicle-bin'
+    },
+    'pngquant-bin': {
+      replaceHost: [Array],
+      host: 'https://cdn.npmmirror.com/binaries/pngquant-bin',
+      replaceHostMap: [Object]
+    },
+    'pngcrush-bin': {
+      replaceHost: [Array],
+      host: 'https://cdn.npmmirror.com/binaries/pngcrush-bin'
+    },
+    'jpeg-recompress-bin': {
+      replaceHost: [Array],
+      host: 'https://cdn.npmmirror.com/binaries/jpeg-recompress-bin'
+    },
+    'advpng-bin': {
+      replaceHost: [Array],
+      host: 'https://cdn.npmmirror.com/binaries/advpng-bin'
+    },
+    'pngout-bin': {
+      replaceHost: [Array],
+      host: 'https://cdn.npmmirror.com/binaries/pngout-bin'
+    },
+    'jpegoptim-bin': {
+      replaceHost: [Array],
+      host: 'https://cdn.npmmirror.com/binaries/jpegoptim-bin'
+    },
+    argon2: { host: 'https://cdn.npmmirror.com/binaries/argon2' },
+    'ali-zeromq': { host: 'https://cdn.npmmirror.com/binaries/ali-zeromq' },
+    'ali-usb_ctl': { host: 'https://cdn.npmmirror.com/binaries/ali-usb_ctl' },
+    'gdal-async': { host: 'https://cdn.npmmirror.com/binaries/node-gdal-async' }
+  },
+  forbiddenLicenses: null,
+  flatten: false,
+  proxy: undefined,
+  prune: false,
+  disableFallbackStore: false,
+  workspacesMap: Map(0) {},
+  enableWorkspace: false,
+  workspaceRoot: 'D:\\web\\product\\electron\\doctor-electron',
+  isWorkspaceRoot: true,
+  isWorkspacePackage: false,
+  strictSSL: true,
+  ignoreScripts: false,
+  ignoreOptionalDependencies: false,
+  detail: false,
+  forceLinkLatest: false,
+  trace: false,
+  engineStrict: false,
+  registryOnly: false,
+  client: false,
+  autoFixVersion: [Function: autoFixVersion]
+}

+ 7 - 3
package.json

@@ -1,7 +1,8 @@
 {
   "name": "xklr",
-  "version": "1.0.1",
+  "version": "1.1.0",
   "private": false,
+  "author": "wly",
   "scripts": {
     "start": "vue-cli-service electron:serve",
     "test:unit": "vue-cli-service test:unit",
@@ -20,16 +21,20 @@
     "prettier": "npx prettier --write ./src ./test",
     "doc": "docsify serve docs"
   },
-  "appId": "xklr",
+  "appId": "xklr.net",
   "main": "background.js",
   "dependencies": {
     "@vue/reactivity": "^3.2.47",
+    "Squirrel": "^0.0.1",
     "axios": "^1.4.0",
     "core-js": "^3.6.5",
     "deepmerge": "^4.2.2",
     "draggabilly": "^2.3.0",
     "echarts": "^5.4.2",
+    "electron": "^12.2.3",
     "electron-dl": "^3.2.0",
+    "electron-log": "^4.4.8",
+    "electron-updater": "^4.3.9",
     "element-ui": "^2.15.13",
     "js-cookie": "^3.0.5",
     "lodash": "^4.17.21",
@@ -69,7 +74,6 @@
     "commitizen": "^4.0.3",
     "commitlint": "^8.2.0",
     "conventional-changelog-cli": "^2.0.28",
-    "electron": "^12.0.0",
     "electron-devtools-installer": "^3.1.0",
     "eslint": "^6.7.2",
     "eslint-plugin-prettier": "^3.3.1",

+ 36 - 0
src/main/log.js

@@ -0,0 +1,36 @@
+import logger from 'electron-log'
+import {app} from 'electron'
+const isdev = process.env.NODE_ENV == "development"
+logger.transports.file.level = 'debug'
+logger.transports.file.maxSize = 1002430 // 最大不超过10M
+logger.transports.file.format = '[{y}-{m}-{d} {h}:{i}:{s}.{ms}] [{level}]{scope} {text}' // 设置文件内容格式
+let date = new Date()
+date = date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate()
+logger.transports.file.fileName = date + '.log' // 创建文件名格式为 '时间.log' (2023-02-01.log)
+ 
+ // 可以将文件放置到指定文件夹中,例如放到安装包文件夹中
+ const path = require('path')
+ const exePath = path.dirname(app.getPath('exe')) // 获取到安装目录的文件夹名称
+ // 指定日志文件夹位置
+ logger.transports.file.resolvePath = ()=> isdev? 'log\\'+date+'.log':exePath+'\\'+'log\\'+date+'.log'
+// 有六个日志级别error, warn, info, verbose, debug, silly。默认是silly
+export default {
+  info (param) {
+    logger.info(param)
+  },                   
+  warn (param) {
+    logger.warn(param)
+  },
+  error (param) {
+    logger.error(param)
+  },
+  debug (param) {
+    logger.debug(param) 
+  },
+  verbose (param) {
+    logger.verbose(param)
+  },
+  silly (param) {
+    logger.silly(param)
+  }
+}

+ 38 - 28
src/main/main.js

@@ -1,13 +1,14 @@
 import { app, shell, BrowserWindow, protocol, globalShortcut, ipcMain } from 'electron'
 import path from 'path'
 // import createBallWindow from './windows/createballwindow'
-import tray from './tray'
+import tray from './windows/tray'
 import appEvent from './appEvent'
-import mainWinEvent from './mainWinEvent'
+import mainWinEvent from './mainWin'
 import { LOAD_URL, ACHEME } from './config'
 import createSettingWindow from './windows/settingwin'
 import { createProtocol } from "vue-cli-plugin-electron-builder/lib";
-const isDevelopment = process.env.NODE_ENV == "development"
+import checkUpdate from './windows/updater'
+const isdev = process.env.NODE_ENV == "development"
 protocol.registerSchemesAsPrivileged([
   {
     scheme: "app",
@@ -17,7 +18,7 @@ protocol.registerSchemesAsPrivileged([
     },
   },
 ]);
-if (!isDevelopment) {
+if (!isdev) {
   global.__img = path.join(__dirname, "./img");
   global.__images = path.join(__dirname, "./images");
 }
@@ -43,13 +44,17 @@ async function createWindow() {
       // partition: String(+new Date()),
       nodeIntegration: true,
       enableRemoteModule: true,
-      devTools: isDevelopment,
+      devTools: isdev,
       contextIsolation: false,
       //   preload: path.join(__dirname, '../preload/index.js'),
       sandbox: false
     }
   })
-
+  //禁止程序多开,此处需要单例锁的打开注释即可
+  const gotTheLock = app.requestSingleInstanceLock();
+  if (!gotTheLock) {
+    app.quit();
+  }
   mainWindow.on('ready-to-show', () => {
     mainWindow.show()
   })
@@ -63,38 +68,42 @@ async function createWindow() {
     if (!process.env.IS_TEST) mainWindow.webContents.openDevTools();
   } else {
     createProtocol(ACHEME);
-    // mainWindow.webContents.openDevTools();
-    // Load the index.html when not in development
     mainWindow.loadURL(LOAD_URL + '/#/home');
     // mainWindow.loadURL(`file://${__dirname}/app/index.html`);
 
   }
   mainWinEvent(mainWindow)
+  checkUpdate()
 }
 // This method will be called when Electron has finished
 // initialization and is ready to create browser windows.
 // Some APIs can only be used after this event occurs.
 
 app.whenReady().then(async () => {
-  if (isDevelopment && !process.env.IS_TEST) {
-    // Install Vue Devtools
-    // try {
-    //   const extensions = await session.defaultSession.getAllExtensions();
-    //   if (!extensions.includes("Vue.js devtools")) {
-    //     const appData = app.getPath("appData");
-    //     const res = await session.defaultSession.loadExtension(
-    //       // 根据本机实际情况修改
-    //       path.resolve(
-    //         appData,
-    //         "Google/Chrome/Default/Extensions/nhdogjmejiglipccpnnnanhbledajbpd/5.3.4_0"
-    //       )
-    //     );
-    //     console.log(`${res.name}安装成功`);
-    //   }
-    // } catch (e) {
-    //   console.error("Vue Devtools failed to install:", e.toString());
-    // }
-  }
+  // if (isdev && !process.env.IS_TEST) {
+  // Install Vue Devtools
+  // try {
+  //   const extensions = await session.defaultSession.getAllExtensions();
+  //   if (!extensions.includes("Vue.js devtools")) {
+  //     const appData = app.getPath("appData");
+  //     const res = await session.defaultSession.loadExtension(
+  //       // 根据本机实际情况修改
+  //       path.resolve(
+  //         appData,
+  //         "Google/Chrome/Default/Extensions/nhdogjmejiglipccpnnnanhbledajbpd/5.3.4_0"
+  //       )
+  //     );
+  //     console.log(`${res.name}安装成功`);
+  //   }
+  // } catch (e) {
+  //   console.error("Vue Devtools failed to install:", e.toString());
+  // }
+  // }
+  //禁止程序多开,此处需要单例锁的打开注释即可
+  // const gotTheLock = app.requestSingleInstanceLock();
+  // if (!gotTheLock) {
+  //   app.quit();
+  // }
   // Set app user model id for windows
   app.setAppUserModelId('com.electron')
   // Default open or close DevTools by F12 in development
@@ -139,5 +148,6 @@ app.whenReady().then(async () => {
   tray({ type: 'new' });
   //app
   appEvent();
-
+  //检测更新
+  // checkUpdate()
 })

+ 4 - 1
src/main/mainWinEvent.js

@@ -1,15 +1,17 @@
 import { shell,screen, ipcMain } from 'electron'
-import tray from './tray'
+import tray from './windows/tray'
 export default function mainWinEvent(mw) {
 
   //设置悬浮球位置
   const { left, top } = { left: screen.getPrimaryDisplay().workAreaSize.width - 400, top: 160 }
   mw.setPosition(left, top)
+  
   //改变窗口大小
   ipcMain.handle('setsize', async (event, option) => {  //大小
     mw.setMaximumSize(option.width, option.height);
     mw.setMinimumSize(option.width, option.height);
     mw.setSize(option.width, option.height, true)
+    mw.webContents.send("getsize",option.height);
     return true
   })
   //移动窗口
@@ -21,6 +23,7 @@ export default function mainWinEvent(mw) {
     console.log(option)
     shell.openExternal(option);
   })
+
   //改变任务托盘按钮
   ipcMain.on('setTray', (e, option) => {
     let menu = []

+ 11 - 11
src/main/windows/settingwin.js

@@ -1,13 +1,13 @@
 import { LOAD_URL } from "./../config";
-import { app,Menu,ipcMain } from 'electron'
+import { app, Menu, ipcMain } from 'electron'
 
-const isDevelopment = process.env.NODE_ENV == "development"
-const loadURL =isDevelopment
-        ? `${process.env.WEBPACK_DEV_SERVER_URL}#/settingwin`
-        : `${LOAD_URL}#settingwin`;
+const isdev = process.env.NODE_ENV == "development"
+const loadURL = isdev
+    ? `${process.env.WEBPACK_DEV_SERVER_URL}#/settingwin`
+    : `${LOAD_URL}#settingwin`;
 
 const iconSrc = __static + "/images/icon.ico";
-        // console.log(loadURL)
+// console.log(loadURL)
 let settingWindow = null;
 const createSettingWindow = function (BrowserWindow) {
     if (settingWindow !== null) {
@@ -29,12 +29,12 @@ const createSettingWindow = function (BrowserWindow) {
         closable: true,
         autoHideMenuBar: true,
         enableLargerThanScreen: false,
-        resizable: isDevelopment,
+        resizable: isdev,
         // transparent: process.platform !== "linux",
         hasShadow: process.platform !== "darwin",
         alwaysOnTop: true,
         webPreferences: {
-            devTools: isDevelopment,
+            devTools: isdev,
             contextIsolation: false,
             sandbox: false,
             nodeIntegration: true,
@@ -45,13 +45,13 @@ const createSettingWindow = function (BrowserWindow) {
     Menu.setApplicationMenu(null)
     settingWindow.loadURL(loadURL);
     if (process.env.WEBPACK_DEV_SERVER_URL) {
-    settingWindow.webContents.openDevTools();
-    } 
+        settingWindow.webContents.openDevTools();
+    }
     settingWindow.on("close", () => {
         settingWindow = null;
     });
     ipcMain.on("window-reset", () => {
-        if(!isDevelopment){
+        if (!isdev) {
             app.relaunch()
             app.exit()
         }

+ 4 - 3
src/main/tray.js

@@ -1,6 +1,6 @@
 import { app, Menu, Tray, BrowserWindow } from 'electron'
-import createSettingWindow from './windows/settingwin'
-
+import createSettingWindow from './settingwin'
+import checkUpdate from './updater'
 const iconSrc = __static + "/images/icon.ico";
 let ntray = null
 export default async function tray({ type, menu }) {
@@ -16,6 +16,7 @@ export default async function tray({ type, menu }) {
       label: '检查更新',
       click: function () {
         console.log('更新')
+        checkUpdate()
       }
     },
     {
@@ -28,8 +29,8 @@ export default async function tray({ type, menu }) {
     {
       label: '退出',
       click: function () {
+        app.quit();
         if (process.platform !== 'darwin') {
-          app.quit();
           ntray.destroy()
         }
       }

+ 139 - 0
src/main/windows/updater.js

@@ -0,0 +1,139 @@
+
+import { LOAD_URL } from "./../config";
+import { app, ipcMain, BrowserWindow } from 'electron'
+import { autoUpdater } from 'electron-updater'
+import logger from '../log.js'
+const isdev = process.env.NODE_ENV == "development"
+const loadURL = isdev
+    ? `${process.env.WEBPACK_DEV_SERVER_URL}#/update`
+    : `${LOAD_URL}#update`;
+
+const iconSrc = __static + "/images/icon.ico";
+// 服务器地址
+const server = 'http://testadmin.xklr.net:8601'
+const url = isdev ? __dirname : `${server}/appupdatedoc/`
+console.log(15, url)
+let updateWin = null;
+// 自动检测更新
+export default function checkUpdate() {
+    try {
+        if (updateWin !== null) {
+            return false
+        }
+        // 创建更新窗口
+        async function createWindow() {
+            updateWin = new BrowserWindow({
+                title: '星空路人-更新',
+                icon: iconSrc,
+                height: 80,
+                width: 250,
+                show: true,
+                titleBarStyle: "hiddenInset",
+                frame: true,
+                fullscreenable: false,
+                minimizable: false,
+                maximizable: false,
+                transparent: false,
+                skipTaskbar: false, // 任务栏中不显示窗口
+                autoHideMenuBar: true,
+                enableLargerThanScreen: false,
+                resizable: isdev,
+                closable: true,
+                hasShadow: process.platform !== "darwin",
+                alwaysOnTop: true,
+                webPreferences: {
+                    devTools: isdev,
+                    contextIsolation: false,
+                    sandbox: false,
+                    nodeIntegration: true,
+                    enableRemoteModule: true,
+                }
+            })
+            updateWin.loadURL(loadURL);
+            if (process.env.WEBPACK_DEV_SERVER_URL) {
+                updateWin.webContents.openDevTools();
+            }
+        }
+
+        createWindow();
+        autoUpdater.autoDownload = true
+        ipcMain.on('sendurl', (e, option) => {
+            console.log(1, option)
+            if (!option.url) {
+                updateWin.webContents.send('state1', 5)
+            } else {
+                autoUpdater.setFeedURL(option.url + '/appupdatedoc/')
+                autoUpdater.checkForUpdates()
+            }
+        })
+        //默认会自动下载新版本,如果不想自动下载,设置autoUpdater.autoDownload = false
+
+        // if (process.platform == 'darwin') {
+        //     // 安装包放在了服务端`darwin`目录下
+        //     autoUpdater.setFeedURL(url)
+        //     // autoUpdater.setFeedURL('http://testadmin.xklr.net:8601/app')  //设置要检测更新的路径
+        // } else {
+        //     // 同理
+        //     autoUpdater.setFeedURL(url)
+        // }
+        // 检测是否有新版本
+        logger.info('38:' + url)
+        // !isdev ? autoUpdater.checkForUpdates() : ''
+        // autoUpdater.checkForUpdates()
+        autoUpdater.on('checking-for-update', res => {
+            console.log("获取版本信息:" + res)
+            logger.info('76:' + res)
+            updateWin.webContents.send('state1', 0)
+        })
+
+        autoUpdater.on('update-not-available', res => {
+            console.log("没有可更新版本:" + res)
+            logger.info('82:' + res)
+            updateWin.hide()
+            updateWin.webContents.send('state1', 2)
+        })
+
+        //监听'update-available'事件,发现有新版本时触发
+        autoUpdater.on('update-available', (res) => {
+            logger.info('89:' + res)
+            //自动下载
+            // autoUpdater.downloadUpdate()
+            updateWin.webContents.send('state1', 3)
+        })
+
+        // 下载进度
+        autoUpdater.on('download-progress', res => {
+            logger.info("下载监听:" + res)
+            updateWin.webContents.send('downloadProgress', res)
+        })
+
+        //监听'update-downloaded'事件,新版本下载完成时触发
+        autoUpdater.on('update-downloaded', () => {
+            updateWin.webContents.send('state1', 4)
+            updateWin.hide()
+            autoUpdater.quitAndInstall()
+            app.quit()
+
+            // dialog.showMessageBox({
+            //     type: 'info',
+            //     title: '应用更新',
+            //     message: '发现新版本,是否更新?',
+            //     buttons: ['是', '否']
+            // }).then((buttonIndex) => {
+            //     if (buttonIndex.response == 0) {  //选择是,则退出程序,安装新版本
+            //         autoUpdater.quitAndInstall()
+            //         app.quit()
+            //     }
+            // })
+        })
+
+        // 监听'error'事件
+        autoUpdater.on('error', (err) => {
+            logger.info('updater-118:' + err)
+            updateWin.webContents.send('state1', 1)
+        })
+
+    } catch (error) {
+        logger.info("报错116:" + error)
+    }
+}

+ 1 - 1
src/renderer/App.vue

@@ -85,7 +85,7 @@ body {
 }
 
 .pagecontent {
-  height: 385px;
+  height: 410px;
   width: 300px;
   background: #fff;
   border-radius: 6px;

+ 2 - 1
src/renderer/api/patient.js

@@ -18,7 +18,8 @@ export default {
   find_visit_sum(data){
     return instance({
       url: '/patient/find_visit_sum',
-      method: 'post'
+      method: 'post',
+      isDataAll:true
     })
   },
   //居家检测

+ 7 - 7
src/renderer/api/request.js

@@ -58,7 +58,7 @@ const handleData = async ({ config, data, status, statusText }) => {
           message: data[conf.messageName],
           type: 'warning',
           offset: 25,
-          center:true
+          center: true
         })
       return data
     case 401:
@@ -88,7 +88,7 @@ const handleData = async ({ config, data, status, statusText }) => {
     message: errMsg,
     type: code === -2 ? 'warning' : 'error',
     offset: 25,
-    center:true
+    center: true
   })
   // console.log(data)
   return Promise.reject(data)
@@ -127,7 +127,7 @@ instance.interceptors.request.use(
     })
     // console.log(store.getters['user/locationpath'].baseURL||localStorage.getItem('locationpath')&&JSON.parse(localStorage.getItem('locationpath')).baseURL)
     if (store.getters['user/locationpath'].baseURL || localStorage.getItem('locationpath') && JSON.parse(localStorage.getItem('locationpath')).baseURL) {
-      config.url = (store.getters['user/locationpath'].baseURL || localStorage.getItem('locationpath') && JSON.parse(localStorage.getItem('locationpath')).baseURL) + config.url
+      config.url = (store.getters['user/locationpath'].baseURL || localStorage.getItem('locationpath') && JSON.parse(localStorage.getItem('locationpath')).baseURL) + '/api' + config.url
     } else {
       cancel()
     }
@@ -151,8 +151,8 @@ instance.interceptors.request.use(
       config.headers['Content-Type'] === 'application/x-www-form-urlencoded;charset=UTF-8'
     )
       config.data = qs.stringify(config.data)
-      // *****待解决
-      console.log(conf.debounce.some((item) => config.url.includes(item)))
+    // *****待解决
+    // console.log(conf.debounce.some((item) => config.url.includes(item)))
     // if (debounce.some((item) => config.url.includes(item)))
     // loadingInstance = Vue.prototype.$baseLoading()
     isAction = config.isAction
@@ -202,12 +202,12 @@ instance.interceptors.response.use(
       }
       return Promise.reject({ code: -1 })
     } else {
-      if(response.status==500){
+      if (response.status == 500) {
         Message({
           message: '接口错误',
           type: 'error',
           offset: 25,
-          center:true
+          center: true
         })
         return false
       }

+ 6 - 2
src/renderer/components/ball/index.vue

@@ -61,7 +61,7 @@ import { ipcRenderer } from "electron";
 export default {
   name: "Ball",
   data() {
-    let getMathRandom  =this.getMathRandom;
+    let getMathRandom = this.getMathRandom;
     // console.log(getMathRandom)
     let aminstyle = new Array(10).fill('').map(() => {
       return {
@@ -99,10 +99,13 @@ export default {
       return num
     },
     showblock1() {
+      if (this.isDown) {
+        return
+      }
       let t = this
       t.showblock = !t.showblock
       if (t.showblock) {
-        t.setwindowsize(310, 470).then((res) => {
+        t.setwindowsize(310, 500).then((res) => {
           if (res) {
             if (window.location.hash == '#/home') {
               t.$router.push('/home/login')
@@ -127,6 +130,7 @@ export default {
         t.isDown = true
         t.baseX = e.x
         t.baseY = e.y
+        this.setwindowsize(132, 80)
         if (e.pageX < 115 && e.pageY < 70) t.class1 = 'opacity7'
       })
       doc.addEventListener('mousemove', function (e) {

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

@@ -1,22 +1,34 @@
 <template>
   <div class="">
     <Ball />
-    <div style="margin-top:5px">
+    <div style="margin-top:5px" v-if="height > 80">
       <router-view />
     </div>
   </div>
 </template>
 
 <script>
+import { ipcRenderer } from 'electron'
 import Ball from '../../components/ball/index.vue'
 export default {
   name: 'Home',
   components: { Ball },
   data() {
-    return {}
+    return {
+      height: 133
+    }
+  },
+  created() {
+    this.getsize()
   },
   methods: {
-
+    getsize() {
+      let t = this
+      ipcRenderer.on("getsize", (event, message) => {
+        t.height = message
+        // console.log("是否监听到", event, message);
+      });
+    }
   }
 }
 </script>

+ 20 - 8
src/renderer/pages/login/index.vue

@@ -49,10 +49,16 @@ export default {
       if (!isPassword(value)) callback(new Error('密码不能少于6位'))
       else callback()
     }
+    let formInline = process.env.NODE_ENV == "development" ? {
+      username: '18812312312', password: 'cxsrmyyyljkjtfhfy@202098'
+    } : {
+      username: localStorage.getItem('useraccount') || '',
+      password: localStorage.getItem('password') || '',
+    }
     return {
-      formInline:process.env.NODE_ENV == "development" ? {
-        username: '18812312312', password: 'cxsrmyyyljkjtfhfy@202098'
-      }:{}, logo, rules: {
+      formInline,
+      logo,
+      rules: {
         username: [
           {
             required: true,
@@ -98,6 +104,8 @@ export default {
           try {
             await t.login(t.formInline).then((res) => {
               localStorage.setItem('username', t.formInline.username)
+              localStorage.setItem('password', t.formInline.password)
+              localStorage.setItem('useraccount', t.formInline.username)
               // ipcRenderer.send('setTray', { type: 'login' })
               try {
                 Promise.all([
@@ -106,9 +114,14 @@ export default {
                   t.findVisitSum()
                 ]).then((resall) => {
                   console.log(resall)
-                  setInterval(() => {
-                    t.findVisitSum()
-                  }, 1000 * 60)
+                 let timer = setInterval(() => {
+                    t.findVisitSum().then((res)=>{
+                      // console.log(119,res)
+                      if(res.code==401){
+                        clearInterval(timer)
+                      }
+                    })
+                  },  process.env.NODE_ENV == "development"?1000 * 10:1000 * 60)
                   t.$router.push('patientlist')
                   ipcRenderer.send('setTray', { type: 'user', data: resall[0] });
                 })
@@ -116,7 +129,7 @@ export default {
                 t.loading = false
               }
             }).catch((e) => {
-              console.log(e)
+              console.log(127,e)
             })
           } finally {
             this.loading = false
@@ -127,7 +140,6 @@ export default {
 }
 </script>
 <style lang="less" scoped>
-
 .content {
   margin: 5px;
   height: calc(100vh -8px);

+ 9 - 2
src/renderer/pages/patientdetail/model/view.vue

@@ -321,11 +321,18 @@
                 <div class="fs-12 text-dark w-80 pl-1">
                   <div>
                     (左眼) <span v-if="propData.eye.eyeData.leftMaculaLutea">{{ propData.eye.eyeData.leftMaculaLutea
-                    }}、</span>{{ JSON.parse(propData.eye.eyeData.leftPathology).join('、') }};
+                    }}、</span> <span v-if="propData.eye.eyeData.leftPathology">{{ JSON.parse(propData.eye.eyeData.leftPathology).join('、') }};</span>
+                    <span v-if="propData.eye.eyeData.isRead==0">
+                        未阅片
+                    </span>
                   </div>
                   <div>
                     (右眼) <span v-if="propData.eye.eyeData.rightMaculaLutea">{{ propData.eye.eyeData.rightMaculaLutea
-                    }}、</span>{{ JSON.parse(propData.eye.eyeData.rightPathology).join('、') }};
+                    }}、</span>
+                    <span v-if="propData.eye.eyeData.rightPathology">{{ JSON.parse(propData.eye.eyeData.rightPathology).join('、') }};</span>
+                     <span v-if="propData.eye.eyeData.isRead==0">
+                        未阅片
+                    </span>
                   </div>
                 </div>
               </div>

+ 75 - 0
src/renderer/pages/update/index.vue

@@ -0,0 +1,75 @@
+<template>
+  <div class="fs-12 p-2">
+    <div>
+      {{ stateData[state1].msg }}
+    </div>
+    <div class="mt-1 text-view1 pl-2" v-if="state1 == 3">
+      <el-progress :percentage="percent" class="w-100" color="#67c23a"></el-progress>
+    </div>
+  </div>
+</template>
+
+<script>
+import { mapActions } from 'vuex'
+import { ipcRenderer } from 'electron'
+export default {
+  name: 'Settingwin',
+  data() {
+    return {
+      webURL: '',
+      stateData: [{ code: 0, msg: '正在查询更新...' },
+      { code: 1, msg: '更新出错,请重启软件' },
+      { code: 2, msg: '无更新可用' },
+      { code: 3, msg: '发现有新版本,正在下载' },
+      { code: 4, msg: '下载完成,重启更新' },
+      { code: 5, msg: '未设置更新地址' }
+      ],
+      state1: 0,
+      percent: 0,
+    }
+  },
+  created() {
+    let locationpath = localStorage.getItem('locationpath') ? JSON.parse(localStorage.getItem('locationpath')) : {}
+    this.baseURL = locationpath.baseURL || '';
+    this.webURL = locationpath.webURL || '';
+    this.get1()
+    this.get2()
+    this.sendurl()
+    // console.log(this.$router)
+  },
+  methods: {
+    ...mapActions({
+      getlocationpath: 'user/getlocationpath',
+    }),
+    sendurl(){
+      console.log(111,this.webURL)
+      ipcRenderer.send('sendurl',{url:this.webURL})
+    },
+    get1() {
+      let t = this
+      ipcRenderer.on('state1', (event, data) => {
+        t.state1 = data
+        // console.log(59, data, t.state1)
+      })
+    },
+    get2() {
+      let t = this
+      ipcRenderer.on('downloadProgress', (event, data) => {
+        t.percent = (data.percent).toFixed(1);
+        console.log(t.percent)
+        if (data.percent >= 100) {
+          t.state1 = 4;
+        }
+      })
+    },
+  }
+}
+</script>
+
+<style lang="less" scoped>
+.bg {
+  background: #fff;
+  padding: 20px;
+  border-radius: 50%;
+}
+</style>

+ 8 - 0
src/renderer/router/index.js

@@ -45,6 +45,14 @@ let routes = [
       require(["@/pages/settingwin/index.vue"], resolve);
     },
   },
+  {
+    path: '/update',
+    name: 'Update',
+    component: function (resolve) {
+      require(["@/pages/update/index.vue"], resolve);
+    },
+  },
+  
   // {
   //   path: '/newwin',
   //   name: 'Newwin',

+ 7 - 9
src/renderer/store/modules/patient.js

@@ -19,18 +19,16 @@ const mutations = {
 const actions = {
   async findVisitSum({ commit, dispatch }) {
     try {
-      const {
-        data, code
-      } = await api.find_visit_sum()
-      if (code == 0) {
-        // console.log(data)
-        commit('setPatientnum', data)
-        return Promise.resolve(data)
+      const res= await api.find_visit_sum()
+      if (res.code == 0) {
+        commit('setPatientnum', res.data)
+        return Promise.resolve(res.data)
       } else {
-        return Promise.reject(data)
+        return Promise.resolve(res)
       }
     } catch (error) {
-      console.error(error)
+      console.error(127,error)
+      Promise.reject(res)
     }
   }
 }

+ 31 - 2
src/renderer/utils/common.js

@@ -21,7 +21,7 @@ export function getAge(startDateStr, endDateStr) {
   endDateStr = endDateStr||getNowDate()
   let startDate = new Date(startDateStr);
   let endDate = new Date(endDateStr);
-  let yearNum = endDate.getFullYear() - startDate.getFullYear();
+  let yearNum = endDate.getFullYear() - startDate.getFullYear()-1;
   //获取两个日期(月+日)部分
   let sStr = startDateStr.substring(5, 10);
   let eStr = getNowDate().substring(5, 10);
@@ -69,4 +69,33 @@ export function timeTrans({
   } else {
     return `${obj.Y}-${obj.M}-${obj.D}`
   }
-}
+}
+
+
+(function(doc, win) {
+	var docEl = doc.documentElement,
+		resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize',
+		recalc = function() {
+			var clientWidth = docEl.clientWidth;
+			var fontSize = 20;
+			docEl.style.fontSize = fontSize + 'px';
+			var docStyles = getComputedStyle(docEl);
+			var realFontSize = parseFloat(docStyles.fontSize);
+			var scale = realFontSize / fontSize;
+			console.log("realFontSize: " + realFontSize + ", scale: " + scale);
+			fontSize = clientWidth / 667 * 20;
+			if (isIphoneX()) fontSize = 19;
+			fontSize = fontSize / scale;
+			docEl.style.fontSize = fontSize + 'px';
+		};
+	// Abort if browser does not support addEventListener
+	if (!doc.addEventListener) return;
+	win.addEventListener(resizeEvt, recalc, false);
+	doc.addEventListener('DOMContentLoaded', recalc, false);
+
+	// iphoneX判断
+	function isIphoneX() {
+		return /iphone/gi.test(navigator.userAgent) && (win.screen.height == 812 && win.screen.width == 375)
+	}
+
+})(document, window);

+ 14 - 3
vue.config.js

@@ -1,4 +1,5 @@
-const path=require('path')
+const path = require('path')
+const package = require('./package.json')
 const isDevelopment = process.env.NODE_ENV == "development"
 function resolve(dir) {
     return path.join(__dirname, dir);
@@ -110,6 +111,10 @@ module.exports = {
         electronBuilder: {
             nodeIntegration: true,
             builderOptions: {
+                publish: {
+                    "provider": "generic",
+                    "url": "",
+                },
                 win: {
                     icon: "build/electron-icon/icon.ico",
                     // 图标路径 windows系统中icon需要256*256的ico格式图片,更换应用图标亦在此处
@@ -151,11 +156,12 @@ module.exports = {
                 asar: true,
                 nsis: {
                     // 是否一键安装,建议为 false,可以让用户点击下一步、下一步、下一步的形式安装程序,如果为true,当用户双击构建好的程序,自动安装程序并打开,即:一键安装(one-click installer)
-                    oneClick: false,
+                    oneClick: true,
+                  
                     // 允许请求提升。 如果为false,则用户必须使用提升的权限重新启动安装程序。
                     allowElevation: true,
                     // 允许修改安装目录,建议为 true,是否允许用户改变安装目录,默认是不允许
-                    allowToChangeInstallationDirectory: true,
+                    allowToChangeInstallationDirectory: false,
                     // 安装图标
                     installerIcon: "build/electron-icon/icon.ico",
                     // 卸载图标
@@ -166,6 +172,11 @@ module.exports = {
                     createDesktopShortcut: true,
                     // 创建开始菜单图标
                     createStartMenuShortcut: true,
+                    perMachine: false,
+                    artifactName: `xklr-doctor-${package.version}.exe`,
+                    // "deleteAppDataOnUninstall": true,
+                    //  "runAfterFinish": true,
+                    //  "differentialPackage": true
                 },
             },
             chainWebpackMainProcess: (config) => {