若依框架调试:遇到的问题及解决步骤

若依框架调试:遇到的问题及解决步骤,第1张

若依框架调试:遇到的问题及解决步骤

关于若依项目调试出现的问题:

Hbiuld启动项目报如下错误:

Proxy error: Could not proxy request /logout from localhost to http://localhost:81/.
See https://nodejs.org/api/errors.html#errors_common_system_errors for more information (ECONNREFUSED).

启动前端项目,报404异常。

系统接口404异常

初步断定是端口号问题

更改前端端口号后,报500错误.更改vue.config.js的后台端口,

前端两处位置:在vue.config.js文件中

const port = process.env.port || process.env.npm_config_port || 8092 // 端口
target: `http://localhost:8092`,



后端一处位置:在application.yml文件中

server:
  # 服务器的HTTP端口,默认为8080
  port: 8092


顺利进入页面,报如下错误:

Error querying database. Cause: java.sql.SQLSyntaxErrorException: Unknown column 'type' in 'field list'

Hbuild启动项目报错误:

When `proxy` in package.json is an object, each `context` object must have a `target` property specified as a url string

启动后端项目:

尝试一个端口,端口占用,

尝试另一个端口,端口也被占用

escription:

Web server failed to start. Port 8088 was already in use.

Action:

Identify and stop the process that's listening on port 8088 or configure this application to listen on another port.

Disconnected from the target VM, address: '127.0.0.1:56493', transport: 'socket'

Process finished with exit code 1

Web server failed to start. Port 8090 was already in use.
Description:

Web server failed to start. Port 8090 was already in use.

Action:

Identify and stop the process that's listening on port 8090 or configure this application to listen on another port.

Disconnected from the target VM, address: '127.0.0.1:64665', transport: 'socket'

Process finished with exit code 1
Web server failed to start. Port 80 was already in use.
Description:

Web server failed to start. Port 80 was already in use.

Action:

Identify and stop the process that's listening on port 80 or configure this application to listen on another port.

Disconnected from the target VM, address: '127.0.0.1:64728', transport: 'socket'

Process finished with exit code 1

解决方法:

重启电脑,回退版本,重新更改前后端口号为8090,发现vue.config.js的proxy中target没写,示例:

target: `http://localhost:8090`,

加上之后,解决!

问题:Hbuilder定义8090接口,为什么打开的是8091?Hbuilder定义8092接口,为什么打开的是8093?

注意:每次前端要改两个地方:

解答:

使用:

看起来正常了,点击运行:

回退版本:
解决了

通过本次事件,学到了:前端target里面写的是设定的后端地址,可以和后端地址的port一样,

const post 里面是前端地址,不能和后端地址设定的一样,不然会报错。

windows环境下如何干掉进程?

netstat -o -n -a | findstr:端口号
taskill /F /PID 序列号

如图:

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/5703725.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-17
下一篇 2022-12-17

发表评论

登录后才能评论

评论列表(0条)

保存