Prechádzať zdrojové kódy

关联性数据查询不到会报error,先去除非必要返回值

Csy817 6 rokov pred
rodič
commit
6b921c117f
2 zmenil súbory, kde vykonal 2 pridanie a 41 odobranie
  1. 0 3
      src/pages/home/all/index.js
  2. 2 38
      src/utils/gql.js

+ 0 - 3
src/pages/home/all/index.js

@@ -123,9 +123,6 @@ class All extends Component {
                                         </div>
                                     )
                                 }
-                                if (error) {
-                                    return 'error!'
-                                }
                                 // console.log(data.productbyprops)
                                 return (
                                     <Recommend data={data.productbyprops} history={this.props.history}/>

+ 2 - 38
src/utils/gql.js

@@ -103,16 +103,6 @@ const user_by_id = `
             createdAt
             openid
             id
-            userData_id {
-                id
-                nickname
-                avatar
-                isVip
-                vipCode
-                userPoint
-                createdAt
-                updatedAt
-            }
         }
     }
 `
@@ -190,10 +180,6 @@ const productbyprops = `
     query productbyprops($recommend: Int, $where: product_filter, $sort_by: product_sort_by, $limit: Int, $unit: String, $order_by: OrderBy, $name: String, $filter: Filter, $status: String, $price: Float, $category_id: ID, $img: String, $stock: Int, $skip: Int) {
         productbyprops: product_by_props(recommend: $recommend where: $where sort_by: $sort_by limit: $limit unit: $unit order_by: $order_by name: $name filter: $filter status: $status price: $price category_id: $category_id img: $img stock: $stock skip: $skip) {
             recommend
-            category_id{
-                id
-                name
-            }
             updatedAt
             unit
             name
@@ -212,9 +198,6 @@ const productbyprops = `
 const productAndSpec_by_id = `
     query productbyid($id: ID) {
         productbyid: product_by_id(id: $id) {
-            category_id{
-                id
-            }
             updatedAt
             unit
             name
@@ -262,7 +245,6 @@ const create_specificationStock = `
             specificationStock {
                 updatedAt
                 color
-    
                 createdAt
                 size
                 slideImg
@@ -417,7 +399,6 @@ const create_update_userAddress = `
                 createdAt
                 deletedAt
                 id
-    
                 area
                 province
             }
@@ -435,7 +416,6 @@ const create_update_userAddress = `
                 createdAt
                 deletedAt
                 id
-    
                 area
                 province
             }
@@ -459,7 +439,6 @@ const update_userAddress = `
                 createdAt
                 deletedAt
                 id
-    
                 area
                 province
             }
@@ -476,8 +455,7 @@ const update_userAddress = `
                 postcode
                 createdAt
                 deletedAt
-                id
-    
+                id   
                 area
                 province
             }
@@ -547,13 +525,11 @@ const orderbyprops = `
                 expressDetailName
                 expressId
                 createdAt
-    
                 consigneeTel
                 id
                 expressName
                 consignAddress
                 LogisticsStatus
-    
                 consigneeName
             }
             orderTotalPay
@@ -571,7 +547,6 @@ const orderbyprops = `
                 openid
                 id
                 totalFee
-    
                 cashFee
             }
         }
@@ -590,13 +565,11 @@ const order_by_id = `
                 logisticsFee
                 expressId
                 createdAt
-    
                 consigneeTel
                 id
                 expressName
                 consignAddress
                 LogisticsStatus
-    
                 consigneeName
             }
             orderTotalPay
@@ -624,7 +597,6 @@ const order_by_id = `
                 openid
                 id
                 totalFee
-    
                 cashFee
             }
         }
@@ -683,13 +655,11 @@ const update_order_logistics = `
                 expressDetailName
                 expressId
                 createdAt
-    
                 consigneeTel
                 id
                 expressName
                 consignAddress
-                LogisticsStatus
-    
+                LogisticsStatus 
                 consigneeName
             }
         }
@@ -789,14 +759,11 @@ const create_order = `
                 order_id {
                     remark
                     updatedAt
-        
                     orderTotalPay
                     createdAt
                     orderStatus
-        
                     id
                     count
-        
                     productTotalPay
                 }
                 consigneeTel
@@ -833,13 +800,11 @@ const create_order_product = `
                 updatedAt
                 productColor
                 unit
-    
                 productSize
                 orderPay
                 createdAt
                 productImg
                 productName
-    
                 productPrice
                 id
                 count
@@ -950,7 +915,6 @@ const update_product = `
                 intro
                 discountRate
                 price
-    
                 img
                 stock
             }