更改 第一次进入 也会直接跳转列表页
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import React, { useState } from 'react';
|
||||
import { View, Text, Button, Image } from '@tarojs/components';
|
||||
import Taro from '@tarojs/taro';
|
||||
import { wechat_auth_login, save_login_state } from '../../../services/loginService';
|
||||
import { wechat_auth_login, save_login_state, check_login_status } from '../../../services/loginService';
|
||||
import './index.scss';
|
||||
|
||||
const LoginPage: React.FC = () => {
|
||||
@@ -9,6 +9,14 @@ const LoginPage: React.FC = () => {
|
||||
const [agree_terms, set_agree_terms] = useState(false);
|
||||
const [show_terms_layer, set_show_terms_layer] = useState(false);
|
||||
|
||||
let is_login = check_login_status()
|
||||
|
||||
if (is_login) {
|
||||
Taro.redirectTo({
|
||||
url: '/pages/login/index'
|
||||
})
|
||||
}
|
||||
|
||||
// 微信授权登录
|
||||
const handle_wechat_login = async (e: any) => {
|
||||
if (!agree_terms) {
|
||||
|
||||
Reference in New Issue
Block a user