Browse Source

🌁 修复登录加载页面卡死情况,进不去登录页面

master
wangxiang 3 years ago
parent
commit
9340e27419
  1. 42
      kicc-ui/src/components/AMap/src/Amap.vue
  2. 34
      kicc-ui/src/router/guard/index.ts
  3. 4
      kicc-ui/tsconfig.json

42
kicc-ui/src/components/AMap/src/Amap.vue

@ -295,20 +295,6 @@
panel: instance.refs.mapPanel panel: instance.refs.mapPanel
}); });
//
scanTakeSpecimenCircleRange = new AMap.Circle({
radius: 2000,
borderWeight: 3,
strokeColor: '#3600ff',
strokeOpacity: 0.2,
strokeWeight: 6,
fillOpacity: 0.4,
strokeStyle: 'dashed',
strokeDasharray: [8, 8],
fillColor: '#1791fc',
zIndex: 50
});
// 线 // 线
driving.search(new AMap.LngLat(112.913864, 28.295114), new AMap.LngLat(112.918119, 28.282891), { driving.search(new AMap.LngLat(112.913864, 28.295114), new AMap.LngLat(112.918119, 28.282891), {
waypoints:[new AMap.LngLat(112.919165, 28.289924)] waypoints:[new AMap.LngLat(112.919165, 28.289924)]
@ -366,15 +352,37 @@
if (smallHospitalMap) { if (smallHospitalMap) {
// 20,, // 20,,
map.remove(scanTakeSpecimenCircleRange); map.remove(scanTakeSpecimenCircleRange);
//
scanTakeSpecimenCircleRange = new AMap.Circle({
radius: 8000,
borderWeight: 3,
strokeColor: '#3600ff',
strokeOpacity: 0.2,
strokeWeight: 6,
fillOpacity: 0.4,
strokeStyle: 'dashed',
strokeDasharray: [8, 8],
fillColor: '#1791fc',
zIndex: 50
});
scanTakeSpecimenCircleRange.setCenter([smallHospitalMap.lng, smallHospitalMap.lat]); scanTakeSpecimenCircleRange.setCenter([smallHospitalMap.lng, smallHospitalMap.lat]);
map.add(scanTakeSpecimenCircleRange); map.add(scanTakeSpecimenCircleRange);
map.setFitView([ scanTakeSpecimenCircleRange ]); map.setFitView([ scanTakeSpecimenCircleRange ]);
// //
const specimenLngLat = new AMap.LngLat(116.403984,39.907535); const gatherCircleRangeSpecimen = [];
for (let i = 0; i < smallHospitalMapList.length; ++i) {
const smallHospitalMap = smallHospitalMapList[i];
const specimenLngLat = new AMap.LngLat(smallHospitalMap.lng, smallHospitalMap.lat);
if (scanTakeSpecimenCircleRange.contains(specimenLngLat)) {
console.log('查找到');
} else {
console.log('没有查找到');
}
}
if (scanTakeSpecimenCircleRange.contains()) {
}
} else { } else {
throw '查找不到发单点数据,请检查发单点!'; throw '查找不到发单点数据,请检查发单点!';

34
kicc-ui/src/router/guard/index.ts

@ -18,7 +18,7 @@ import { createPermissionGuard } from './permissionGuard';
import { createStateGuard } from './stateGuard'; import { createStateGuard } from './stateGuard';
import nProgress from 'nprogress'; import nProgress from 'nprogress';
import projectSetting from '/@/settings/projectSetting'; import projectSetting from '/@/settings/projectSetting';
import { User } from '/@/api/platform/core/entity/user'; import type { User } from '/@/api/platform/core/entity/user';
import { synchronousAuthenticationUser } from '/@/api/platform/system/controller/user'; import { synchronousAuthenticationUser } from '/@/api/platform/system/controller/user';
import { isEmpty } from '/@/utils/is'; import { isEmpty } from '/@/utils/is';
@ -123,20 +123,24 @@ export function createSynchronousAuthenticationUserGuard(router: Router) {
const token = userStore.getAccessToken; const token = userStore.getAccessToken;
const userInfo = userStore.getUserInfo; const userInfo = userStore.getUserInfo;
if (token && !isEmpty(userInfo)) { if (token && !isEmpty(userInfo)) {
const kiccUser = await synchronousAuthenticationUser(); try {
// 同步当前身份验证用户到用户信息中 const kiccUser = await synchronousAuthenticationUser();
Object.assign(userInfo, { // 同步当前身份验证用户到用户信息中
id: kiccUser.id, Object.assign(userInfo, {
phone: kiccUser.phone, id: kiccUser.id,
userName: kiccUser.username, phone: kiccUser.phone,
tenantId: kiccUser.tenantId, userName: kiccUser.username,
tenantIds: String(kiccUser.tenantId).split(','), tenantId: kiccUser.tenantId,
enabled: kiccUser.enabled, tenantIds: String(kiccUser.tenantId).split(','),
accountNonLocked: kiccUser.accountNonLocked, enabled: kiccUser.enabled,
accountNonExpired: kiccUser.accountNonExpired, accountNonLocked: kiccUser.accountNonLocked,
credentialsNonExpired: kiccUser.credentialsNonExpired accountNonExpired: kiccUser.accountNonExpired,
} as User); credentialsNonExpired: kiccUser.credentialsNonExpired
userStore.setUserInfo(userInfo); } as Partial<User>);
userStore.setUserInfo(userInfo);
} catch {
console.log('同步授权用户信息失败,请检查token是否过期!');
}
} }
return true; return true;
}); });

4
kicc-ui/tsconfig.json

@ -27,8 +27,8 @@
"noImplicitThis" : false, "noImplicitThis" : false,
"noImplicitAny": false, "noImplicitAny": false,
"skipLibCheck": true, "skipLibCheck": true,
"types": ["vite/client"], "types": ["vite/client", "@amap/amap-jsapi-loader/src/global"],
"typeRoots": ["./node_modules/@types/", "./types", "./node_modules/@amap/amap-jsapi-loader/src"], "typeRoots": ["./node_modules/@types/", "./types"],
"removeComments": true, "removeComments": true,
"paths": { "paths": {
"/@/*": ["src/*"], "/@/*": ["src/*"],

Loading…
Cancel
Save