mirror of
https://github.com/zimplexing/OrionTV.git
synced 2026-02-14 20:01:58 +08:00
feat: enhance login status management and improve error logging across services
This commit is contained in:
@@ -11,7 +11,7 @@ import { StyledButton } from "./StyledButton";
|
||||
|
||||
const LoginModal = () => {
|
||||
const { isLoginModalVisible, hideLoginModal, checkLoginStatus } = useAuthStore();
|
||||
const { serverConfig } = useSettingsStore();
|
||||
const { serverConfig, apiBaseUrl } = useSettingsStore();
|
||||
const { refreshPlayRecords } = useHomeStore();
|
||||
const [username, setUsername] = useState("");
|
||||
const [password, setPassword] = useState("");
|
||||
@@ -28,7 +28,7 @@ const LoginModal = () => {
|
||||
setIsLoading(true);
|
||||
try {
|
||||
await api.login(isLocalStorage ? undefined : username, password);
|
||||
await checkLoginStatus();
|
||||
await checkLoginStatus(apiBaseUrl);
|
||||
await refreshPlayRecords();
|
||||
Toast.show({ type: "success", text1: "登录成功" });
|
||||
hideLoginModal();
|
||||
|
||||
@@ -112,7 +112,7 @@ export default function VideoCard({
|
||||
router.replace("/");
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Failed to delete play record:", error);
|
||||
console.info("Failed to delete play record:", error);
|
||||
Alert.alert("错误", "删除观看记录失败,请重试");
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user