Fix edition of source with redirections outside happyDNS
This commit is contained in:
parent
74a3b62861
commit
e5476f884b
|
@ -87,6 +87,7 @@ func getSourceSettingsState(cfg *config.Options, req *RequestResources, body io.
|
|||
if uss.Recall != nil {
|
||||
req.Session.GetValue(fmt.Sprintf("source-creation-%d", *uss.Recall), src)
|
||||
req.Session.GetValue(fmt.Sprintf("source-creation-%d-name", *uss.Recall), &uss.Name)
|
||||
req.Session.GetValue(fmt.Sprintf("source-creation-%d-id", *uss.Recall), &uss.Id)
|
||||
req.Session.GetValue(fmt.Sprintf("source-creation-%d-next", *uss.Recall), &uss.Redirect)
|
||||
}
|
||||
|
||||
|
@ -104,6 +105,7 @@ func getSourceSettingsState(cfg *config.Options, req *RequestResources, body io.
|
|||
key, recallid := req.Session.FindNewKey("source-creation-")
|
||||
req.Session.SetValue(key, src)
|
||||
req.Session.SetValue(key+"-name", uss.Name)
|
||||
req.Session.SetValue(key+"-id", uss.Id)
|
||||
if uss.Redirect != nil {
|
||||
req.Session.SetValue(key+"-next", *uss.Redirect)
|
||||
}
|
||||
|
|
|
@ -87,7 +87,7 @@ export default {
|
|||
},
|
||||
state: {
|
||||
type: Number,
|
||||
default: 1
|
||||
default: 0
|
||||
},
|
||||
value: {
|
||||
type: Object,
|
||||
|
|
|
@ -58,10 +58,11 @@ export default {
|
|||
response => {
|
||||
if (response.data.form) {
|
||||
this.form = response.data.form
|
||||
if (cbSuccess) {
|
||||
this.state = toState
|
||||
if (response.data.redirect && window.location.pathname !== response.data.redirect) {
|
||||
this.$router.push(response.data.redirect)
|
||||
} else if (cbSuccess) {
|
||||
cbSuccess(toState)
|
||||
} else {
|
||||
this.state = toState
|
||||
}
|
||||
} else if (response.data.Source) {
|
||||
this.$root.$bvToast.toast(
|
||||
|
@ -72,12 +73,13 @@ export default {
|
|||
toaster: 'b-toaster-content-right'
|
||||
}
|
||||
)
|
||||
this.state = toState
|
||||
if (response.data.redirect && window.location.pathname !== response.data.redirect) {
|
||||
this.$router.push(response.data.redirect)
|
||||
} else if (cbSuccess) {
|
||||
cbSuccess(toState, response.data.Source)
|
||||
} else {
|
||||
this.state = toState
|
||||
this.$router.push('/sources/' + encodeURIComponent(response.data.Source._id) + '/domains')
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue
Block a user