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

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

@@ -3,17 +3,20 @@ export default defineAppConfig({
'pages/login/index/index', 'pages/login/index/index',
'pages/login/verification/index', 'pages/login/verification/index',
'pages/login/terms/index', 'pages/login/terms/index',
'pages/publishBall/index',
'pages/list/index', // 列表页 'pages/list/index', // 列表页
'pages/search/index', // 搜索页 'pages/search/index', // 搜索页
'pages/searchResult/index', // 搜索结果页面 'pages/searchResult/index', // 搜索结果页面
'pages/userInfo/myself/index', 'pages/publishBall/index',
// 'pages/mapDisplay/index',
'pages/detail/index', 'pages/detail/index',
'pages/message/index', 'pages/message/index',
'pages/personal/index', 'pages/personal/index',
'pages/orderCheck/index', 'pages/orderCheck/index',
'pages/userInfo/myself/index', // 个人中心
// 'pages/mapDisplay/index',
], ],
window: { window: {
backgroundTextStyle: 'light', backgroundTextStyle: 'light',

View File

@@ -37,7 +37,7 @@ const GuideBar = (props) => {
let url = `/pages/${code}/index` let url = `/pages/${code}/index`
if (code === 'personal') { if (code === 'personal') {
url = 'pages/userInfo/myself/index' url = '/pages/userInfo/myself/index'
} }
Taro.navigateTo({ Taro.navigateTo({
url: url, url: url,

View File

@@ -1,7 +1,7 @@
import React, { useState } from 'react'; import React, { useState } from 'react';
import { View, Text, Button, Image } from '@tarojs/components'; import { View, Text, Button, Image } from '@tarojs/components';
import Taro from '@tarojs/taro'; 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'; import './index.scss';
const LoginPage: React.FC = () => { const LoginPage: React.FC = () => {
@@ -9,6 +9,14 @@ const LoginPage: React.FC = () => {
const [agree_terms, set_agree_terms] = useState(false); const [agree_terms, set_agree_terms] = useState(false);
const [show_terms_layer, set_show_terms_layer] = 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) => { const handle_wechat_login = async (e: any) => {
if (!agree_terms) { if (!agree_terms) {