mirror of
https://github.com/casdoor/casdoor.git
synced 2025-05-23 02:35:49 +08:00
feat: set frontend origin to 7001 if in dev mode (#3615)
This commit is contained in:
parent
f2e3037bc5
commit
cc82d292f0
@ -77,6 +77,7 @@ func getOriginFromHostInternal(host string) (string, string) {
|
|||||||
return origin, origin
|
return origin, origin
|
||||||
}
|
}
|
||||||
|
|
||||||
|
isDev := conf.GetConfigString("runmode") == "dev"
|
||||||
// "door.casdoor.com"
|
// "door.casdoor.com"
|
||||||
protocol := "https://"
|
protocol := "https://"
|
||||||
if !strings.Contains(host, ".") {
|
if !strings.Contains(host, ".") {
|
||||||
@ -87,7 +88,7 @@ func getOriginFromHostInternal(host string) (string, string) {
|
|||||||
protocol = "http://"
|
protocol = "http://"
|
||||||
}
|
}
|
||||||
|
|
||||||
if host == "localhost:8000" {
|
if host == "localhost:8000" && isDev {
|
||||||
return fmt.Sprintf("%s%s", protocol, "localhost:7001"), fmt.Sprintf("%s%s", protocol, "localhost:8000")
|
return fmt.Sprintf("%s%s", protocol, "localhost:7001"), fmt.Sprintf("%s%s", protocol, "localhost:8000")
|
||||||
} else {
|
} else {
|
||||||
return fmt.Sprintf("%s%s", protocol, host), fmt.Sprintf("%s%s", protocol, host)
|
return fmt.Sprintf("%s%s", protocol, host), fmt.Sprintf("%s%s", protocol, host)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user