|
@@ -4,21 +4,21 @@ const Service = require('egg').Service;
|
|
const assert = require('assert');
|
|
const assert = require('assert');
|
|
const moment = require('moment');
|
|
const moment = require('moment');
|
|
class ConfigurationService extends Service {
|
|
class ConfigurationService extends Service {
|
|
- async create({ name, describe, company, phone, address, mail, postcode, record, path, isshow, isname }) {
|
|
|
|
|
|
+ async create({ name, describe, company, phone, address, mail, postcode, record, path, isshow, isname, isShowTitle, homeTitle, homeUrl }) {
|
|
const { Configuration: model } = this.ctx.model;
|
|
const { Configuration: model } = this.ctx.model;
|
|
const createAt = moment().format('x');
|
|
const createAt = moment().format('x');
|
|
try {
|
|
try {
|
|
- await model.create({ name, describe, company, phone, address, mail, postcode, record, createAt, path, isshow, isname });
|
|
|
|
|
|
+ await model.create({ name, describe, company, phone, address, mail, postcode, record, createAt, path, isshow, isname, isShowTitle, homeTitle, homeUrl });
|
|
return { errmsg: '', errcode: 0 };
|
|
return { errmsg: '', errcode: 0 };
|
|
} catch (error) {
|
|
} catch (error) {
|
|
throw new Error('添加失败');
|
|
throw new Error('添加失败');
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- async update({ name, describe, company, phone, address, mail, postcode, record, _id, path, isshow, isname }) {
|
|
|
|
|
|
+ async update({ name, describe, company, phone, address, mail, postcode, record, _id, path, isshow, isname, isShowTitle, homeTitle, homeUrl }) {
|
|
assert(_id, 'id不存在');
|
|
assert(_id, 'id不存在');
|
|
const { Configuration: model } = this.ctx.model;
|
|
const { Configuration: model } = this.ctx.model;
|
|
try {
|
|
try {
|
|
- await model.findById(_id).update({ name, describe, company, phone, address, mail, postcode, record, path, isshow, isname });
|
|
|
|
|
|
+ await model.findById(_id).update({ name, describe, company, phone, address, mail, postcode, record, path, isshow, isname, isShowTitle, homeTitle, homeUrl });
|
|
return { errmsg: '', errcode: 0 };
|
|
return { errmsg: '', errcode: 0 };
|
|
} catch (error) {
|
|
} catch (error) {
|
|
throw new Error('修改失败');
|
|
throw new Error('修改失败');
|