用户2823606
用户2823606
  • 发布:2025-05-27 10:05
  • 更新:2025-05-27 10:07
  • 阅读:59

【报Bug】编译后小程序里uni.redirectTo不生效

分类:uni-app

产品分类: uniapp/小程序/微信

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: 11

第三方开发者工具版本号: vscode

基础库版本号: /

项目创建方式: CLI

CLI版本号: uni-preset-vue-vite-ts

示例代码:
<template>  
  <view class="content">  
    <image class="logo" src="/static/logo.png" />  
    <view class="text-area" @click="toPage">  
      <text class="title">{{ title }}</text>  
    </view>  
  </view>  
</template>  

<script setup lang="ts">  
import { ref } from 'vue'  
const title = ref('Hello')  

const toPage = () => {  
  uni.navigateTo({  
    url:"/pages/test/index",  
  })  
}  
</script>

操作步骤:

https://gitee.com/dcloud/uni-preset-vue/tree/vite-ts 拉取代码后添加页面跳转方法,编译后在微信小程序打开

预期结果:

编译后小程序正常跳转页面

实际结果:

编译后小程序里页面不跳转

bug描述:

该框架编译后小程序里uni.redirectTo,uni.navigateTo都不生效,dev:h5正常跳转,pages.json里配了路径,不是跳转tabber页

2025-05-27 10:05 负责人:无 分享
已邀请:
DCloud_UNI_JBB

DCloud_UNI_JBB

控制台有没有报错?

  • 用户2823606 (作者)

    Error: MiniProgramError

    {"errMsg":"redirectTo:fail Error: INVALID_LOGIN,access_token expired [20250527 10:16:33][touristappid]"}

    有一个,是不能用游客模式吗

    2025-05-27 10:17

  • DCloud_UNI_JBB

    回复 用户2823606: 你登录试试还有没有这个报错

    2025-05-27 10:22

  • 用户2823606 (作者)

    回复 DCloud_UNI_JBB: 登录就可以了,感谢感谢

    2025-05-27 10:31

要回复问题请先登录注册