gpt4 book ai didi

grails - 为什么IP(域)地址重定向到localhost而不是Grails中的IP(域)

转载 作者:行者123 更新时间:2023-12-02 16:01:30 29 4
gpt4 key购买 nike

这是我的本地域名

http://10.10.1.101/uxsurvey/profile/dashboard

在 Controller 中,我为用户列表设置了一个操作
redirect(controller: "Profile",action:"userlist" ,params: [profileID: email]);

它重新指示 http://localhost/uxsurvey/profile/userlist而不是 http://10.10.1.101/uxsurvey/profile/userlist

最佳答案

如果未指定config属性并且应用程序不在生产环境中运行,则Grails redirect()方法将使用Config.groovy中的grails.serverURL属性作为目标地址或本地主机中的域。因此,您应该在Config.groovy中将grails.serverURL设置为“10.10.1.101”,或者在生产模式下运行应用程序。

关于grails - 为什么IP(域)地址重定向到localhost而不是Grails中的IP(域),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30237489/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com