现象
在这里插入图片描述

参考文档:
uni-app H5端 “网络不给力” 排查日记

备注:

不一定是网络问题,有可能是代码问题,不要被提示忽悠了,记得看控制台代码,代码报错解决了,报错也就解决了

history 模式。跳转页面时出现
Uncaught SyntaxError: Unexpected token ‘<‘

UNI-APP 路由MODE是HISTORY NGINX配置

nginx 配置

location ^~ /wxview {
        alias   html/wxview;
        try_files $uri $uri/ /index.html last;
        index  index.html index.htm;
        
    }
   
    location /api{
            #proxy_pass "https://www.cq-ct.tech:36361/wellpay";
       	proxy_pass "https://wellpay.wollow.tech:36361/wellpay";
  	 }
  	 

uni-app 配置页面

在这里插入图片描述

在这里插入图片描述

删掉 publicPath 一切都正常了

uni-app 官网解释publicPath

在这里插入图片描述

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐