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
|
||||
if puuid == "" {
|
||||
dirMatter = this.matterDao.CheckByUuid(puuid)
|
||||
dirMatter = this.matterDao.CheckWithRootByUuid(puuid, space)
|
||||
if dirMatter.SpaceUuid != space.Uuid {
|
||||
panic(result.UNAUTHORIZED)
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ func (this *MatterDao) CheckWithRootByUuid(uuid string, space *Space) *Matter {
|
||||
var matter *Matter
|
||||
if uuid == MATTER_ROOT {
|
||||
if space == nil {
|
||||
panic(result.BadRequest("user cannot be null."))
|
||||
panic(result.BadRequest("space cannot be null."))
|
||||
}
|
||||
matter = NewRootMatter(space)
|
||||
} else {
|
||||
|
||||
@@ -151,11 +151,12 @@ func (this *Matter) FetchPropMap() map[string]string {
|
||||
func (this *Matter) SetPropMap(propMap map[string]string) {
|
||||
|
||||
//恢复panic
|
||||
//defer func() {
|
||||
// if err := recover(); err != nil {
|
||||
// fmt.Printf("occur error while set prop map %s\r\n", err)
|
||||
// }
|
||||
//}()
|
||||
defer func() {
|
||||
fmt.Printf("panic recover check")
|
||||
if err := recover(); err != nil {
|
||||
fmt.Printf("occur error while set prop map %s\r\n", err)
|
||||
}
|
||||
}()
|
||||
|
||||
b, err := jsoniter.ConfigCompatibleWithStandardLibrary.Marshal(propMap)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user