|
|
@@ -38,23 +38,23 @@ export const LoginPage = () => {
|
|
|
try {
|
|
|
setIsLoading(true);
|
|
|
|
|
|
- // 获取地理位置
|
|
|
- let latitude: number | undefined;
|
|
|
- let longitude: number | undefined;
|
|
|
+ // // 获取地理位置
|
|
|
+ // let latitude: number | undefined;
|
|
|
+ // let longitude: number | undefined;
|
|
|
|
|
|
- try {
|
|
|
- if (navigator.geolocation) {
|
|
|
- const position = await new Promise<GeolocationPosition>((resolve, reject) => {
|
|
|
- navigator.geolocation.getCurrentPosition(resolve, reject);
|
|
|
- });
|
|
|
- latitude = position.coords.latitude;
|
|
|
- longitude = position.coords.longitude;
|
|
|
- }
|
|
|
- } catch (geoError) {
|
|
|
- console.warn('获取地理位置失败:', geoError);
|
|
|
- }
|
|
|
+ // try {
|
|
|
+ // if (navigator.geolocation) {
|
|
|
+ // const position = await new Promise<GeolocationPosition>((resolve, reject) => {
|
|
|
+ // navigator.geolocation.getCurrentPosition(resolve, reject);
|
|
|
+ // });
|
|
|
+ // latitude = position.coords.latitude;
|
|
|
+ // longitude = position.coords.longitude;
|
|
|
+ // }
|
|
|
+ // } catch (geoError) {
|
|
|
+ // console.warn('获取地理位置失败:', geoError);
|
|
|
+ // }
|
|
|
|
|
|
- await login(data.username, data.password, latitude, longitude);
|
|
|
+ await login(data.username, data.password);
|
|
|
// 登录成功后跳转到管理后台首页
|
|
|
navigate('/admin/dashboard');
|
|
|
toast.success('登录成功!欢迎回来');
|