Umi: 项目部署到非根目录,如何配置,让url匹配上?

Created on 18 Mar 2018  ·  4Comments  ·  Source: umijs/umi

.umi 文件夹下的 umi.js 不可编辑,如何修改 createHistory basename ?是否可以通过配置 .umirc.js 解决?

import createHistory from 'umi/_createHistory';
// create history
window.g_history = createHistory({
  basename: window.routerBase,
});

dva2问题#1497

type(question)

Most helpful comment

All 4 comments

@sorrycc 我配置了 base 部署到非根目录 /sub-path/ ,在页面内部能正常路由。但是如果直接通过地址栏访问特定页面的完整路径,如 /sub-path/login ,就不行了。还有什么我没注意到吗?

猜测可能是和服务器配置有关,由于我是部署在 Github Pages 的,所以暂时也不知道怎么搞了

Was this page helpful?
0 / 5 - 0 ratings

Related issues

afc163 picture afc163  ·  3Comments

y2891663091 picture y2891663091  ·  4Comments

tauruswang picture tauruswang  ·  3Comments

ddzy picture ddzy  ·  3Comments

ironyfive picture ironyfive  ·  3Comments