From 83f768a4a07521a30f8a893d32002539af81a495 Mon Sep 17 00:00:00 2001 From: zk Date: Tue, 28 May 2024 14:37:29 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E5=A2=9E=E5=8A=A0=E8=8F=9C=E5=8D=95?= =?UTF-8?q?=E6=9D=83=E9=99=90=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/user.ts | 7 ++++++- src/views/index.vue | 12 ------------ src/views/sys/login.vue | 34 ++++++++++++++++++++++++---------- 3 files changed, 30 insertions(+), 23 deletions(-) diff --git a/src/api/user.ts b/src/api/user.ts index d2df419..725dc2e 100644 --- a/src/api/user.ts +++ b/src/api/user.ts @@ -5,6 +5,7 @@ enum Api { Login = '/sys/login', Logout = '/sys/logout', GetUserInfo = '/sys/user/getUserInfo', + auth = '/sys/permission/getPermCode', } export const getCodeInfo = (params: any) => get(Api.getInputCode + `/${params}`); @@ -27,6 +28,10 @@ export function getUserInfo() { }); } +export function getAuth() { + return get(Api.auth); +} + export function doLogout() { return get(Api.Logout); -} \ No newline at end of file +} diff --git a/src/views/index.vue b/src/views/index.vue index 257c20b..0bafc78 100644 --- a/src/views/index.vue +++ b/src/views/index.vue @@ -234,18 +234,6 @@ return Promise.all(hospitalPromises); } - // function getHospitalList(hospitalList, userLocation) { - // hospitalList.forEach(async (item) => { - // item.distance = getDistance(userLocation, [item.lon, item.lat]); - // let { time, routeList } = await getDriveTime(userLocation, [item.lon, item.lat]); - // item.driveTime = time; - // item.routeList = routeList; - // item.userLocation = userLocation; - // console.log('time', item.driveTime); - // }); - // return hospitalList; - // } - function getDistance(userLocation, destination) { const value = Map.getDistance(userLocation, destination); return value > 1000 ? (value / 1000).toFixed(2) + 'km' : value + 'm'; diff --git a/src/views/sys/login.vue b/src/views/sys/login.vue index 78bb61f..0c7a8d7 100644 --- a/src/views/sys/login.vue +++ b/src/views/sys/login.vue @@ -91,7 +91,7 @@