修正跳转Url

This commit is contained in:
Jack Zhuang 2017-12-14 09:23:25 +08:00
parent 5ae26b3e20
commit cecb5e3f9d
2 changed files with 7 additions and 9 deletions

View File

@ -12,7 +12,7 @@ Template.creator_view.helpers
return Creator.getObjectRecord()
backUrl: ()->
return Creator.getObjectUrl()
return Creator.getObjectUrl(Session.get("object_name"), null)
showForm: ()->
if Creator.getObjectRecord()

View File

@ -164,15 +164,13 @@ Creator.getObjectColumns = (obj, list_view) ->
cols.push(col)
return cols
Creator.getObjectUrl = (object_name, id) ->
if !object_name
object_name = Session.get("object_name")
if !object_id
object_id = Session.get("object_id")
if id
return Steedos.absoluteUrl("/creator/app/" + object_name + "/view/" + id)
Creator.getObjectUrl = (object_name, object_id, app_name) ->
if !app_name
app_name = Session.get("app_name")
if object_id
return Steedos.absoluteUrl("/creator/" + app_name + "/" + object_name + "/view/" + object_id)
else
return Steedos.absoluteUrl("/creator/app/" + object_name + "/list")
return Steedos.absoluteUrl("/creator/" + app_name + "/" + object_name + "/list")
Creator.getObject = (object_name)->