更改 第一次进入 也会直接跳转列表页

This commit is contained in:
张成
2025-09-02 10:40:25 +08:00
parent 63e6494b69
commit b50d9dba1d
3 changed files with 17 additions and 6 deletions

View File

@@ -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) {