Authored by 陈峰

api完善

1 -{"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/directives/index.js":{"size":0,"mtime":1491443244000,"hashOfConfig":"q2ce8q","results":{"filePath":"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/directives/index.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/lint-commit.js":{"size":1883,"mtime":1492413976000,"hashOfConfig":"q2ce8q","results":{"filePath":"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/lint-commit.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/app.js":{"size":458,"mtime":1492412724000,"hashOfConfig":"q2ce8q","results":{"filePath":"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/app.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/build/util.js":{"size":152,"mtime":1492156059000,"hashOfConfig":"q2ce8q","results":{"filePath":"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/build/util.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/build/webpack.base.conf.js":{"size":3335,"mtime":1492156392000,"hashOfConfig":"q2ce8q","results":{"filePath":"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/build/webpack.base.conf.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/build/webpack.dev.conf.js":{"size":196,"mtime":1492155807000,"hashOfConfig":"q2ce8q","results":{"filePath":"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/build/webpack.dev.conf.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/build/webpack.prod.conf.js":{"size":544,"mtime":1492410496000,"hashOfConfig":"q2ce8q","results":{"filePath":"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/build/webpack.prod.conf.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/config/config.js":{"size":56,"mtime":1490951756000,"hashOfConfig":"q2ce8q","results":{"filePath":"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/config/config.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/filters/index.js":{"size":102,"mtime":1491373576000,"hashOfConfig":"q2ce8q","results":{"filePath":"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/filters/index.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/filters/money-short.js":{"size":209,"mtime":1491374592000,"hashOfConfig":"q2ce8q","results":{"filePath":"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/filters/money-short.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/pages/app.vue":{"size":170,"mtime":1492413914000,"hashOfConfig":"q2ce8q","results":{"filePath":"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/pages/app.vue","messages":[],"errorCount":0,"warningCount":0}},"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/pages/auth/index.js":{"size":54,"mtime":1492158379000,"hashOfConfig":"q2ce8q","results":{"filePath":"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/pages/auth/index.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/pages/auth/login/index.js":{"size":166,"mtime":1492162219000,"hashOfConfig":"q2ce8q","results":{"filePath":"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/pages/auth/login/index.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/pages/auth/login/login.vue":{"size":2701,"mtime":1492414013000,"hashOfConfig":"q2ce8q","results":{"filePath":"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/pages/auth/login/login.vue","messages":[],"errorCount":0,"warningCount":0}},"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/pages/home/dashboard/dashboard.vue":{"size":348,"mtime":1492163066000,"hashOfConfig":"q2ce8q","results":{"filePath":"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/pages/home/dashboard/dashboard.vue","messages":[],"errorCount":0,"warningCount":0}},"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/pages/home/dashboard/index.js":{"size":182,"mtime":1492162754000,"hashOfConfig":"q2ce8q","results":{"filePath":"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/pages/home/dashboard/index.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/pages/home/index.js":{"size":111,"mtime":1492162620000,"hashOfConfig":"q2ce8q","results":{"filePath":"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/pages/home/index.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/pages/home/overview/index.js":{"size":170,"mtime":1492412737000,"hashOfConfig":"q2ce8q","results":{"filePath":"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/pages/home/overview/index.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/pages/index.js":{"size":266,"mtime":1492163177000,"hashOfConfig":"q2ce8q","results":{"filePath":"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/pages/index.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/pages/layout.vue":{"size":3754,"mtime":1492162425000,"hashOfConfig":"q2ce8q","results":{"filePath":"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/pages/layout.vue","messages":[],"errorCount":0,"warningCount":0}},"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/services/service.home.js":{"size":260,"mtime":1492406644000,"hashOfConfig":"q2ce8q","results":{"filePath":"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/services/service.home.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/server/app.js":{"size":918,"mtime":1492410473000,"hashOfConfig":"q2ce8q","results":{"filePath":"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/server/app.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/server/common/api.js":{"size":323,"mtime":1492412708000,"hashOfConfig":"q2ce8q","results":{"filePath":"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/server/common/api.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/server/common/config.js":{"size":779,"mtime":1492135825000,"hashOfConfig":"q2ce8q","results":{"filePath":"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/server/common/config.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/server/common/context.js":{"size":434,"mtime":1492412637000,"hashOfConfig":"q2ce8q","results":{"filePath":"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/server/common/context.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/server/common/middleware.js":{"size":539,"mtime":1492136892000,"hashOfConfig":"q2ce8q","results":{"filePath":"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/server/common/middleware.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/server/common/util.js":{"size":436,"mtime":1492136998000,"hashOfConfig":"q2ce8q","results":{"filePath":"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/server/common/util.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/server/controllers/index.js":{"size":425,"mtime":1492136884000,"hashOfConfig":"q2ce8q","results":{"filePath":"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/server/controllers/index.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/server/controllers/user.js":{"size":790,"mtime":1492155582000,"hashOfConfig":"q2ce8q","results":{"filePath":"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/server/controllers/user.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/server/middleware/auth.js":{"size":328,"mtime":1492137531000,"hashOfConfig":"q2ce8q","results":{"filePath":"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/server/middleware/auth.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/server/middleware/before.js":{"size":582,"mtime":1492138276000,"hashOfConfig":"q2ce8q","results":{"filePath":"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/server/middleware/before.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/server/middleware/error.js":{"size":454,"mtime":1492137829000,"hashOfConfig":"q2ce8q","results":{"filePath":"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/server/middleware/error.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/server/middleware/index.js":{"size":276,"mtime":1492135839000,"hashOfConfig":"q2ce8q","results":{"filePath":"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/server/middleware/index.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/server/middleware/proxy.js":{"size":358,"mtime":1492138303000,"hashOfConfig":"q2ce8q","results":{"filePath":"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/server/middleware/proxy.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/pages/home/overview/overview.vue":{"size":391,"mtime":1492414048000,"hashOfConfig":"q2ce8q","results":{"filePath":"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/pages/home/overview/overview.vue","messages":[],"errorCount":0,"warningCount":0}}}  
  1 +{"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/directives/index.js":{"size":0,"mtime":1491443244000,"hashOfConfig":"q2ce8q","results":{"filePath":"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/directives/index.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/lint-commit.js":{"size":1883,"mtime":1492413976000,"hashOfConfig":"q2ce8q","results":{"filePath":"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/lint-commit.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/app.js":{"size":458,"mtime":1492412724000,"hashOfConfig":"q2ce8q","results":{"filePath":"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/app.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/build/util.js":{"size":152,"mtime":1492156059000,"hashOfConfig":"q2ce8q","results":{"filePath":"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/build/util.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/build/webpack.base.conf.js":{"size":3335,"mtime":1492156392000,"hashOfConfig":"q2ce8q","results":{"filePath":"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/build/webpack.base.conf.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/build/webpack.dev.conf.js":{"size":196,"mtime":1492155807000,"hashOfConfig":"q2ce8q","results":{"filePath":"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/build/webpack.dev.conf.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/build/webpack.prod.conf.js":{"size":544,"mtime":1492410496000,"hashOfConfig":"q2ce8q","results":{"filePath":"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/build/webpack.prod.conf.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/config/config.js":{"size":56,"mtime":1490951756000,"hashOfConfig":"q2ce8q","results":{"filePath":"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/config/config.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/filters/index.js":{"size":102,"mtime":1491373576000,"hashOfConfig":"q2ce8q","results":{"filePath":"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/filters/index.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/filters/money-short.js":{"size":209,"mtime":1491374592000,"hashOfConfig":"q2ce8q","results":{"filePath":"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/filters/money-short.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/pages/app.vue":{"size":170,"mtime":1492413914000,"hashOfConfig":"q2ce8q","results":{"filePath":"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/pages/app.vue","messages":[],"errorCount":0,"warningCount":0}},"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/pages/auth/index.js":{"size":54,"mtime":1492158379000,"hashOfConfig":"q2ce8q","results":{"filePath":"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/pages/auth/index.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/pages/auth/login/index.js":{"size":166,"mtime":1492162219000,"hashOfConfig":"q2ce8q","results":{"filePath":"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/pages/auth/login/index.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/pages/auth/login/login.vue":{"size":2701,"mtime":1492414013000,"hashOfConfig":"q2ce8q","results":{"filePath":"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/pages/auth/login/login.vue","messages":[],"errorCount":0,"warningCount":0}},"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/pages/home/dashboard/dashboard.vue":{"size":348,"mtime":1492163066000,"hashOfConfig":"q2ce8q","results":{"filePath":"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/pages/home/dashboard/dashboard.vue","messages":[],"errorCount":0,"warningCount":0}},"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/pages/home/dashboard/index.js":{"size":182,"mtime":1492162754000,"hashOfConfig":"q2ce8q","results":{"filePath":"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/pages/home/dashboard/index.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/pages/home/index.js":{"size":111,"mtime":1492162620000,"hashOfConfig":"q2ce8q","results":{"filePath":"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/pages/home/index.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/pages/home/overview/index.js":{"size":170,"mtime":1492412737000,"hashOfConfig":"q2ce8q","results":{"filePath":"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/pages/home/overview/index.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/pages/index.js":{"size":266,"mtime":1492163177000,"hashOfConfig":"q2ce8q","results":{"filePath":"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/pages/index.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/pages/layout.vue":{"size":3754,"mtime":1492162425000,"hashOfConfig":"q2ce8q","results":{"filePath":"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/pages/layout.vue","messages":[],"errorCount":0,"warningCount":0}},"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/services/service.home.js":{"size":260,"mtime":1492406644000,"hashOfConfig":"q2ce8q","results":{"filePath":"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/services/service.home.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/server/app.js":{"size":919,"mtime":1492425948000,"hashOfConfig":"q2ce8q","results":{"filePath":"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/server/app.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/server/common/config.js":{"size":901,"mtime":1492429648000,"hashOfConfig":"q2ce8q","results":{"filePath":"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/server/common/config.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/server/common/context.js":{"size":633,"mtime":1492422538000,"hashOfConfig":"q2ce8q","results":{"filePath":"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/server/common/context.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/server/common/middleware.js":{"size":539,"mtime":1492136892000,"hashOfConfig":"q2ce8q","results":{"filePath":"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/server/common/middleware.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/server/common/util.js":{"size":436,"mtime":1492136998000,"hashOfConfig":"q2ce8q","results":{"filePath":"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/server/common/util.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/server/controllers/index.js":{"size":424,"mtime":1492422449000,"hashOfConfig":"q2ce8q","results":{"filePath":"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/server/controllers/index.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/server/controllers/user.js":{"size":657,"mtime":1492430000000,"hashOfConfig":"q2ce8q","results":{"filePath":"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/server/controllers/user.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/server/middleware/auth.js":{"size":328,"mtime":1492137531000,"hashOfConfig":"q2ce8q","results":{"filePath":"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/server/middleware/auth.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/server/middleware/before.js":{"size":582,"mtime":1492138276000,"hashOfConfig":"q2ce8q","results":{"filePath":"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/server/middleware/before.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/server/middleware/error.js":{"size":454,"mtime":1492137829000,"hashOfConfig":"q2ce8q","results":{"filePath":"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/server/middleware/error.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/server/middleware/index.js":{"size":276,"mtime":1492135839000,"hashOfConfig":"q2ce8q","results":{"filePath":"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/server/middleware/index.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/server/middleware/proxy.js":{"size":358,"mtime":1492138303000,"hashOfConfig":"q2ce8q","results":{"filePath":"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/server/middleware/proxy.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/pages/home/overview/overview.vue":{"size":391,"mtime":1492414048000,"hashOfConfig":"q2ce8q","results":{"filePath":"/Users/chenfeng/Documents/source/yoho/yoho-shop-manage/app/pages/home/overview/overview.vue","messages":[],"errorCount":0,"warningCount":0}}}
@@ -8,8 +8,6 @@ const session = require('express-session'); @@ -8,8 +8,6 @@ const session = require('express-session');
8 const config = require('./common/config'); 8 const config = require('./common/config');
9 const logger = require('yoho-node-lib/lib/logger'); 9 const logger = require('yoho-node-lib/lib/logger');
10 const helpers = require('yoho-node-lib/lib/helpers'); 10 const helpers = require('yoho-node-lib/lib/helpers');
11 -const middleware = require('./middleware');  
12 -const controllers = require('./controllers');  
13 11
14 let app = new Express(); 12 let app = new Express();
15 13
@@ -23,6 +21,9 @@ app.use(session({ @@ -23,6 +21,9 @@ app.use(session({
23 secret: 'yoho!shop@manage' 21 secret: 'yoho!shop@manage'
24 })); 22 }));
25 23
  24 +const middleware = require('./middleware');
  25 +const controllers = require('./controllers');
  26 +
26 try { 27 try {
27 // 前置中间件 28 // 前置中间件
28 app.use(middleware.before); 29 app.use(middleware.before);
  1 +const _ = require('lodash');
1 const Context = require('./context'); 2 const Context = require('./context');
  3 +const request = require('request');
  4 +const config = global.yoho.config;
  5 +
  6 +const API_ERROR = {
  7 + code: 0,
  8 + message: '网络异常'
  9 +};
  10 +const API_INTERNAL_ERROR = {
  11 + code: 500,
  12 + message: '服务器错误'
  13 +};
2 14
3 class Api extends Context { 15 class Api extends Context {
4 - constructor(...args) { 16 + constructor(domain = config.domains.serve) {
5 super(); 17 super();
6 - console.log(args); 18 + this.domain = domain;
  19 + }
  20 + get(url, data, headers) {
  21 + return this.parse(() => {
  22 + return request.get({
  23 + url: `${this.domain}/${url}`,
  24 + qs: data,
  25 + headers,
  26 + });
  27 + });
  28 + }
  29 + post(url, data, headers) {
  30 + return this.parse(() => {
  31 + return request.post({
  32 + url: `${this.domain}/${url}`,
  33 + form: data,
  34 + headers,
  35 + });
  36 + });
7 } 37 }
8 - get(url, data) {  
9 - console.log(this.ctx.req.header('host'));  
10 - return Promise.resolve(data); 38 + upload() {
11 } 39 }
12 - post(url, data) {  
13 - console.log(this.ctx.req.header('host'));  
14 - return Promise.resolve(data); 40 + download() {
  41 + }
  42 + parse(req) {
  43 + return new Promise((resolve, reject) => {
  44 + let buffers = [], response;
  45 +
  46 + req()
  47 + .on('error', error => {
  48 + if (error) {
  49 + return reject(API_ERROR);
  50 + }
  51 + })
  52 + .on('data', (chunk) => {
  53 + buffers.push(chunk);
  54 + })
  55 + .on('response', (res) => {
  56 + response = res;
  57 + })
  58 + .on('end', () => {
  59 + console.log(response.length);
  60 + if (buffers) {
  61 + // TODO 判断文件
  62 + try {
  63 + let jsonData = JSON.parse(buffers.toString('utf-8'));
  64 +
  65 + if (_.get(jsonData, 'code', '').toString()[0] !== '2') {
  66 + return reject(jsonData);
  67 + }
  68 + return resolve(jsonData);
  69 + } catch (error) {
  70 + return reject(API_INTERNAL_ERROR);
  71 + }
  72 + }
  73 + return reject(API_INTERNAL_ERROR);
  74 + });
  75 + });
15 } 76 }
16 } 77 }
17 78
@@ -9,6 +9,10 @@ const config = { @@ -9,6 +9,10 @@ const config = {
9 port: 6006, 9 port: 6006,
10 siteUrl: '//m.yohobuy.com', 10 siteUrl: '//m.yohobuy.com',
11 assetUrl: '//127.0.0.1:5001', 11 assetUrl: '//127.0.0.1:5001',
  12 + domains: {
  13 + serve: 'http://serve.yohobuy.com',
  14 + platform: 'http://192.168.102.202:8088/platform'
  15 + },
12 loggers: { 16 loggers: {
13 infoFile: { 17 infoFile: {
14 close: true, 18 close: true,
@@ -9,18 +9,10 @@ const Api = require('../common/api'); @@ -9,18 +9,10 @@ const Api = require('../common/api');
9 9
10 class UserController extends Context { 10 class UserController extends Context {
11 login(req, res) { 11 login(req, res) {
12 - this.instance(Api, 'aaa', 'bbb', 'ccc').get().then(() => {});  
13 -  
14 - // if (req.body.username === 'admin' && req.body.password === '111') {  
15 - // res.session.LOGIN_UID = 1;  
16 - // return res.json({  
17 - // code: 200,  
18 - // message: '登录成功'  
19 - // });  
20 - // }  
21 - return res.json({  
22 - code: 400,  
23 - message: '用户名密码错误' 12 + return this.instance(Api).post('service/account/v1/Profile/login', '["hongyun","hongyun",2]').then(result => {
  13 + res.send(result);
  14 + }, result => {
  15 + res.send(result);
24 }); 16 });
25 } 17 }
26 logout(req, res) { 18 logout(req, res) {