guhongwei 4 年之前
父节点
当前提交
f985a37986
共有 2 个文件被更改,包括 4 次插入27 次删除
  1. 4 20
      app/service/user.js
  2. 0 7
      config/config.default.js

+ 4 - 20
app/service/user.js

@@ -7,22 +7,6 @@ const { CrudService } = require('naf-framework-mongoose/lib/service');
 const { BusinessError, ErrorCode } = require('naf-core').Error;
 const jwt = require('jsonwebtoken');
 
-
-
-const mongoose = require('mongose')
- 
-mongoose.connect('mongodb://localhost/platform') //第一步,建立与shop数据库的连接
- 
-var Schema = mongoose.Schema;//第二步,通过mongoose的Schema实例化一个集合对象
- 
-const goodsSchema = new Schema({
-  categoryId: Number,//种类
-  characteristic: String,//描述
-  dateAdd: String,//上架时间
-}
- 
-const Product = mongoose.model('product',goodsSchema);//第三步,返回数据库模型,会自动对应数据库中名字为 product 的表
-
 class UserService extends CrudService {
   constructor(ctx) {
     super(ctx, 'user');
@@ -198,10 +182,10 @@ class UserService extends CrudService {
   async delete({ id }) {
     const res = await this.model.update({ _id: ObjectId(id) }, { isdel: '1' });
     if (res) {
-      const arr = await Product.update({ userid: id }, { isdel: '1' });
-      if (arr) {
-        return arr;
-      }
+      // const arr = await Product.update({ userid: id }, { isdel: '1' });
+      // if (arr) {
+      //   return arr;
+      // }
     }
     return res;
   }

+ 0 - 7
config/config.default.js

@@ -31,13 +31,6 @@ module.exports = appInfo => {
       port: 9999,
     },
   };
-  // axios service config
-  // config.axios = {
-  //   product: {
-  //     // 产品
-  //     baseUrl: 'http://localhost:9004/api/market/product',
-  //   },
-  // };
 
   config.wxapi = {
     appid: 'wxdf3ed83c095be97a', // 微信公众号APPID