mirror of
https://github.com/eyebluecn/tank.git
synced 2024-04-21 12:32:16 +00:00
feat: add root dir support.
This commit is contained in:
@@ -232,7 +232,7 @@ func (this *MatterController) Crawl(writer http.ResponseWriter, request *http.Re
|
|||||||
|
|
||||||
var dirMatter *Matter
|
var dirMatter *Matter
|
||||||
if puuid == "" {
|
if puuid == "" {
|
||||||
dirMatter = this.matterDao.CheckByUuid(puuid)
|
dirMatter = this.matterDao.CheckWithRootByUuid(puuid, space)
|
||||||
if dirMatter.SpaceUuid != space.Uuid {
|
if dirMatter.SpaceUuid != space.Uuid {
|
||||||
panic(result.UNAUTHORIZED)
|
panic(result.UNAUTHORIZED)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ func (this *MatterDao) CheckWithRootByUuid(uuid string, space *Space) *Matter {
|
|||||||
var matter *Matter
|
var matter *Matter
|
||||||
if uuid == MATTER_ROOT {
|
if uuid == MATTER_ROOT {
|
||||||
if space == nil {
|
if space == nil {
|
||||||
panic(result.BadRequest("user cannot be null."))
|
panic(result.BadRequest("space cannot be null."))
|
||||||
}
|
}
|
||||||
matter = NewRootMatter(space)
|
matter = NewRootMatter(space)
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -151,11 +151,12 @@ func (this *Matter) FetchPropMap() map[string]string {
|
|||||||
func (this *Matter) SetPropMap(propMap map[string]string) {
|
func (this *Matter) SetPropMap(propMap map[string]string) {
|
||||||
|
|
||||||
//恢复panic
|
//恢复panic
|
||||||
//defer func() {
|
defer func() {
|
||||||
// if err := recover(); err != nil {
|
fmt.Printf("panic recover check")
|
||||||
// fmt.Printf("occur error while set prop map %s\r\n", err)
|
if err := recover(); err != nil {
|
||||||
// }
|
fmt.Printf("occur error while set prop map %s\r\n", err)
|
||||||
//}()
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
b, err := jsoniter.ConfigCompatibleWithStandardLibrary.Marshal(propMap)
|
b, err := jsoniter.ConfigCompatibleWithStandardLibrary.Marshal(propMap)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user