2025-06-30 09:38:03 +08:00

108 lines
2.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

## 一 环境要求
### 1.1 开发环境
- 操作系统:`Windows 10/11``MacOS`
- `Node 16.15.0` 及以上版本(某些情况下可能需要安装 `Python3` 环境)
- `pnpm v8.1.0`及以上版本;
- 浏览器推荐使用 `Chrome 90`及以上版本;
- `Visual Studio Code` (简称VSCode)
### 1.2 运行环境
`Nginx 1.18.0` 及以上版本或 `TongHttpServer 6.0` (信创环境)
## 二 浏览器支持
> 支持现代浏览器不支持IE
| IE | Edge | Firefox | Chrome | Safari |
| --- | --- | --- | --- | --- |
| not support | last 2 versions | last 2 versions | last 2 versions | last 2 versions |
## 三 关联项目
> 需要使用下表中的对应分支
| 项目 | 分支 | 分支(Coding) | 说明 |
| --- | --- | --- | --- |
| **后端**(任一后端服务) | | | |
| jnpf-java-tenant | v3.6.x | v3.6.x-stable | Java多租户项目源码 |
| jnpf-dotnet-tenant | v3.6.x | v3.6.x-stable | .NET多租户项目源码 |
## 四 使用说明
### 4.1 开发环境
#### 4.1.1 安装pnpm
> 推荐使用 `pnpm`,若使用 `yarn` ,建议使用 `Yarn v1.22.x` 版本,否则可能出现依赖安装失败的情况。
在Windows的`PowerShell`中执行如下命令
```bash
iwr https://get.pnpm.io/install.ps1 -useb | iex
```
MacOS 通过 `Homebrew` 安装 `pnpm`<br/>
若已经安装了 `Homebrew` 软件包管理器,则可以使用如下命令赖安装 pnpm
```bash
brew install pnpm
```
也可以通过 npm 安装 pnpm
```bash
npm install -g pnpm
npm install -g @pnpm/exe
```
#### 4.1.2 安装依赖
使用如下命令安装项目依赖
```bash
pnpm install
```
#### 4.1.3 后端接口配置
修改项目根目录 `.env.development` 中的后端接口地址
- Java单体多租户项目默认接口地址`http://localhost:30006`
- Java微服务租户默认接口地址`http://localhost:30000`
- .NET单体多租户项目默认接口地址`http://localhost:5100`
- .NET微服务租户默认接口地址`http://localhost:5000`
```bash
# 第7行配置后端接口
VITE_PROXY = [["/dev","http://localhost:30000"]]
```
#### 4.1.4 本地运行
完成上述操作后,使用如下命令运行前端项目
```bash
pnpm dev
```
### 4.2 运行环境
> 测试或生产环境
如果需要测试或生产环境发布,使用如下命令打包项目
```bash
pnpm build
```
然后将项目根目录下 `/dist/` 中所有的文件上传至服务器。
## 五 常见问题
### 5.1 修改项目基本信息
打开项目根目录 `.env` 文件,可以看到 `本地运行端口号``网站标题``简称` 等配置。
```bash
# 端口号
VITE_PORT = 3600
# 网站标题
VITE_GLOB_APP_TITLE = JNPF快速开发平台
# 简称,用于配置文件名字 不要出现空格、数字开头等特殊字符
VITE_GLOB_APP_SHORT_NAME = jnpf
```