为什么在Grails中IP(域)地址重定向到本地主机而不是IP(域)

为什么在Grails中IP(域)地址重定向到本地主机而不是IP(域),grails,Grails,这是我的本地域名 http://10.10.1.101/uxsurvey/profile/dashboard 在控制器中,我为userlist设置了一个操作 redirect(controller: "Profile",action:"userlist" ,params: [profileID: email]); 它预示着http://localhost/uxsurvey/profile/userlist 而不是http://10.10.1.101/uxsurvey/profile/user

这是我的本地域名

http://10.10.1.101/uxsurvey/profile/dashboard
在控制器中,我为userlist设置了一个操作

redirect(controller: "Profile",action:"userlist" ,params: [profileID: email]);
它预示着http://localhost/uxsurvey/profile/userlist 而不是http://10.10.1.101/uxsurvey/profile/userlist

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