ZhongWei-DuoChaXun/DuoChaXun-Web/README.md

78 lines
1.3 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<<<<<<< HEAD
#### Build Setup
``` bash
=======
#### Build Setup
```bash
>>>>>>> 7e1b048 (no message)
# 安装依赖
npm install
# 启动服务 localhost:8013
npm run dev
# 构建生产环境
npm run build:prod
```
#### 常见问题
1linux 系统在安装依赖的时候会出现 node-sass 无法安装的问题
解决方案:
<<<<<<< HEAD
=======
>>>>>>> 7e1b048 (no message)
```
1. 单独安装npm install --unsafe-perm node-sass
2. 直接使用npm install --unsafe-perm
```
2、加速node-sass安装
https://www.ydyno.com/archives/1219.html
<<<<<<< HEAD
=======
# 单前端部署,使用多查询
1.去掉登录验证,在router/index.js
```
else {
/* has no token*/
if (whiteList.indexOf(to.path) !== -1) { // 在免登录白名单,直接进入
next()
} else {
next(`/login?redirect=${to.fullPath}`) // 否则全部重定向到登录页
NProgress.done()
    }
}
```
修改为
```
} else {
if (!store.getters.loadMenus) {
// 修改成false防止死循环
store.dispatch('updateLoadMenus')
loadMenus(next, to)
}else{
next()
}
}
```
2.修改loadMenus 接口地址,并在 老项目中添加接口,返回对应的数据,(菜单路由数据)
>>>>>>> 7e1b048 (no message)