Browse Source

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

master
wangxiang 3 years ago
parent
commit
9340e27419
  1. 42
      kicc-ui/src/components/AMap/src/Amap.vue
  2. 8
      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 @@ @@ -295,20 +295,6 @@
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), {
waypoints:[new AMap.LngLat(112.919165, 28.289924)]
@ -366,15 +352,37 @@ @@ -366,15 +352,37 @@
if (smallHospitalMap) {
// 20,,
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]);
map.add(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 {
throw '查找不到发单点数据,请检查发单点!';

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

@ -18,7 +18,7 @@ import { createPermissionGuard } from './permissionGuard'; @@ -18,7 +18,7 @@ import { createPermissionGuard } from './permissionGuard';
import { createStateGuard } from './stateGuard';
import nProgress from 'nprogress';
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 { isEmpty } from '/@/utils/is';
@ -123,6 +123,7 @@ export function createSynchronousAuthenticationUserGuard(router: Router) { @@ -123,6 +123,7 @@ export function createSynchronousAuthenticationUserGuard(router: Router) {
const token = userStore.getAccessToken;
const userInfo = userStore.getUserInfo;
if (token && !isEmpty(userInfo)) {
try {
const kiccUser = await synchronousAuthenticationUser();
// 同步当前身份验证用户到用户信息中
Object.assign(userInfo, {
@ -135,8 +136,11 @@ export function createSynchronousAuthenticationUserGuard(router: Router) { @@ -135,8 +136,11 @@ export function createSynchronousAuthenticationUserGuard(router: Router) {
accountNonLocked: kiccUser.accountNonLocked,
accountNonExpired: kiccUser.accountNonExpired,
credentialsNonExpired: kiccUser.credentialsNonExpired
} as User);
} as Partial<User>);
userStore.setUserInfo(userInfo);
} catch {
console.log('同步授权用户信息失败,请检查token是否过期!');
}
}
return true;
});

4
kicc-ui/tsconfig.json

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

Loading…
Cancel
Save