Comments (2)
一. 后台是zuihou-admin-cloud项目时,请参考本条
- 确保nacos、GatewayServerApplication、OauthApplication 启动成功
- 谷歌浏览器访问: http://127.0.0.1:8760/api/oauth/anno/captcha?key=123 , 若能显示验证码,说明后端代码没问题,需要检查前端配置
- npm run dev 启动的, 检查 .env.development
# 后端为 zuihou-admin-cloud 项目: http://127.0.0.1:8760 表示zuihou-gateway-server服务的访问地址,非本机访问,请配置内网ip
# 后端为 zuihou-admin-boot 项目: http://127.0.0.1:8760 表示zuihou-authority-server服务的访问地址,非本机访问,请配置内网ip
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'
- npm run dev启动的, 检查 vue.config.js
proxy: {
[proxyUrl]: {
target: targetUrl,
changeOrigin: true,
pathRewrite: {
// zuihou-admin-cloud 项目使用这段配置
['^' + proxyUrl]: proxyUrl
// zuihou-admin-boot 项目 请使用以下的配置
// ['^/api/oauth']: '/',
// ['^/api/authority']: '/',
// ['^/api/file']: '/',
// ['^/api/msgs']: '/',
// ['^/api/gate']: '/',
// ['^/api/tenant']: '/',
}
}
}
- npm run build:prod 打包成静态文件后,通过nginx 代理访问的, 检查 .env.production
# 请求域名前缀, 将该参数配置成 nginx 的IP + nginx 的端口
VUE_APP_PROD_REQUEST_DOMAIN_PREFIX = 'http://tangyh.top:10000'
- . npm run build:prod 打包成静态文件后,通过nginx 代理访问的,检查nginx配置文件
server {
listen 10000;
server_name localhost;
underscores_in_headers on;
# 将 npm run build:prod 打包后的 zuihou-ui 文件夹,放到 /data/projects/ 目录下
location /zuihou-ui {
proxy_set_header Host $host:$server_port;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_connect_timeout 60;
proxy_read_timeout 600;
proxy_send_timeout 600;
root /data/projects/;
index index.html;
}
# 切记, 在docker启动的nginx 必须将该文件中所有的 localhost 改成服务器的 内网ip (不能为 127.0.0.1)
# http://localhost:8760/api 改成 网关服务的 ip + port
location /api {
proxy_set_header Host $host:$server_port;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_connect_timeout 60;
proxy_read_timeout 600;
proxy_send_timeout 600;
proxy_pass http://localhost:8760/api;
}
}
- 谷歌浏览器访问: http://127.0.0.1:8760/api/oauth/anno/captcha?key=123 , 若不能显示验证码,说明后端代码有问题,debug OauthController#captcha
public class OauthController {
@ApiOperation(value = "验证码", notes = "验证码")
@GetMapping(value = "/captcha", produces = "image/png")
public void captcha(@RequestParam(value = "key") String key, HttpServletResponse response) throws IOException {
this.validateCodeService.create(key, response);
}
}
- 若断点无法进入该方法,浏览器访问:http://127.0.0.1:8773/anno/captcha?key=123 , 若该接口能显示验证码图片,但上一步的接口无法显示:
- 可能的问题1: 说明gateway、oauth服务没有成功注册到nacos,请认真阅读看云文档快速开始的所有子章节: https://www.kancloud.cn/zuihou/zuihou-admin-cloud/1284756
- 可能的问题2:你使用了公网上部署的nacos 、或者部署的gateway服务和oauth服务的服务器网络不通。 解决方案: nacos、gateway、oauth 等服务要使用内网IP,且服务器之间内网互通,防火墙关闭。
from lamp-cloud.
二. 后台是zuihou-admin-boot项目时,请参考本条
- 确保OauthApplication 启动成功
- 谷歌浏览器访问: http://127.0.0.1:8760/anno/captcha?key=123 , 若能显示验证码,说明后端代码没问题,需要检查前端配置
- npm run dev 启动的, 检查 .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'
- npm run dev启动的, 检查 vue.config.js
proxy: {
[proxyUrl]: {
target: targetUrl,
changeOrigin: true,
pathRewrite: {
['^/api/oauth']: '/',
['^/api/authority']: '/',
['^/api/file']: '/',
['^/api/msgs']: '/',
['^/api/gate']: '/',
['^/api/tenant']: '/',
}
}
}
- npm run build:prod 打包成静态文件后,通过nginx 代理访问的, 检查 .env.production
# 请求域名前缀, 将该参数配置成 nginx 的IP + nginx 的端口
VUE_APP_PROD_REQUEST_DOMAIN_PREFIX = 'http://tangyh.top:10000'
- . npm run build:prod 打包成静态文件后,通过nginx 代理访问的,检查nginx配置文件
server {
listen 10000;
server_name localhost;
underscores_in_headers on;
# 将 npm run build:prod 打包后的 zuihou-ui 文件夹,放到 /data/projects/ 目录下
location /zuihou-ui {
proxy_set_header Host $host:$server_port;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_connect_timeout 60;
proxy_read_timeout 600;
proxy_send_timeout 600;
root /data/projects/;
index index.html;
}
location /api/authority/ {
proxy_pass http://192.168.1.34:8760/;
}
location /api/oauth/ {
proxy_pass http://192.168.1.34:8760/;
}
location /api/file/ {
proxy_pass http://192.168.1.34:8760/;
}
location /api/msgs/ {
proxy_pass http://192.168.1.34:8760/;
}
location /api/gate/ {
proxy_pass http://localhost:8760/;
}
location /api/tenant/ {
proxy_pass http://localhost:8760/;
}
}
- 谷歌浏览器访问: http://127.0.0.1:8760/anno/captcha?key=123 , 若不能显示验证码,说明后端代码有问题,debug OauthController#captcha
public class OauthController {
@ApiOperation(value = "验证码", notes = "验证码")
@GetMapping(value = "/captcha", produces = "image/png")
public void captcha(@RequestParam(value = "key") String key, HttpServletResponse response) throws IOException {
this.validateCodeService.create(key, response);
}
}
from lamp-cloud.
Related Issues (20)
- 后端启动的时候正常,前端刷新页面报系统繁忙,后台报Cause: java.sql.SQLSyntaxErrorException: Unknown column 'size' in 'field list' HOT 4
- 文档无法查看,报错! HOT 1
- Entity与SuperEntity未加注解@EqualsAndHashCode(callSuper = true)导致子类继承后即便加上该注解hashCode也不一致,调用.equals将返回false HOT 2
- 跨服务回显org时如果在redis中无相应key value将直接往redis插入key,null键值对,导致回显错误 HOT 4
- schema 模式下的多租户. seata 分布式事务问题. 回滚如何找到schema的. HOT 1
- searchFormSchema内定义一个solt 如何在BasicTable展示 ? HOT 2
- BasicTable columns内容多 表头和内容没有对齐 HOT 5
- 验证码接口404 HOT 8
- lamp-web前端代码无法安装依赖 HOT 2
- lamp-cloud如何同时插入三张表的数据 HOT 1
- 删除租户报错 HOT 1
- 企业版lamp-web-pro 4.13.0启动后访问报错 HOT 1
- lamp-boot-pro-datasource-column版本 登录日志和操作日志没有起作用 HOT 2
- ApiSelect HOT 6
- 无效的基本身份验证令牌 HOT 11
- 租户维护:租户已经过了有效期,租户管理员还可以继续登录。 HOT 2
- 邮箱问题 HOT 1
- 创建缓存key时失败 HOT 6
- 将本地的nacos 切换到远程服务器 启动报错 HOT 5
- 项目中切换了数据源 如何在xxl-job中切换数据源 现在是否支持 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lamp-cloud.