fix(mobile): reset page scroll on route entry
This commit is contained in:
@@ -40,6 +40,7 @@ import { onShow } from '@dcloudio/uni-app';
|
||||
import type { LoginResult } from '@/types/api';
|
||||
import { apiRequest } from '@/services/api';
|
||||
import { consumeLoginRedirect, getAuth, isLoggedIn, phoneKey, saveAuth, validatePhone } from '@/services/auth';
|
||||
import { resetPageScroll } from '@/services/navigation';
|
||||
|
||||
const stored = getAuth();
|
||||
const phone = ref(stored.phone || uni.getStorageSync(phoneKey) || '');
|
||||
@@ -123,6 +124,7 @@ const login = async () => {
|
||||
};
|
||||
|
||||
onShow(() => {
|
||||
resetPageScroll();
|
||||
if (isLoggedIn()) {
|
||||
goAfterLogin();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user