这是我的本地域名
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/