添加 basePath 配置,不然非根目录情况,无法访问

pull/1/head
sin 2019-04-01 17:29:36 +08:00
parent 2e2ceaf38b
commit 8e7d72ce71
2 changed files with 5 additions and 3 deletions

View File

@ -65,7 +65,7 @@ if (APP_TYPE === 'site') {
export default {
// add for transfer to umi
base: basePath,
// publicPath: basePath,
publicPath: basePath,
plugins,
define: {
APP_TYPE: APP_TYPE || '',

View File

@ -28,17 +28,19 @@ npm run build:admin-web
cp -rf dist app/server
# 复制文件到 project 目录执行
if [ ! -d "/work2/project/admin-web/server/dist" ]; then
mkdir -pv /work2/project/admin-web/server/dist
else
rm -rf /work2/project/admin-web/server/dist
fi
cp -rf app/server /work2/project/admin-web
# 安装 server 依赖项
cd /work2/project/admin-web/server
cnpm install
npm install
# 启动服务
pm2 restart pm2.json