Commit e841660c by Sxy

fix: 代码规范

parent ef46e093
...@@ -33,9 +33,9 @@ module.exports = (db, DataTypes) => ...@@ -33,9 +33,9 @@ module.exports = (db, DataTypes) =>
// define the table's name // define the table's name
tableName: 'x_product', tableName: 'x_product',
getterMethods: { getterMethods: {
spName() { // spName() {
return servicer_name; // return servicer_name;
}, // },
}, },
validate: { validate: {
......
...@@ -25,9 +25,9 @@ module.exports = (db, DataTypes) => ...@@ -25,9 +25,9 @@ module.exports = (db, DataTypes) =>
// define the table's name // define the table's name
tableName: 'tx_product_price', tableName: 'tx_product_price',
getterMethods: { getterMethods: {
spName() { // spName() {
return servicer_name; // return servicer_name;
}, // },
}, },
validate: { validate: {
......
...@@ -110,13 +110,13 @@ class MsgService extends ServiceBase { ...@@ -110,13 +110,13 @@ class MsgService extends ServiceBase {
} }
async findSystemMsgCount(pobj, qobj, req) { async findSystemMsgCount(pobj, qobj, req) {
const { type, company_id } = pobj; const { type, company_id: companyId } = pobj;
const where = { const where = {
msgType: system.Msg.SYS, msgType: system.Msg.SYS,
is_undo: false, is_undo: false,
company_id: { company_id: {
$in: [1, company_id], $in: [1, companyId],
}, },
}; };
if (type === 'recently') { if (type === 'recently') {
...@@ -150,7 +150,7 @@ class MsgService extends ServiceBase { ...@@ -150,7 +150,7 @@ class MsgService extends ServiceBase {
} }
async list(pobj, qobj, req) { async list(pobj, qobj, req) {
const { userid, msgType, pageSize = 10, pageNo = 1, company_id } = pobj; const { userid, msgType, pageSize = 10, pageNo = 1, company_id: companyId } = pobj;
let msgData = []; let msgData = [];
const other = { const other = {
limit: pageSize, limit: pageSize,
...@@ -175,7 +175,7 @@ class MsgService extends ServiceBase { ...@@ -175,7 +175,7 @@ class MsgService extends ServiceBase {
msgType: system.Msg.SYS, msgType: system.Msg.SYS,
is_undo: false, is_undo: false,
company_id: { company_id: {
$in: [1, company_id], $in: [1, companyId],
}, },
}, [], other); }, [], other);
msgData = msgData.map(item => ({ msgData = msgData.map(item => ({
......
...@@ -32,15 +32,15 @@ class LogClient { ...@@ -32,15 +32,15 @@ class LogClient {
} }
async logList(pobj) { async logList(pobj) {
const { search, pageInfo, company_id } = pobj; const { search, pageInfo, company_id: companyId } = pobj;
const { userName, errorInfo, messageBody, resultInfo, created_at, opTitle, requestId } = search; const { userName, errorInfo, messageBody, resultInfo, created_at: createdAt, opTitle, requestId } = search;
const query = { const query = {
indexName: `logs-sytxpublic-msgq-${settings.logindex}`, indexName: `logs-sytxpublic-msgq-${settings.logindex}`,
pageSize: pageInfo.pageSize, pageSize: pageInfo.pageSize,
currentPage: pageInfo.pageNo, currentPage: pageInfo.pageNo,
}; };
if (company_id && company_id != 1) { if (companyId && companyId != 1) {
query.identifyCode = `_${company_id}_`; query.identifyCode = `_${companyId}_`;
} }
if (opTitle) { if (opTitle) {
query.opTitle = opTitle; query.opTitle = opTitle;
...@@ -60,9 +60,9 @@ class LogClient { ...@@ -60,9 +60,9 @@ class LogClient {
if (resultInfo) { if (resultInfo) {
query.resultInfo = resultInfo; query.resultInfo = resultInfo;
} }
if (created_at && created_at[0] && created_at[1]) { if (createdAt && createdAt[0] && createdAt[1]) {
query.startTime = new Date(created_at[0]).getTime(); query.startTime = new Date(createdAt[0]).getTime();
query.entTime = new Date(created_at[1]).getTime(); query.entTime = new Date(createdAt[1]).getTime();
} }
console.log('请求--------日志'); console.log('请求--------日志');
console.log(settings.logUrl()); console.log(settings.logUrl());
...@@ -77,7 +77,7 @@ class LogClient { ...@@ -77,7 +77,7 @@ class LogClient {
if (rtn && rtn.status === 1) { if (rtn && rtn.status === 1) {
return rtn.data; return rtn.data;
} }
throw new Error(rtn && rtn.message || '请联系管理员'); throw new Error((rtn && rtn.message) || '请联系管理员');
} else { } else {
throw new Error(rtn); throw new Error(rtn);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment