thêm quét QR đăng nhập, sửa lại logic để gọi api bằng ip thiết bị

This commit is contained in:
Tran Anh Tuan
2025-11-10 16:12:52 +07:00
parent c26de5aefc
commit 1a534eccb0
10 changed files with 224 additions and 218 deletions

View File

@@ -4,7 +4,7 @@ import { StyleSheet } from "react-native";
import { ThemedText } from "@/components/themed-text";
import { ThemedView } from "@/components/themed-view";
import { api } from "@/config";
import { TOKEN } from "@/constants";
import { DOMAIN, TOKEN } from "@/constants";
import { removeStorageItem } from "@/utils/storage";
import { useState } from "react";
@@ -37,9 +37,10 @@ export default function SettingScreen() {
<ThemedText type="title">Settings</ThemedText>
<ThemedView
style={styles.button}
onTouchEnd={() => {
removeStorageItem(TOKEN);
router.replace("/auth/login");
onTouchEnd={async () => {
await removeStorageItem(TOKEN);
await removeStorageItem(DOMAIN);
router.navigate("/auth/login");
}}
>
<ThemedText type="defaultSemiBold">Đăng xuất</ThemedText>