Преглед изворни кода

修改登录不显示的bug

wanglaoye пре 1 година
родитељ
комит
56e92754b8

+ 106 - 0
log/2023-8-10.log

@@ -0,0 +1,106 @@
+[2023-08-10 09:15:20.109] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-08-10 09:15:21.141] [info]  76:undefined
+[2023-08-10 09:15:24.474] [info]  updater-118:Error: Cannot find channel "latest.yml" update info: HttpError: 404 Not Found
+"method: GET url: http://testadmin.xklr.net:8601/appupdatedoc/latest.yml?noCache=1h7eg6c5p\n\nPlease double check that your authentication token is correct. Due to security reasons, actual status maybe not reported, but 404.\n"
+Headers: {
+  "date": "Thu, 10 Aug 2023 01:15:23 GMT",
+  "content-length": "481",
+  "content-type": "text/html; charset=utf-8"
+}
+    at createHttpError (webpack:///./node_modules/.store/builder-util-runtime@8.9.2/node_modules/builder-util-runtime/out/httpExecutor.js?:14:12)
+    at ElectronHttpExecutor.handleResponse (webpack:///./node_modules/.store/builder-util-runtime@8.9.2/node_modules/builder-util-runtime/out/httpExecutor.js?:116:20)
+    at ClientRequest.eval (webpack:///./node_modules/.store/builder-util-runtime@8.9.2/node_modules/builder-util-runtime/out/httpExecutor.js?:82:26)
+    at ClientRequest.emit (events.js:315:20)
+    at SimpleURLLoaderWrapper.<anonymous> (electron/js2c/browser_init.js:105:6816)
+    at SimpleURLLoaderWrapper.emit (events.js:315:20)
+[2023-08-10 09:20:53.781] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-08-10 09:20:54.807] [info]  76:undefined
+[2023-08-10 09:20:55.913] [info]  82:[object Object]
+[2023-08-10 09:24:34.676] [info]  76:undefined
+[2023-08-10 09:24:34.752] [info]  82:[object Object]
+[2023-08-10 09:26:03.638] [info]  76:undefined
+[2023-08-10 09:26:03.692] [info]  82:[object Object]
+[2023-08-10 09:45:43.138] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-08-10 09:45:44.429] [info]  76:undefined
+[2023-08-10 09:45:45.542] [info]  82:[object Object]
+[2023-08-10 09:45:58.673] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-08-10 09:45:59.719] [info]  76:undefined
+[2023-08-10 09:46:00.819] [info]  82:[object Object]
+[2023-08-10 09:46:45.897] [info]  76:undefined
+[2023-08-10 09:46:46.135] [info]  82:[object Object]
+[2023-08-10 09:47:19.495] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-08-10 09:47:20.548] [info]  76:undefined
+[2023-08-10 09:47:21.670] [info]  82:[object Object]
+[2023-08-10 09:49:29.765] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-08-10 09:49:30.774] [info]  76:undefined
+[2023-08-10 09:49:31.867] [info]  82:[object Object]
+[2023-08-10 09:49:43.109] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-08-10 09:49:45.862] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-08-10 09:49:46.761] [info]  76:undefined
+[2023-08-10 09:49:47.863] [info]  82:[object Object]
+[2023-08-10 09:58:23.441] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-08-10 09:58:24.468] [info]  76:undefined
+[2023-08-10 09:58:25.817] [info]  82:[object Object]
+[2023-08-10 10:02:14.100] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-08-10 10:02:19.297] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-08-10 10:02:20.329] [info]  76:undefined
+[2023-08-10 10:02:23.709] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-08-10 10:02:24.717] [info]  76:undefined
+[2023-08-10 10:02:25.831] [info]  82:[object Object]
+[2023-08-10 10:56:04.459] [info]  76:undefined
+[2023-08-10 10:56:04.720] [info]  82:[object Object]
+[2023-08-10 10:59:37.119] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-08-10 10:59:38.101] [info]  76:undefined
+[2023-08-10 10:59:39.204] [info]  82:[object Object]
+[2023-08-10 11:01:45.649] [info]  76:undefined
+[2023-08-10 11:01:45.696] [info]  82:[object Object]
+[2023-08-10 11:04:50.967] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-08-10 11:04:51.977] [info]  76:undefined
+[2023-08-10 11:04:53.102] [info]  82:[object Object]
+[2023-08-10 11:16:36.188] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-08-10 11:16:37.460] [info]  76:undefined
+[2023-08-10 11:16:38.563] [info]  82:[object Object]
+[2023-08-10 11:23:06.329] [info]  76:undefined
+[2023-08-10 11:23:06.585] [info]  82:[object Object]
+[2023-08-10 11:23:29.282] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-08-10 11:23:30.171] [info]  76:undefined
+[2023-08-10 11:23:31.266] [info]  82:[object Object]
+[2023-08-10 11:28:42.165] [info]  76:undefined
+[2023-08-10 11:28:42.338] [info]  82:[object Object]
+[2023-08-10 11:28:46.779] [info]  76:undefined
+[2023-08-10 11:28:46.821] [info]  82:[object Object]
+[2023-08-10 11:29:23.513] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-08-10 11:29:24.866] [info]  76:undefined
+[2023-08-10 11:29:26.052] [info]  82:[object Object]
+[2023-08-10 11:30:38.702] [info]  76:undefined
+[2023-08-10 11:30:38.752] [info]  82:[object Object]
+[2023-08-10 11:31:27.265] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-08-10 11:31:28.260] [info]  76:undefined
+[2023-08-10 11:31:29.340] [info]  82:[object Object]
+[2023-08-10 11:33:10.604] [info]  76:undefined
+[2023-08-10 11:33:10.650] [info]  82:[object Object]
+[2023-08-10 11:40:36.843] [info]  76:undefined
+[2023-08-10 11:40:37.181] [info]  82:[object Object]
+[2023-08-10 11:41:45.324] [info]  76:undefined
+[2023-08-10 11:41:45.477] [info]  82:[object Object]
+[2023-08-10 11:42:10.011] [info]  76:undefined
+[2023-08-10 11:42:10.060] [info]  82:[object Object]
+[2023-08-10 11:42:50.763] [info]  76:undefined
+[2023-08-10 11:42:50.826] [info]  82:[object Object]
+[2023-08-10 11:45:10.326] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-08-10 11:45:11.363] [info]  76:undefined
+[2023-08-10 11:45:12.516] [info]  82:[object Object]
+[2023-08-10 11:47:49.360] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-08-10 11:47:50.381] [info]  76:undefined
+[2023-08-10 11:47:51.523] [info]  82:[object Object]
+[2023-08-10 11:49:58.076] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-08-10 11:49:59.013] [info]  76:undefined
+[2023-08-10 11:50:00.353] [info]  82:[object Object]
+[2023-08-10 11:50:30.149] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-08-10 11:50:31.102] [info]  76:undefined
+[2023-08-10 11:50:32.241] [info]  82:[object Object]
+[2023-08-10 11:51:15.387] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-08-10 11:51:16.330] [info]  76:undefined
+[2023-08-10 11:51:17.464] [info]  82:[object Object]
+[2023-08-10 11:51:18.219] [info]  76:undefined
+[2023-08-10 11:51:18.270] [info]  82:[object Object]

+ 78 - 0
log/2023-8-9.log

@@ -251,3 +251,81 @@
 [2023-08-09 15:13:47.740] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
 [2023-08-09 15:13:48.697] [info]  76:undefined
 [2023-08-09 15:13:49.798] [info]  82:[object Object]
+[2023-08-09 17:03:44.357] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-08-09 17:03:45.301] [info]  76:undefined
+[2023-08-09 17:03:46.442] [info]  82:[object Object]
+[2023-08-09 17:05:05.702] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-08-09 17:05:06.654] [info]  76:undefined
+[2023-08-09 17:05:07.783] [info]  82:[object Object]
+[2023-08-09 17:08:15.227] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-08-09 17:08:16.185] [info]  76:undefined
+[2023-08-09 17:08:17.294] [info]  82:[object Object]
+[2023-08-09 17:08:40.417] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-08-09 17:08:41.698] [info]  76:undefined
+[2023-08-09 17:08:42.800] [info]  82:[object Object]
+[2023-08-09 17:08:50.270] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-08-09 17:08:51.323] [info]  76:undefined
+[2023-08-09 17:08:52.436] [info]  82:[object Object]
+[2023-08-09 17:11:49.572] [info]  76:undefined
+[2023-08-09 17:11:49.633] [info]  82:[object Object]
+[2023-08-09 17:11:50.846] [info]  76:undefined
+[2023-08-09 17:11:50.898] [info]  82:[object Object]
+[2023-08-09 17:11:53.163] [info]  76:undefined
+[2023-08-09 17:11:53.226] [info]  82:[object Object]
+[2023-08-09 17:12:10.818] [info]  76:undefined
+[2023-08-09 17:12:10.879] [info]  82:[object Object]
+[2023-08-09 17:13:09.248] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-08-09 17:13:10.405] [info]  76:undefined
+[2023-08-09 17:13:11.512] [info]  82:[object Object]
+[2023-08-09 17:15:35.985] [info]  76:undefined
+[2023-08-09 17:15:36.052] [info]  82:[object Object]
+[2023-08-09 17:16:42.138] [info]  76:undefined
+[2023-08-09 17:16:42.327] [info]  82:[object Object]
+[2023-08-09 17:18:11.706] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-08-09 17:18:12.886] [info]  76:undefined
+[2023-08-09 17:18:14.010] [info]  82:[object Object]
+[2023-08-09 17:19:27.699] [info]  76:undefined
+[2023-08-09 17:19:27.763] [info]  82:[object Object]
+[2023-08-09 17:19:55.773] [info]  76:undefined
+[2023-08-09 17:19:55.829] [info]  82:[object Object]
+[2023-08-09 17:20:08.965] [info]  76:undefined
+[2023-08-09 17:20:09.022] [info]  82:[object Object]
+[2023-08-09 17:20:54.311] [info]  76:undefined
+[2023-08-09 17:20:54.370] [info]  82:[object Object]
+[2023-08-09 17:21:58.707] [info]  76:undefined
+[2023-08-09 17:21:58.764] [info]  82:[object Object]
+[2023-08-09 17:22:02.451] [info]  76:undefined
+[2023-08-09 17:22:02.511] [info]  82:[object Object]
+[2023-08-09 17:22:23.683] [info]  76:undefined
+[2023-08-09 17:22:23.742] [info]  82:[object Object]
+[2023-08-09 17:23:00.401] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-08-09 17:23:01.380] [info]  76:undefined
+[2023-08-09 17:23:02.538] [info]  82:[object Object]
+[2023-08-09 17:24:37.491] [info]  76:undefined
+[2023-08-09 17:24:37.689] [info]  82:[object Object]
+[2023-08-09 17:30:41.177] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-08-09 17:30:42.172] [info]  76:undefined
+[2023-08-09 17:30:43.287] [info]  82:[object Object]
+[2023-08-09 17:33:06.723] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-08-09 17:33:07.710] [info]  76:undefined
+[2023-08-09 17:33:08.841] [info]  82:[object Object]
+[2023-08-09 17:38:11.708] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-08-09 17:38:12.670] [info]  76:undefined
+[2023-08-09 17:38:13.799] [info]  82:[object Object]
+[2023-08-09 17:46:12.233] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-08-09 17:46:13.327] [info]  76:undefined
+[2023-08-09 17:46:14.449] [info]  82:[object Object]
+[2023-08-09 17:49:58.406] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-08-09 17:49:59.472] [info]  76:undefined
+[2023-08-09 17:50:00.585] [info]  82:[object Object]
+[2023-08-09 17:52:33.027] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-08-09 17:52:34.234] [info]  76:undefined
+[2023-08-09 17:52:35.376] [info]  82:[object Object]
+[2023-08-09 17:53:54.604] [info]  76:undefined
+[2023-08-09 17:53:54.665] [info]  82:[object Object]
+[2023-08-09 17:54:28.567] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-08-09 17:54:29.550] [info]  76:undefined
+[2023-08-09 17:54:30.662] [info]  82:[object Object]
+[2023-08-09 17:58:10.403] [info]  38:D:\web\product\electron\doctor-electron\dist\electron
+[2023-08-09 17:58:11.389] [info]  76:undefined
+[2023-08-09 17:58:12.515] [info]  82:[object Object]

+ 3 - 2
package.json

@@ -1,6 +1,6 @@
 {
   "name": "xklr",
-  "version": "1.2.3",
+  "version": "1.2.4",
   "private": false,
   "author": "wly",
   "scripts": {
@@ -57,7 +57,8 @@
     "vue-infinite-loading": "^2.4.5",
     "vue-lazyload": "^1.3.3",
     "vue-router": "^3.5.1",
-    "vuex": "^3.6.2"
+    "vuex": "^3.6.2",
+    "vuex-electron": "^1.0.3"
   },
   "devDependencies": {
     "@vue/cli-plugin-babel": "~4.5.0",

+ 6 - 2
src/main/main.js

@@ -23,6 +23,10 @@ if (!isdev) {
   global.__images = path.join(__dirname, "./images");
 }
 const iconSrc = __static + "/images/icon.ico";
+const loadURL = isdev
+    ? `${process.env.WEBPACK_DEV_SERVER_URL}#/ball`
+    : `${LOAD_URL}#ball`;
+// console.log(loadURL)
 let mainWindow = null
 async function createWindow() {
   // Create the browser window.
@@ -64,11 +68,11 @@ async function createWindow() {
   })
   if (process.env.WEBPACK_DEV_SERVER_URL) {
     // Load the url of the dev server if in development mode
-    await mainWindow.loadURL(process.env.WEBPACK_DEV_SERVER_URL + '#/ball');
+    await mainWindow.loadURL(loadURL);
     if (!process.env.IS_TEST) mainWindow.webContents.openDevTools();
   } else {
     createProtocol(ACHEME);
-    mainWindow.loadURL(LOAD_URL + '/#/ball');
+    mainWindow.loadURL(loadURL);
     // mainWindow.loadURL(`file://${__dirname}/app/index.html`);
   }
   mainWinEvent(mainWindow)

+ 5 - 3
src/main/windows/indexwin.js

@@ -5,9 +5,8 @@ const isdev = process.env.NODE_ENV == "development"
 const loadURL = isdev
     ? `${process.env.WEBPACK_DEV_SERVER_URL}#/home/login`
     : `${LOAD_URL}#home/login`;
-
+    console.log(loadURL)
 const iconSrc = __static + "/images/icon.ico";
-// console.log(loadURL)
 let indexwin = null;
 const createIndexwin = function (BrowserWindow) {
     if (indexwin !== null) {
@@ -94,6 +93,9 @@ const createIndexwin = function (BrowserWindow) {
             app.exit()
         }
     });
-    // return settingWindow;
+    indexwin.on("close", () => {
+        indexwin = null;
+    });
+   
 };
 export default createIndexwin;

+ 7 - 1
src/main/windows/mainwin.js

@@ -18,7 +18,7 @@ export default function mainWinEvent(mw) {
   })
   //打开外部链接
   ipcMain.on('openUrl', (event, option) => {
-    console.log(option)
+    // console.log(option)
     shell.openExternal(option);
   })
 
@@ -37,6 +37,7 @@ export default function mainWinEvent(mw) {
     }
     if (option.type == 'user') {
       // console.log(option)
+      console.log(option)
       menu = [
         {
           label: '账号:' + option.data.phone,
@@ -53,6 +54,7 @@ export default function mainWinEvent(mw) {
         {
           label: '注销登录',
           click: function () {
+          
             e.sender.send('reply', '注销');
           }
         }
@@ -63,4 +65,8 @@ export default function mainWinEvent(mw) {
   ipcMain.on('removeTray', (event, option) => {
     tray('removeTray')
   })
+  ipcMain.on('vuex-state-set', (event, option) => { 
+    console.log(option)
+    mw.webContents.send('vuex-state-set-web',option)
+  })
 }

+ 1 - 0
src/renderer/App.vue

@@ -49,6 +49,7 @@ export default {
       let t = this
       console.log(this.$route.path)
       ipcRenderer.on('reply', function (event, type) {
+        ipcRenderer.send('vuex-state-set', { type: 'resetAll' });
         // console.log(type);
         if (type == '注销') {
         //  console.log( t.user)

+ 14 - 6
src/renderer/pages/ball/index.vue

@@ -58,7 +58,7 @@
   </div>
 </template>
 <script>
-import { mapGetters } from 'vuex';
+import { mapGetters, mapActions } from 'vuex';
 import { ipcRenderer } from "electron";
 import { throttle } from 'lodash';
 export default {
@@ -83,17 +83,24 @@ export default {
   },
   computed: {
     ...mapGetters({
+      hospitalinfo: 'user/hospitalinfo',
       userinfo: 'user/userinfo',
       patientnum: 'patient/patientnum',
     }),
   },
   mounted() {
-    ipcRenderer.on('index-box1', (event, data) => {
-      console.log(59, data)
+    let t = this
+    ipcRenderer.on('vuex-state-set-web', (event, res) => {
+      t[res.type](res.data||{})
     })
     this.move()
   },
   methods: {
+    ...mapActions({
+      setPatientnum: 'patient/setPatientnum',
+      setUserInfo: 'user/setUserInfo',
+      resetAll: 'user/resetAll',
+    }),
     getMathRandom(max, min) {
       let num = (Math.random() * (max - min) + min).toFixed(2);
       return num
@@ -130,7 +137,7 @@ export default {
         t.baseX = e.x
         t.baseY = e.y
         t.setwindowsize(132, 80)
-        ipcRenderer.send('isclick',false)
+        ipcRenderer.send('isclick', false)
         t.class1 = 'opacity7'
       })
       doc.addEventListener('mousemove', function (e) {
@@ -138,7 +145,7 @@ export default {
         if (t.class1 == 'opacity7' && t.isDown) {
           let x = e.screenX - t.baseX
           let y = e.screenY - t.baseY
-          
+
           // ipcRenderer.send('index-box')
           ipcRenderer.send('move-application', {
             posX: x,
@@ -155,7 +162,7 @@ export default {
         t.class1 = ''
       })
       doc.addEventListener('mouseup', function (e) {
-        ipcRenderer.send('isclick',true)
+        ipcRenderer.send('isclick', true)
         t.isDown = false
         t.class1 = ''
       })
@@ -190,6 +197,7 @@ body {
 
 .ballbox {
   width: 132px;
+
   .box1 {
     display: flex;
     align-items: center;

+ 1 - 1
src/renderer/pages/login/index.vue

@@ -102,7 +102,7 @@ export default {
       t.$refs.form.validate(async (valid) => {
         if (valid)
           try {
-            await t.login(t.formInline).then((res) => {
+            await t.login(t.formInline).then(() => {
               localStorage.setItem('username', t.formInline.username)
               localStorage.setItem('password', t.formInline.password)
               localStorage.setItem('useraccount', t.formInline.username)

+ 21 - 7
src/renderer/store/index.js

@@ -1,15 +1,29 @@
 import Vue from "vue";
 import Vuex from 'vuex'
-// import { createPersistedState, createSharedMutations } from 'vuex-electron'
+import { createPersistedState, createSharedMutations } from "vuex-electron"
 import modules from './modules'
 
+Vue.use(Vuex);
+const store = new Vuex.Store({
+  modules,
+  // plugins: [createPersistedState(), createSharedMutations()],
+})
+// createPersistedState({
+//   whitelist: ["whitelistedAction", "anotherWhitelistedAction"],
+//   // or
+//   whitelist: (mutation) => {
+//     return true
+//   },
+//   // or
+//   blacklist: ["ignoredAction", "anotherIgnoredAction"],
+//   // or
+//   blacklist: (mutation) => {
+//     return true
+//   }
+// })
+export default store
 // export default new Vuex.Store({
 //   modules,
 //   plugins: [createPersistedState(), createSharedMutations()],
 //   strict: process.env.NODE_ENV !== 'production'
-// })
-Vue.use(Vuex);
-const store = new Vuex.Store({
-  modules
-})
-export default store
+// })

+ 6 - 2
src/renderer/store/modules/patient.js

@@ -1,5 +1,6 @@
 
 import api from '@/api/index'
+import { ipcRenderer } from 'electron'
 const state = () => ({
   patientnum: {isNotSend: 0, isSend: 0, sum: 0},
 })
@@ -22,14 +23,17 @@ const actions = {
       const res= await api.find_visit_sum()
       if (res.code == 0) {
         commit('setPatientnum', res.data)
+        ipcRenderer.send('vuex-state-set', { type: 'setPatientnum', data: res.data });
         return Promise.resolve(res.data)
       } else {
         return Promise.resolve(res)
       }
     } catch (error) {
-      console.error(127,error)
       Promise.reject(res)
     }
-  }
+  },
+  setPatientnum({ commit },data) {
+    commit('setPatientnum', data)
+  },
 }
 export default { state, getters, mutations, actions,namespaced: true }

+ 9 - 1
src/renderer/store/modules/user.js

@@ -10,6 +10,7 @@ import utilstoken from '@/utils/token'
 import { isString } from '@/utils/validate'
 import conf from '@/config'
 import store from '@/store'
+import { ipcRenderer } from 'electron'
 const { tokenName, defultAddress, DOCTOR_SECTION } = conf
 const { getToken, removeToken, setToken } = utilstoken
 
@@ -85,6 +86,7 @@ const actions = {
    * @param {*} userInfo
    */
   async login({ commit,dispatch }, userInfo) {
+    console.log(22)
     if(!localStorage.getItem('locationpath')){
       Message({
         message: '还未设置请求地址',
@@ -96,10 +98,12 @@ const actions = {
     }else{
       dispatch('getlocationpath',localStorage.getItem('locationpath'))
     }
+
     const {
       data: { [tokenName]: token },
       code
     } = await api.login(userInfo)
+
     if (code !== 0) {
       const err = `登录接口异常,未正确返回${tokenName}...`
       Message({
@@ -112,6 +116,7 @@ const actions = {
     }
     if (token) {
       commit('setToken1', token)
+      console.log(115)
       
     } else {
       const err = `登录接口异常,未正确返回${tokenName}...`
@@ -134,7 +139,6 @@ const actions = {
     const {
       data,
     } = await api.getUserInfo()
-
     let type = ['', '-社区医师', '-阅片医师', '-签约医师', '-护士', '-医院管理员']
     let avatar = "https://i.gtimg.cn/club/item/face/img/2/16022_100.gif"
     if (
@@ -160,11 +164,15 @@ const actions = {
       if (data.section) {
         data.section = DOCTOR_SECTION.find((item) => item.value == data.section).label
       }
+      ipcRenderer.send('vuex-state-set', { type: 'setUserInfo', data: data });
       commit('setUserInfo', data)
       // await store.dispatch('getHospitalInfo')
     }
     return Promise.resolve(data)
   },
+  setUserInfo({commit}, userinfo) {
+    commit('setUserInfo', userinfo)
+  },
   async getHospitalInfo({ commit, dispatch }) {
     console.log(store.getters['user/userinfo'])
     if (store.getters['user/userinfo'].isSystem == 1) {