File tree Expand file tree Collapse file tree 4 files changed +30
-15
lines changed
react-web/src/main/frontend/src/services/login Expand file tree Collapse file tree 4 files changed +30
-15
lines changed Original file line number Diff line number Diff line change 66 <img src =" https://img.shields.io/badge/Spring%20Cloud-2020.0.5-blue " alt =" Downloads " />
77 <img src =" https://img.shields.io/badge/Spring%20Cloud%20Alibaba-2021.1-blue " alt =" Downloads " />
88 <img src =" https://img.shields.io/badge/Elasticsearch-7.x-brightgreen " alt =" Downloads " />
9+ <img src =" https://img.shields.io/badge/Ant%20Design-pro-9cf " alt =" Downloads " />
910 <a target =" _blank " href =' https://gitee.com/zlt2000/microservices-platform ' >
1011 <img src='https://gitee.com/zlt2000/microservices-platform/badge/star.svg' alt='star'/>
1112 </a >
@@ -97,7 +98,8 @@ central-platform -- 父项目,公共依赖
9798│ ├─zlt - uaa -- spring-security认证中心[8000]
9899│ ├─zlt - register -- 注册中心Nacos[8848]
99100│ ├─zlt - web -- 前端一级工程
100- │ │ ├─back - web -- 后台前端[8066]
101+ │ │ ├─layui - web -- layui前端[8066]
102+ │ │ ├─react - web -- react前端[8066]
101103│ ├─zlt - transaction -- 事务一级工程
102104│ │ ├─txlcn - tm -- tx-lcn事务管理器[7970]
103105│ ├─zlt - demo -- demo一级工程
Original file line number Diff line number Diff line change 1515 <java .version>8</java .version>
1616 <spring-cloud-alibaba-dependencies .version>2021.1</spring-cloud-alibaba-dependencies .version>
1717 <spring-boot-dependencies .version>2.5.14</spring-boot-dependencies .version>
18- <spring-cloud-dependencies .version>2020.0.5 </spring-cloud-dependencies .version>
18+ <spring-cloud-dependencies .version>2020.0.6 </spring-cloud-dependencies .version>
1919 <commons-collections4 .version>4.4</commons-collections4 .version>
2020 <swagger .butler.version>2.0.1</swagger .butler.version>
2121 <jjwt .version>0.9.1</jjwt .version>
Original file line number Diff line number Diff line change 3333#### 2.1.2. 方式二:静态服务器运行
3434把 ` layui-web\src\main\resources\static ` 下的内容复制到类似 ` Nginx ` 之类的静态服务器运行。
3535
36+ #### 2.1.3. 后端接口地址修改
37+ 修改 ` layui-web\src\main\resources\static\module\apiUrl.js ` 中的地址。
38+
3639  ;
3740### 2.2. react-web
3841** 以下 3 种运行方式,选一种运行即可。**
@@ -50,12 +53,33 @@ npm install
5053
5154运行成功后,浏览器访问:http://localhost:8066
5255
56+ ##### 2.2.1.3. 后端接口地址修改
57+ 修改 ` react-web\src\main\frontend\config\proxy.ts ` 中的地址。
58+
5359  ;
5460#### 2.2.2. 方式二:静态服务器运行
61+ ##### 2.2.2.1. 源码编译
5562运行 ` frontend\build.bat ` 文件或者执行 ` npm run build ` 命令进行编译。
5663
5764编译成功后,把 ` react-web\src\main\frontend\dist ` 下的内容复制到类似 ` Nginx ` 之类的静态服务器运行。
5865
66+ ##### 2.2.2.2. 后端接口地址修改
67+ 通过反向代理,例如 ` Nginx ` 的配置如下:
68+ ``` json
69+ location ~ ^/api-* {
70+ proxy_set_header X-Real-IP $remote_addr;
71+ proxy_set_header X-Real-Port $remote_port;
72+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
73+ proxy_pass http://127.0.0.1:9900;
74+ }
75+
76+ location / {
77+ root /usr/share/nginx/html;
78+ index index.html;
79+ expires 7d;
80+ }
81+ ```
82+
5983  ;
6084#### 2.2.3. 方式三:使用Java运行
6185模块已集成Maven插件` frontend-maven-plugin ` 用于编译前端代码
@@ -71,17 +95,6 @@ java -jar zlt-web-5.4.0.jar
7195或者直接在IDE中运行 ` react-web\src\main\java\ui\ReactUiBootApplication.java `
7296> 运行前必需先使用 maven 对 react-web 工程进行编译或打包。
7397
74-   ;
75- ## 三、后端接口地址修改
76- 两个前端默认请求的后端接口地址默认都是:http://127.0.0.1:9900/
77-
78- ### 3.1. layui-web
79- 修改 ` layui-web\src\main\resources\static\module\apiUrl.js ` 中的地址。
80-
81-   ;
82- ### 3.2. react-web
83- 修改 ` react-web\src\main\frontend\config\proxy.ts ` 中的地址。
84-
8598  ;
8699## 四、More
87100开发参考
Original file line number Diff line number Diff line change @@ -26,8 +26,8 @@ export async function fetchMenuData(options?: { [key: string]: any }) {
2626
2727/** 退出登录接口 POST /api/login/outLogin */
2828export async function outLogin ( options ?: { [ key : string ] : any } ) {
29- return request < Record < string , any > > ( '/api/login/outLogin ' , {
30- method : 'POST ' ,
29+ return request < Record < string , any > > ( '/api-uaa/oauth/remove/token ' , {
30+ method : 'GET ' ,
3131 ...( options || { } ) ,
3232 } ) ;
3333}
You can’t perform that action at this time.
0 commit comments