Explorar o código

hack 默认用户所属药房

kumu hai 1 ano
pai
achega
6309c2fa6e
Modificáronse 1 ficheiros con 8 adicións e 1 borrados
  1. 8 1
      src/api/login.js

+ 8 - 1
src/api/login.js

@@ -32,7 +32,14 @@ export function getInfo() {
   return request({
     url: '/system/user/getInfo',
     method: 'get'
-  })
+  }).then(res => {
+    try {
+      if (!Array.isArray(res.pharmacyList) || res.pharmacyList.length === 0) {
+        res.pharmacyList = [{id: 18, name: '默认药房'}];
+      }
+    } catch (err) {}
+    return res;
+  });
 }
 
 // 退出方法