egg-born-module-a-base-sync
Advanced tools
Comparing version 1.2.5 to 1.2.6
@@ -60,2 +60,6 @@ const modelFn = require('../../../model/user.js'); | ||
userOp = await this.get({ id: userId }); | ||
// anonymous maybe 1 for local env | ||
if (userOp && !userOp.anonymous) { | ||
userOp = null; | ||
} | ||
} | ||
@@ -62,0 +66,0 @@ if (!userOp) { |
@@ -91,14 +91,2 @@ module.exports = app => { | ||
async starP() { | ||
// data | ||
const data = JSON.parse(this.ctx.request.query.data); | ||
// select | ||
const res = await this.ctx.performAction({ | ||
method: 'post', | ||
url: 'atom/star', | ||
body: data, | ||
}); | ||
this.ctx.success(res); | ||
} | ||
async readCount() { | ||
@@ -113,17 +101,5 @@ const res = await this.ctx.service.atom.readCount({ | ||
async readCountP() { | ||
// data | ||
const data = JSON.parse(this.ctx.request.query.data); | ||
// select | ||
const res = await this.ctx.performAction({ | ||
method: 'post', | ||
url: 'atom/readCount', | ||
body: data, | ||
}); | ||
this.ctx.success(res); | ||
} | ||
async statsP() { | ||
async stats() { | ||
// atomIds | ||
const atomIds = JSON.parse(this.ctx.request.query.data); | ||
const atomIds = this.ctx.request.body.atomIds; | ||
const options = { | ||
@@ -130,0 +106,0 @@ where: { |
@@ -40,2 +40,10 @@ module.exports = app => { | ||
async performAction() { | ||
// params | ||
const params = JSON.parse(this.ctx.request.query.params); | ||
// performAction | ||
const res = await this.ctx.performAction(params); | ||
this.ctx.success(res); | ||
} | ||
} | ||
@@ -42,0 +50,0 @@ |
@@ -19,14 +19,2 @@ module.exports = app => { | ||
async allP() { | ||
// data | ||
const data = JSON.parse(this.ctx.request.query.data); | ||
// select | ||
const res = await this.ctx.performAction({ | ||
method: 'post', | ||
url: 'comment/all', | ||
body: data, | ||
}); | ||
this.ctx.success(res); | ||
} | ||
async list() { | ||
@@ -43,14 +31,2 @@ const options = this.ctx.request.body.options; | ||
async listP() { | ||
// data | ||
const data = JSON.parse(this.ctx.request.query.data); | ||
// select | ||
const res = await this.ctx.performAction({ | ||
method: 'post', | ||
url: 'comment/list', | ||
body: data, | ||
}); | ||
this.ctx.success(res); | ||
} | ||
async item() { | ||
@@ -83,14 +59,2 @@ const res = await this.ctx.service.comment.item({ | ||
async deleteP() { | ||
// data | ||
const data = JSON.parse(this.ctx.request.query.data); | ||
// delete | ||
const res = await this.ctx.performAction({ | ||
method: 'post', | ||
url: 'comment/delete', | ||
body: data, | ||
}); | ||
this.ctx.success(res); | ||
} | ||
async heart() { | ||
@@ -105,16 +69,4 @@ const res = await this.ctx.service.comment.heart({ | ||
async heartP() { | ||
// data | ||
const data = JSON.parse(this.ctx.request.query.data); | ||
// heart | ||
const res = await this.ctx.performAction({ | ||
method: 'post', | ||
url: 'comment/heart', | ||
body: data, | ||
}); | ||
this.ctx.success(res); | ||
} | ||
} | ||
return CommentController; | ||
}; |
@@ -24,2 +24,3 @@ const version = require('./controller/version.js'); | ||
{ method: 'post', path: 'base/functions', controller: base }, | ||
{ method: 'get', path: 'base/performAction', controller: base, middlewares: 'jsonp', meta: { auth: { enable: false } } }, | ||
// atom | ||
@@ -58,8 +59,6 @@ { method: 'post', path: 'atom/create', controller: atom, middlewares: 'transaction', | ||
}, | ||
{ method: 'get', path: 'atom/star', controller: atom, action: 'starP', middlewares: 'jsonp' }, | ||
{ method: 'post', path: 'atom/readCount', controller: atom, | ||
meta: { right: { type: 'atom', action: 2 } }, | ||
}, | ||
{ method: 'get', path: 'atom/readCount', controller: atom, action: 'readCountP', middlewares: 'jsonp' }, | ||
{ method: 'get', path: 'atom/stats', controller: atom, action: 'statsP', middlewares: 'jsonp' }, | ||
{ method: 'post', path: 'atom/stats', controller: atom }, | ||
{ method: 'post', path: 'atom/labels', controller: atom, | ||
@@ -73,7 +72,5 @@ meta: { right: { type: 'atom', action: 2 } }, | ||
{ method: 'post', path: 'comment/all', controller: comment }, | ||
{ method: 'get', path: 'comment/all', controller: comment, action: 'allP', middlewares: 'jsonp' }, | ||
{ method: 'post', path: 'comment/list', controller: comment, | ||
meta: { right: { type: 'atom', action: 2 } }, | ||
}, | ||
{ method: 'get', path: 'comment/list', controller: comment, action: 'listP', middlewares: 'jsonp' }, | ||
{ method: 'post', path: 'comment/item', controller: comment, | ||
@@ -94,7 +91,5 @@ meta: { right: { type: 'atom', action: 2 } }, | ||
}, | ||
{ method: 'get', path: 'comment/delete', controller: comment, action: 'deleteP', middlewares: 'jsonp' }, | ||
{ method: 'post', path: 'comment/heart', controller: comment, middlewares: 'transaction', | ||
meta: { right: { type: 'atom', action: 2 } }, | ||
}, | ||
{ method: 'get', path: 'comment/heart', controller: comment, action: 'heartP', middlewares: 'jsonp' }, | ||
// user | ||
@@ -126,3 +121,2 @@ { method: 'post', path: 'user/getLabels', controller: user }, | ||
{ method: 'post', path: 'auth/echo', controller: auth, meta: { auth: { enable: false } } }, | ||
{ method: 'get', path: 'auth/echo', controller: auth, middlewares: 'jsonp', meta: { auth: { enable: false } } }, | ||
{ method: 'post', path: 'auth/check', controller: auth, meta: { auth: { user: true } } }, | ||
@@ -129,0 +123,0 @@ { method: 'post', path: 'auth/logout', controller: auth, meta: { auth: { enable: false } } }, |
{ | ||
"name": "egg-born-module-a-base-sync", | ||
"version": "1.2.5", | ||
"version": "1.2.6", | ||
"title": "Base", | ||
@@ -5,0 +5,0 @@ "eggBornModule": { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
966850
14184