问题很简单我知道有很多答案可用于同一个问题,但我设置了自己的Options All -Indexes
DirectoryIndex index.php index.htm index.html
RewriteEngine on
RewriteBase /
# Force HTTPS on the subdomains/subdirectories login or admin
#RewriteCond %{HTTPS} off
#RewriteCond %{HTTP_HOST} ^(login|admin)\. [NC]
#RewriteCond %{REQUEST_URI} ^(login|admin)\. [NC,OR]
#RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
# Force WWW if no subdomain is given
RewriteCond %{HTTP_HOST} ^[^.]+\.[^.]+$
RewriteCond %{HTTP_HOST} !^$
RewriteCond %{HTTPS}s ^on(s)|
RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
文件,我尝试了几乎所有但都没有成功。
所以我的App.js
看起来像这样
App.js
现在,我将import React, { Component } from 'react';
import {
Platform,
StyleSheet,
Text,
View,
StatusBar
} from 'react-native';
import { createStackNavigator } from 'react-navigation';
import { Header, Button, Spinner } from './src/components/comman';
import SplashScreen from 'react-native-splash-screen';
import LoginForm from './src/components/LoginForm';
import SignupForm from './src/components/SignupForm';
import Home from './src/components/Home';
import ForgetPassword from './src/components/ForgetPassword';
import { YellowBox } from 'react-native';
YellowBox.ignoreWarnings(['Warning: isMounted(...) is deprecated', 'Module RCTImageLoader']);
const App = createStackNavigator ({
Login: { screen: LoginForm },
Home: { screen: Home },
Signup: { screen: SignupForm },
ForgetPassword: { screen : ForgetPassword },
},
{
initialRouteName: 'Login',
});
export default App;
中的登录状态存储在我的AsyncStorage
中
LoginForm.js
所以现在我想基于我的本地存储元素设置.
.
AsyncStorage.setItem('isLoggedIn', 'true').then((a) => {
this.onLoginSuccess(responseData.user_id);
});
.
.
。
如果initialRouteName
为isLoggedIn
,则为简单,然后true
为initialRouteName : Home
简单但不在initialRouteName : Login
my
请帮助:)