Skip to content

Commit

Permalink
fix 修复 eslint 错误
Browse files Browse the repository at this point in the history
  • Loading branch information
tumobi committed Feb 9, 2018
1 parent ff79c43 commit 57804b7
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 34 deletions.
1 change: 0 additions & 1 deletion src/admin/controller/category.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const Base = require('./base.js');
const _ = require('lodash');

module.exports = class extends Base {
/**
Expand Down
23 changes: 0 additions & 23 deletions src/admin/controller/upload.js
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -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() {
Expand All @@ -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() {
Expand Down
6 changes: 3 additions & 3 deletions src/admin/logic/auth.js
Original file line number Diff line number Diff line change
@@ -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 }
};
}
};
1 change: 0 additions & 1 deletion src/api/controller/auth.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const Base = require('./base.js');
const rp = require('request-promise');
const _ = require('lodash');

module.exports = class extends Base {
async loginByWeixinAction() {
Expand Down
6 changes: 2 additions & 4 deletions src/api/controller/pay.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,21 @@
const Base = require('./base.js');

module.exports = class extends Base {

/**
* 获取支付的请求参数
* @returns {Promise<PreventPromise|void|Promise>}
*/
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('微信支付失败');
}
Expand All @@ -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>`;
}
Expand Down
1 change: 0 additions & 1 deletion src/api/service/weixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
2 changes: 1 addition & 1 deletion src/common/config/extend.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ const cache = require('think-cache');

module.exports = [
model(think.app),
cache,
cache
];

0 comments on commit 57804b7

Please sign in to comment.