Pārlūkot izejas kodu

fix 修复 eslint 错误

tumobi 7 gadi atpakaļ
vecāks
revīzija
57804b7e5e

+ 0 - 1
src/admin/controller/category.js

@@ -1,5 +1,4 @@
 const Base = require('./base.js');
-const _ = require('lodash');
 
 module.exports = class extends Base {
   /**

+ 0 - 23
src/admin/controller/upload.js

@@ -1,5 +1,4 @@
 const Base = require('./base.js');
-const gm = require('gm').subClass({imageMagick: true});
 const fs = require('fs');
 
 module.exports = class extends Base {
@@ -18,17 +17,6 @@ module.exports = class extends Base {
       name: 'brand_pic',
       fileUrl: 'http://127.0.0.1:8360' + filename
     });
-    // gm(brandFile.path)
-    //   .resize(750, 420, '!')
-    //   .write(think.RESOURCE_PATH + filename, function (err) {
-    //     if (err) {
-    //       return that.fail('图片上传失败');
-    //     }
-    //     return that.success({
-    //       name: 'brand_pic',
-    //       fileUrl: 'http://127.0.0.1:8360' + filename
-    //     });
-    //   });
   }
 
   async brandNewPicAction() {
@@ -47,17 +35,6 @@ module.exports = class extends Base {
       name: 'brand_new_pic',
       fileUrl: 'http://127.0.0.1:8360' + filename
     });
-    // gm(brandFile.path)
-    //   .resize(375, 252, '!')
-    //   .write(think.ROOT_PATH + '/www' + filename, function(err) {
-    //     if (err) {
-    //       return that.fail('上传失败');
-    //     }
-    //     return that.success({
-    //       name: 'brand_new_pic',
-    //       fileUrl: 'http://127.0.0.1:8360' + filename
-    //     });
-    //   });
   }
 
   async categoryWapBannerPicAction() {

+ 3 - 3
src/admin/logic/auth.js

@@ -1,9 +1,9 @@
 module.exports = class extends think.Logic {
-  loginAction(){
+  loginAction() {
     this.allowMethods = 'post';
     this.rules = {
-      username: {required: true, string: true},
-      password: {required: true, string: true}
+      username: { required: true, string: true },
+      password: { required: true, string: true }
     };
   }
 };

+ 0 - 1
src/api/controller/auth.js

@@ -1,6 +1,5 @@
 const Base = require('./base.js');
 const rp = require('request-promise');
-const _ = require('lodash');
 
 module.exports = class extends Base {
   async loginByWeixinAction() {

+ 2 - 4
src/api/controller/pay.js

@@ -2,7 +2,6 @@
 const Base = require('./base.js');
 
 module.exports = class extends Base {
-
   /**
    * 获取支付的请求参数
    * @returns {Promise<PreventPromise|void|Promise>}
@@ -10,14 +9,14 @@ module.exports = class extends Base {
   async prepayAction() {
     const orderId = this.get('orderId');
 
-    const orderInfo = await this.model('order').where({id: orderId}).find();
+    const orderInfo = await this.model('order').where({ id: orderId }).find();
     if (think.isEmpty(orderInfo)) {
       return this.fail(400, '订单已取消');
     }
     if (parseInt(orderInfo.pay_status) !== 0) {
       return this.fail(400, '订单已支付,请不要重复操作');
     }
-    const openid = await this.model('user').where({id: orderInfo.user_id}).getField('weixin_openid', true);
+    const openid = await this.model('user').where({ id: orderInfo.user_id }).getField('weixin_openid', true);
     if (think.isEmpty(openid)) {
       return this.fail('微信支付失败');
     }
@@ -39,7 +38,6 @@ module.exports = class extends Base {
   async notifyAction() {
     const WeixinSerivce = this.service('weixin', 'api');
     const result = WeixinSerivce.payNotify(this.post('xml'));
-    console.log('WeixinSerivce.payNotify ' + result);
     if (!result) {
       return `<xml><return_code><![CDATA[FAIL]]></return_code><return_msg><![CDATA[支付失败]]></return_msg></xml>`;
     }

+ 0 - 1
src/api/service/weixin.js

@@ -125,7 +125,6 @@ module.exports = class extends think.Service {
       }
     }
     if (notifyObj.return_code !== 'SUCCESS' || notifyObj.result_code !== 'SUCCESS') {
-      console.log('return_code false');
       return false;
     }
     const signString = this.signQuery(this.buildQuery(notifyObj));

+ 1 - 1
src/common/config/extend.js

@@ -3,5 +3,5 @@ const cache = require('think-cache');
 
 module.exports = [
   model(think.app),
-  cache,
+  cache
 ];