import { ThemedText } from '@/components/ThemedText'; import { ThemedView } from '@/components/ThemedView'; import { useAuth } from '@/contexts/auth-context'; import { fetchApi } from '@/lib/server-api-util'; import { store } from '@/store'; import { User } from '@/types/user'; import { Ionicons } from '@expo/vector-icons'; import { useTranslation } from 'react-i18next'; import { TouchableOpacity, View } from 'react-native'; export default function HomeScreen() { const { login } = useAuth(); const token = store.getState().auth.token; console.log(token); const { t } = useTranslation(); const handleApi = () => { fetchApi('/iam/login/password-login', { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ account: "jinyaqiu@fairclip.cn", password: "111111", }), }) .then((data) => { login(data as User, data.access_token || '') }) .catch((err) => console.log(err)); // fetch('http://192.168.31.42/api/v1/iam/login/password-login', { // method: 'POST', // headers: { // 'Content-Type': 'application/json', // }, // body: JSON.stringify({ // account: "jinyaqiu@fairclip.cn", // password: "111111", // }), // }) // .then((res) => res.json()) // .then((data) => console.log(data)) // .catch((err) => console.log(err)); } return ( {t('title', { ns: "example" })} MeMo Ready to wake up your memories? Just ask! Let MeMo bring them back to life! Explore More Memory Reel Made Just For You! ); }