收藏类型判断: type为 string
This commit is contained in:
		@@ -22,7 +22,7 @@ type Collection struct {
 | 
			
		||||
	ID         int       `json:"id" gorm:"primaryKey"`
 | 
			
		||||
	Title      string    `json:"title"`
 | 
			
		||||
	Content    string    `json:"content"`
 | 
			
		||||
	Type       int       `json:"type"`
 | 
			
		||||
	Type       string    `json:"type"`
 | 
			
		||||
	Thumbnail  string    `json:"thumbnail"`
 | 
			
		||||
	Num        int       `json:"num"`
 | 
			
		||||
	Fans       int       `json:"fans"`
 | 
			
		||||
@@ -127,7 +127,7 @@ var CollectionItems = &graphql.Field{
 | 
			
		||||
		for index, item := range collects {
 | 
			
		||||
			var data []Cover
 | 
			
		||||
			var t string = "article"
 | 
			
		||||
			if item.Type == 1 {
 | 
			
		||||
			if item.Type == "1" {
 | 
			
		||||
				t = "image"
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user