# lamp-web 简介 # 开发环境启动 1. 自行安装 node、npm 环境 ~~~ $ node -v v10.16.3 $ npm -v 6.9.0 ~~~ 2. clone 项目: - github : https://github.com/zuihou/lamp-web.git - gitee : https://gitee.com/zuihou111/lamp-web.git 3. 修改前端配置文件 [.env.development](https://github.com/zuihou/lamp-web/blob/master/.env.development) : ~~~ VUE_APP_DEV_REQUEST_DOMAIN_PREFIX = 'http://127.0.0.1:8760' # 请求域名前缀, 该变量仅仅生产环境需要设置 VUE_APP_PROD_REQUEST_DOMAIN_PREFIX = '' # URI 前缀,用于根据URI前缀进行代理 VUE_APP_BASE_API = '/api' # 租户类型 必须跟后端项目 mysql.yml 中 lamp.database.multiTenantType 配成一样. 可选项:NONE、COLUMN、SCHEMA、DATASOURCE VUE_APP_IS_MULTI_TENANT_TYPE = SCHEMA # 登录页面是否显示验证码 VUE_APP_IS_CAPTCHA = true # 客户端秘钥 (密钥必须在c_application表提前配置) VUE_APP_CLIENT_ID=lamp_web VUE_APP_CLIENT_SECRET=lamp_web_secret ~~~ 4. 修改 [vue.config.js](https://github.com/zuihou/lamp-web/blob/master/vue.config.js) 文件 ~~~ proxy: { [proxyUrl]: { target: targetUrl, changeOrigin: true, pathRewrite: { ['^' + proxyUrl]: proxyUrl, } } } ~~~ 5. 安装 ~~~ # 安装依赖 npm install --registry=https://registry.npm.taobao.org # 若你是m1 芯片,请使用如下命令 # 感谢 https://github.com/WZR8277 用户提供的解决方案 npm install --ignore-scrips --registry=https://registry.npm.taobao.org ~~~ 6. 有报错怎么办? ``` 逐个试试下面的方法: npm i node-sass --sass_binary_site=https://npm.taobao.org/mirrors/node-sass/ git config --global url."https://".insteadOf git:// npm install chromedriver --chromedriver_cdnurl=http://cdn.npm.taobao.org/dist/chromedriver cnpm install core-js@2.6.9 # 还不行?学会搜索吧... 我也不知道如何解决。 ``` 7. 启动 ~~~ npm run dev ~~~ 8. 访问 [http://localhost:8080](http://localhost:8080/) 9. 前端文档: lamp-web 项目基于 `vue-element-admin` 和 `element-ui` ,详细的使用文档请参考他们的官方文档: - https://panjiachen.gitee.io/vue-element-admin-site/zh/ - https://element.eleme.cn/