mirror of
https://github.com/jumpserver/lina.git
synced 2025-05-11 17:48:57 +00:00
feat: proxyhost移动到环境变量 feat: 添加README
This commit is contained in:
parent
1961f76132
commit
1ad43e2921
@ -17,3 +17,7 @@ VUE_CLI_BABEL_TRANSPILE_MODULES = true
|
||||
# External auth
|
||||
VUE_APP_LOGIN_PATH = '/core/auth/login/'
|
||||
VUE_APP_LOGOUT_PATH = '/core/auth/logout/'
|
||||
|
||||
|
||||
# Dev server for core proxy
|
||||
VUE_APP_CORE_HOST = 'http://localhost:8080'
|
||||
|
56
README.md
56
README.md
@ -1,25 +1,51 @@
|
||||
#
|
||||
# Lina
|
||||
|
||||
Lina 是 JumpServer 的前端 UI 项目, 主要使用 [Vue](https://cn.vuejs.org/), [Element UI](https://element.eleme.cn/) 完成,
|
||||
名字来源于 Dota 英雄 [Lina](https://baike.baidu.com/item/%E8%8E%89%E5%A8%9C/16693979)
|
||||
|
||||
## 开发运行
|
||||
|
||||
前置条件: 部署运行好 JumpServer API 服务器
|
||||
|
||||
## Project setup
|
||||
```
|
||||
yarn install
|
||||
1. 安装依赖
|
||||
$ yarn install
|
||||
|
||||
2. 修改 .env.development VUE_APP_CORE_HOST
|
||||
# ...
|
||||
VUE_APP_CORE_HOST = 'JUMPSERVER_APIHOST'
|
||||
|
||||
3. 运行
|
||||
$ yarn serve
|
||||
|
||||
4. 构建
|
||||
$ yarn build
|
||||
```
|
||||
|
||||
### Compiles and hot-reloads for development
|
||||
## 生产中部署
|
||||
下载 RELEASE 文件,放到合适的目录,修改 nginx配置文件如下
|
||||
```
|
||||
yarn serve
|
||||
server {
|
||||
listen 80;
|
||||
|
||||
location /ui/ {
|
||||
try_files $uri / /ui/index.html;
|
||||
alias /opt/lina/;
|
||||
}
|
||||
|
||||
location / {
|
||||
rewrite ^/(.*)$ /ui/$1 last;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Compiles and minifies for production
|
||||
```
|
||||
yarn build
|
||||
```
|
||||
## License & Copyright
|
||||
Copyright (c) 2014-2020 飞致云 FIT2CLOUD, All rights reserved.
|
||||
|
||||
### Lints and fixes files
|
||||
```
|
||||
yarn lint
|
||||
```
|
||||
Licensed under The GNU General Public License version 2 (GPLv2) (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
|
||||
|
||||
https://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||
|
||||
### Customize configuration
|
||||
See [Configuration Reference](https://cli.vuejs.org/config/).
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
server {
|
||||
listen 80;
|
||||
|
||||
location ^~ /ui/ {
|
||||
location /ui/ {
|
||||
try_files $uri / /ui/index.html;
|
||||
alias /opt/lina/;
|
||||
}
|
||||
|
@ -41,14 +41,14 @@ module.exports = {
|
||||
// change xxx-api/login => mock/login
|
||||
// detail: https://cli.vuejs.org/config/#devserver-proxy
|
||||
[process.env.VUE_APP_BASE_API]: {
|
||||
target: `http://localhost:8080`,
|
||||
target: process.env.VUE_APP_CORE_HOST,
|
||||
changeOrigin: true,
|
||||
pathRewrite: {
|
||||
['^' + process.env.VUE_APP_BASE_API]: ''
|
||||
}
|
||||
},
|
||||
'^/core/': {
|
||||
target: `http://localhost:8080`,
|
||||
target: process.env.VUE_APP_CORE_HOST,
|
||||
changeOrigin: true
|
||||
}
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user