Commit ac28fa9d by largezhou

Merge branch 'test' into 'master' (merge request !3)

验证码,错误锁定等
parents ed852d23 93023e5c
node_modules/ node_modules/
app/config/localsettings.js app/config/localsettings.js
*.sh app/front/entry/public/
\ No newline at end of file
...@@ -22,6 +22,12 @@ class ProductAPI extends APIBase { ...@@ -22,6 +22,12 @@ class ProductAPI extends APIBase {
let rs = await this.productpriceS.findRegionsByProductName(pname, sp) let rs = await this.productpriceS.findRegionsByProductName(pname, sp)
return system.getResult(rs); return system.getResult(rs);
} }
async findProductInfoForFt(p, q, req) {
let pname = p.productname;
let region = p.region;
let rs = await this.productpriceS.findProductInfoForFt(pname, region)
return system.getResult(rs);
}
classDesc() { classDesc() {
return { return {
groupName: "auth", groupName: "auth",
......
...@@ -6,24 +6,25 @@ const CtlBase = require("../../ctl.base"); ...@@ -6,24 +6,25 @@ const CtlBase = require("../../ctl.base");
class UserCtl extends CtlBase { class UserCtl extends CtlBase {
constructor() { constructor() {
super("auth", CtlBase.getServiceName(UserCtl)); super("auth", CtlBase.getServiceName(UserCtl));
this.captchaSve = system.getObject("service.auth.captchaSve");
} }
async logout(pobj, qobj, req) { async logout (pobj, qobj, req) {
let rtn = await this.service.logout(pobj) let rtn = await this.service.logout(pobj)
return system.getResult(rtn) return system.getResult(rtn)
} }
async pmgetUserByCode(pobj, qobj, req) { async pmgetUserByCode (pobj, qobj, req) {
let code = pobj.code let code = pobj.code
let rtn = await this.service.pmgetUserByCode(code) let rtn = await this.service.pmgetUserByCode(code)
return system.getResult(rtn) return system.getResult(rtn)
} }
async loginApp(pobj, qobj, req) { async loginApp (pobj, qobj, req) {
let appkey = pobj.fromAppKey let appkey = pobj.fromAppKey
let uname = pobj.username let uname = pobj.username
let rtn = await this.service.loginApp(appkey, uname) let rtn = await this.service.loginApp(appkey, uname)
return system.getResult(rtn); return system.getResult(rtn);
} }
async resetPassword(pobj, qobj, req) { async resetPassword (pobj, qobj, req) {
try { try {
await this.service.resetPassword(req.xctx.username, pobj.onepassword) await this.service.resetPassword(req.xctx.username, pobj.onepassword)
return system.getResult({}); return system.getResult({});
...@@ -31,15 +32,18 @@ class UserCtl extends CtlBase { ...@@ -31,15 +32,18 @@ class UserCtl extends CtlBase {
return system.getResult(null, err.message) return system.getResult(null, err.message)
} }
} }
async allowOrNot(pobj, qobj, req) { async allowOrNot (pobj, qobj, req) {
await this.service.updateByWhere({ isEnabled: !pobj.isEnabled }, { company_id: pobj.company_id }) await this.service.updateByWhere({ isEnabled: !pobj.isEnabled }, { company_id: pobj.company_id })
return system.getResult({}); return system.getResult({});
} }
async allowOrNotToOne(pobj, qobj, req) { async allowOrNotToOne (pobj, qobj, req) {
if (!pobj.isEnabled) {
await this.service.cacheManager["LoginTimesCache"].invalidate(pobj.userName)
}
await this.service.updateByWhere({ isEnabled: !pobj.isEnabled }, { id: pobj.curid }) await this.service.updateByWhere({ isEnabled: !pobj.isEnabled }, { id: pobj.curid })
return system.getResult({}); return system.getResult({});
} }
async initNewInstance(queryobj, req) { async initNewInstance (queryobj, req) {
var rtn = {}; var rtn = {};
rtn.roles = []; rtn.roles = [];
return system.getResultSuccess(rtn); return system.getResultSuccess(rtn);
...@@ -50,11 +54,11 @@ class UserCtl extends CtlBase { ...@@ -50,11 +54,11 @@ class UserCtl extends CtlBase {
// let v = await this.smsS.sendVCode(mobile); // let v = await this.smsS.sendVCode(mobile);
// return system.getResult({ vcodestr: v }); // return system.getResult({ vcodestr: v });
// } // }
async exit(pobj, qobj, req) { async exit (pobj, qobj, req) {
} }
//应用的自由用户注册,无需验证,需要前端头设置公司KEY //应用的自由用户注册,无需验证,需要前端头设置公司KEY
async pmregisterByFreeUser(p, q, req) { async pmregisterByFreeUser (p, q, req) {
//检查是否有用户名和密码 //检查是否有用户名和密码
if (!pobj.userName || !pobj.password) { if (!pobj.userName || !pobj.password) {
return system.getResult(null, "请检查用户名和密码是否存在") return system.getResult(null, "请检查用户名和密码是否存在")
...@@ -68,7 +72,7 @@ class UserCtl extends CtlBase { ...@@ -68,7 +72,7 @@ class UserCtl extends CtlBase {
return rtn; return rtn;
} }
async create(p, q, req) { async create (p, q, req) {
//检查是否有用户名和密码 //检查是否有用户名和密码
if (!p.userName) { if (!p.userName) {
return system.getResult(null, "请检查用户名和密码是否存在") return system.getResult(null, "请检查用户名和密码是否存在")
...@@ -81,7 +85,7 @@ class UserCtl extends CtlBase { ...@@ -81,7 +85,7 @@ class UserCtl extends CtlBase {
//和租户绑定同一家公司 //和租户绑定同一家公司
//按照用户名和密码进行注册 //按照用户名和密码进行注册
//控制器端检查用户名和密码非空 //控制器端检查用户名和密码非空
async registerByTantent(p, q, req) { async registerByTantent (p, q, req) {
//检查是否有用户名和密码 //检查是否有用户名和密码
if (!pobj.userName) { if (!pobj.userName) {
return system.getResult(null, "请检查用户名和密码是否存在") return system.getResult(null, "请检查用户名和密码是否存在")
...@@ -90,7 +94,7 @@ class UserCtl extends CtlBase { ...@@ -90,7 +94,7 @@ class UserCtl extends CtlBase {
return rtn; return rtn;
} }
//租户用户名和密码的租户注册 //租户用户名和密码的租户注册
async pmregister(pobj, qobj, req) { async pmregister (pobj, qobj, req) {
//平台注册设置平台的应用ID //平台注册设置平台的应用ID
pobj.app_id = settings.pmappid; pobj.app_id = settings.pmappid;
//检查是否有用户名和密码 //检查是否有用户名和密码
...@@ -100,19 +104,46 @@ class UserCtl extends CtlBase { ...@@ -100,19 +104,46 @@ class UserCtl extends CtlBase {
var rtn = await this.service.pmregister(pobj); var rtn = await this.service.pmregister(pobj);
return system.getResult(rtn); return system.getResult(rtn);
} }
async pmlogin(pobj, qobj, req) { async pmlogin (pobj, qobj, req) {
//平台注册设置平台的应用ID //平台注册设置平台的应用ID
let verifyres = await this.captchaSve.apiValidator({key:pobj.key,code:pobj.code});
if (verifyres.status !== 0)
return verifyres;
let rtn = await this.service.pmlogin(pobj, qobj, req); let rtn = await this.service.pmlogin(pobj, qobj, req);
return system.getResult(rtn); let msg = null
if (!rtn) {//登录错误
let times = await this.service.cacheManager["LoginTimesCache"].incrAsync(pobj.userName);
if (times >= 4) {
await this.service.updateByWhere({ isEnabled: false }, { userName: pobj.userName })
msg = "登录超过4次失败,您的账户已被锁定,请联系管理员解锁."
}
} else {
await this.service.cacheManager["LoginTimesCache"].invalidate(pobj.userName)
}
return system.getResult(rtn, msg);
}
/**
* 重置密码
* @param {*} pobj
* @param {*} qobj
* @param {*} req
*/
async unlockUser (pobj, qobj, req) {
try {
await this.service.unlockUser(pobj.userName)
return system.getResult({});
} catch (err) {
return system.getResult(null, err.message)
}
} }
async getUserInfo(pobj, qobj, req) { async getUserInfo (pobj, qobj, req) {
let uname = req.xctx.username; let uname = req.xctx.username;
let rtn = await this.service.getUserInfo(uname); let rtn = await this.service.getUserInfo(uname);
return system.getResult(rtn); return system.getResult(rtn);
} }
//按照电话创建自由用户 //按照电话创建自由用户
async pmloginByVCodeForFreeUser(p, q, req) { async pmloginByVCodeForFreeUser (p, q, req) {
if (!pobj.mobile || !pobj.vcode) { if (!pobj.mobile || !pobj.vcode) {
return system.getResult(null, "请检查手机号和验证码是否存在") return system.getResult(null, "请检查手机号和验证码是否存在")
} }
...@@ -123,11 +154,11 @@ class UserCtl extends CtlBase { ...@@ -123,11 +154,11 @@ class UserCtl extends CtlBase {
let rtn = await this.service.pmloginByVCodeForFreeUser(p, q); let rtn = await this.service.pmloginByVCodeForFreeUser(p, q);
return rtn; return rtn;
} }
async pmloginByVCode(pobj, qobj, req) { async pmloginByVCode (pobj, qobj, req) {
let rtn = await this.service.pmloginByVCode(pobj, qobj); let rtn = await this.service.pmloginByVCode(pobj, qobj);
return system.getResult(rtn); return system.getResult(rtn);
} }
async pmSendVCode(pobj, qobj, req) { async pmSendVCode (pobj, qobj, req) {
let rtn = await this.service.sendVCode(pobj, qobj); let rtn = await this.service.sendVCode(pobj, qobj);
return system.getResult(rtn); return system.getResult(rtn);
} }
......
...@@ -5,62 +5,81 @@ var settings = require("../../../../config/settings"); ...@@ -5,62 +5,81 @@ var settings = require("../../../../config/settings");
const CtlBase = require("../../ctl.base"); const CtlBase = require("../../ctl.base");
class CompanyCtl extends CtlBase { class CompanyCtl extends CtlBase {
constructor() { constructor() {
super("common", CtlBase.getServiceName(CompanyCtl)); super("common", CtlBase.getServiceName(CompanyCtl));
} this.userSve = system.getObject("service.auth.userSve");
async update(p,q,req){
let u= await super.update(p,q,req)
//缓存失效
await this.cacheManager["CompanyCache"].invalidate(p.companykey)
let company=await this.cacheManager["CompanyCache"].cache(p.companykey)
return system.getResult(company)
}
async getMyApps(p,q,req){
let userfind = await this.cacheManager["UserCache"].cache(p.username)
let isSuper=userfind.isSuper
if(userfind.company.appids && userfind.company.appids!=""){
let appsarray=userfind.company.appids.split(",")
let appidsquery=appsarray.map(astr=>{
return astr.split("|")[0]
})
let apps=await this.service.getMyApps(appidsquery,isSuper)
return system.getResult(apps)
}else{
return []
} }
}
async bindApps(p,q,req){ async update(p, q, req) {
let appids=p.appids let u = await super.update(p, q, req)
let cmpid=p.postcmpid //缓存失效
let appids2=appids.map(item=>{ await this.cacheManager["CompanyCache"].invalidate(p.companykey)
return item.appid+"|"+item.title let company = await this.cacheManager["CompanyCache"].cache(p.companykey)
}) return system.getResult(company)
let appidstrs=appids2.join(",") }
await this.service.bindApps(appidstrs,cmpid)
return system.getResult(appids) async getMyApps(p, q, req) {
} let userfind = await this.cacheManager["UserCache"].cache(p.username)
async setOrgs(p,q,req){ let isSuper = userfind.isSuper
//let companynew=await this.service.findById(p.company_id) if (userfind.company.appids && userfind.company.appids != "") {
let orgs=await this.service.setOrgs(p) let appsarray = userfind.company.appids.split(",")
return system.getResult(orgs) let appidsquery = appsarray.map(astr => {
} return astr.split("|")[0]
async getOrgs(p,q,req){ })
//let companynew=await this.cacheManager["CompanyCache"].cache(req.xctx.fromcompanykey) let apps = await this.service.getMyApps(appidsquery, isSuper)
let companynew=await this.service.findById(p.company_id) return system.getResult(apps)
let orgjsonstr=companynew.orgJson } else {
let rtnjson=null return []
if(orgjsonstr && orgjsonstr!=""){ }
rtnjson=JSON.parse(companynew.orgJson) }
}else{
rtnjson=[] async bindApps(p, q, req) {
let appids = p.appids
let cmpid = p.postcmpid
let appids2 = appids.map(item => {
return item.appid + "|" + item.title
})
let appidstrs = appids2.join(",")
await this.service.bindApps(appidstrs, cmpid)
return system.getResult(appids)
}
async setOrgs(p, q, req) {
//let companynew=await this.service.findById(p.company_id)
let orgs = await this.service.setOrgs(p)
return system.getResult(orgs)
} }
return system.getResult({orgJson:rtnjson})
}
async refQuery(pobj, qobj, req) { async getOrgs(p, q, req) {
let rtn=await this.service.refQuery(pobj); //let companynew=await this.cacheManager["CompanyCache"].cache(req.xctx.fromcompanykey)
return rtn let companynew = await this.service.findById(p.company_id);
} const userData = await this.userSve.findById(p.userid);
let orgjsonstr = companynew.orgJson;
let rtnjson = null;
if (orgjsonstr && orgjsonstr != "") {
rtnjson = JSON.parse(companynew.orgJson);
} else {
rtnjson = [];
}
if (userData) {
if (userData.isAdmin || userData.isSuper) {
return system.getResult({orgJson: rtnjson});
} else {
return system.getResult({orgJson: this.service.buildOrgs(rtnjson, userData.ptags)});
}
} else {
return system.getResult({orgJson: []});
}
}
async getWatchOrgNodes(p, q, req) {
return await this.service.getWatchOrgNodes(p.company_id);
}
async refQuery(pobj, qobj, req) {
let rtn = await this.service.refQuery(pobj);
return rtn
}
} }
module.exports = CompanyCtl; module.exports = CompanyCtl;
var system = require("../../../system")
const http = require("http")
const querystring = require('querystring');
var settings = require("../../../../config/settings");
const CtlBase = require("../../ctl.base");
class PushCtl extends CtlBase {
constructor() {
super("common", CtlBase.getServiceName(PushCtl));
}
async findAndCountAll(pobj, qobj, req) {
let query = {
pageSize: pobj.pageInfo.pageSize,
pageIndex: pobj.pageInfo.pageNo
};
let search = pobj.search;
if (search.messageBody)
query.messageBody = search.messageBody;
if (search.identify_code)
query.identifyCode = search.identify_code;
if (search.request_id)
query.requestIdInfo = search.request_id;
let actionType;
switch (pobj.bizpath) {
case "/sysmag/pushfail":
actionType = "getPushFailureList";
break;
case "/sysmag/pusherror":
actionType = "getPushErrorList";
break
}
let rtn = await system.postJsonTypeReq(settings.pushUrl(), {
"actionType": actionType,
"actionBody": query
});
if (rtn.statusCode === 200) {
rtn = rtn.data;
if (rtn && rtn.status === 1) {
return system.getResult({
results: {
count: rtn.totalCount,
rows: rtn && rtn.data || []
}
});
} else {
return system.getResultFail(rtn && rtn.message || '请联系管理员');
}
} else {
return system.getResultFail(rtn)
}
}
async repush(pobj, qobj, req) {
let rtn = await system.postJsonTypeReq(settings.pushUrl(), {
"actionType": "pushAgainFailureLog",
"actionBody": {
id: pobj.id
}
});
if (rtn.statusCode === 200) {
return rtn.data;
} else {
return system.getResultFail(rtn)
}
}
}
module.exports = PushCtl;
const CacheBase = require("../cache.base");
const system = require("../../system");
const settings = require("../../../config/settings");
class LoginTimesCache extends CacheBase {
constructor() {
super();
}
isdebug() {
return false;
}
desc() {
return "缓存登录错误次数信息";
}
prefix() {
return "g_login_times_:"
}
async buildCacheVal(cachekey, inputkey, val, ex, ...items) {
if (val) {
return val;
}
return null;
}
async incrAsync(key) {
let cachekey = this.prefix + key
let cache = await this.getCache(key);
if (!cache) {
await this.cache(key, "0", 60)
}
return this.redisClient.incr(cachekey)
}
}
module.exports = LoginTimesCache;
\ No newline at end of file
...@@ -8,7 +8,7 @@ class UserCache extends CacheBase { ...@@ -8,7 +8,7 @@ class UserCache extends CacheBase {
this.channelDao = system.getObject("db.common.channelDao"); this.channelDao = system.getObject("db.common.channelDao");
} }
isdebug() { isdebug() {
return settings.env == "dev"; return settings.env == "localhost";
} }
desc() { desc() {
return "缓存本地应用对象"; return "缓存本地应用对象";
...@@ -19,7 +19,7 @@ class UserCache extends CacheBase { ...@@ -19,7 +19,7 @@ class UserCache extends CacheBase {
async buildCacheVal(cachekey, inputkey, val, ex, ...items) { async buildCacheVal(cachekey, inputkey, val, ex, ...items) {
const configValue = await this.userDao.model.findAll({ const configValue = await this.userDao.model.findAll({
where: { userName: inputkey, app_id: settings.pmappid, isEnabled: true }, where: { userName: inputkey, app_id: settings.pmappid, isEnabled: true },
attributes: ['id', 'userName', 'nickName', 'headUrl', 'jwtkey', 'jwtsecret', 'created_at', 'isSuper', 'isAdmin', 'isAllocated', 'mail', 'mobile', 'opath', 'ptags'], attributes: ['id', 'userName', 'nickName', 'headUrl', 'jwtkey', 'jwtsecret', 'created_at', 'isSuper', 'isAdmin', 'isAllocated', 'mail', 'mobile', 'opath', 'ptags','tx_uin'],
include: [ include: [
{ model: this.db.models.company, attributes: ['id', 'name', 'companykey', 'appids', "code"], raw: true }, { model: this.db.models.company, attributes: ['id', 'name', 'companykey', 'appids', "code"], raw: true },
{ model: this.db.models.role, as: "Roles", attributes: ["id", "code"], } { model: this.db.models.role, as: "Roles", attributes: ["id", "code"], }
......
...@@ -10,19 +10,20 @@ class VCodeCache extends CacheBase { ...@@ -10,19 +10,20 @@ class VCodeCache extends CacheBase {
// isdebug() { // isdebug() {
// return settings.env == "dev"; // return settings.env == "dev";
// } // }
desc() { desc () {
return "缓存给手机发送的验证码60妙"; return "缓存给手机发送的验证码60妙";
} }
prefix() { prefix () {
return "g_vcode_cm:" return "g_vcode_cm:"
} }
async buildCacheVal(cachekey, inputkey, val, ex, ...items) { async buildCacheVal (cachekey, inputkey, val, ex, ...items) {
//inputkey采用appkey_mobile的形式 //inputkey采用appkey_mobile的形式
var mobile = inputkey; var mobile = inputkey;
var tmplCode = val; var tmplCode = val;
var signName = items ? items[0] : ""; var signName = items ? items[0] : "";
var vcode = await this.smsUtil.getUidStr(6, 10); var vcode = await this.smsUtil.getUidStr(6, 10);
if (!tmplCode && !signName) { if (!tmplCode && !signName) {
console.log("=============================")
this.smsUtil.sendMsg(mobile, vcode); this.smsUtil.sendMsg(mobile, vcode);
} //tmplCode为发送短信编码,需在阿里开通,signName为短信头描述信息,二者没有传递则用默认的发送验证码 } //tmplCode为发送短信编码,需在阿里开通,signName为短信头描述信息,二者没有传递则用默认的发送验证码
else { else {
......
...@@ -9,10 +9,10 @@ class Dao { ...@@ -9,10 +9,10 @@ class Dao {
this.model = db.models[this.modelName]; this.model = db.models[this.modelName];
console.log(this.modelName); console.log(this.modelName);
} }
preCreate(u) { preCreate (u) {
return u; return u;
} }
async create(u, t) { async create (u, t) {
var u2 = this.preCreate(u); var u2 = this.preCreate(u);
if (t) { if (t) {
console.log(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"); console.log(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
...@@ -26,10 +26,10 @@ class Dao { ...@@ -26,10 +26,10 @@ class Dao {
}); });
} }
} }
static getModelName(ClassObj) { static getModelName (ClassObj) {
return ClassObj["name"].substring(0, ClassObj["name"].lastIndexOf("Dao")).toLowerCase() return ClassObj["name"].substring(0, ClassObj["name"].lastIndexOf("Dao")).toLowerCase()
} }
async refQuery(qobj) { async refQuery (qobj) {
var w = qobj.refwhere ? qobj.refwhere : {}; var w = qobj.refwhere ? qobj.refwhere : {};
if (qobj.levelinfo) { if (qobj.levelinfo) {
w[qobj.levelinfo.levelfield] = qobj.levelinfo.level; w[qobj.levelinfo.levelfield] = qobj.levelinfo.level;
...@@ -48,7 +48,7 @@ class Dao { ...@@ -48,7 +48,7 @@ class Dao {
return this.model.findAll({ where: w, attributes: qobj.fields }); return this.model.findAll({ where: w, attributes: qobj.fields });
} }
} }
async bulkDelete(ids, t) { async bulkDelete (ids, t) {
if (t) { if (t) {
var en = await this.model.destroy({ where: { id: { [this.db.Op.in]: ids } }, transaction: t }); var en = await this.model.destroy({ where: { id: { [this.db.Op.in]: ids } }, transaction: t });
return en; return en;
...@@ -58,7 +58,7 @@ class Dao { ...@@ -58,7 +58,7 @@ class Dao {
} }
} }
async bulkDeleteByWhere(whereParam, t) { async bulkDeleteByWhere (whereParam, t) {
var en = null; var en = null;
if (t != null && t != 'undefined') { if (t != null && t != 'undefined') {
whereParam.transaction = t; whereParam.transaction = t;
...@@ -67,7 +67,7 @@ class Dao { ...@@ -67,7 +67,7 @@ class Dao {
return await this.model.destroy(whereParam); return await this.model.destroy(whereParam);
} }
} }
async delete(qobj, t) { async delete (qobj, t) {
var en = null var en = null
if (t != null && t != 'undefined') { if (t != null && t != 'undefined') {
en = await this.model.findOne({ where: { id: qobj.id }, transaction: t }); en = await this.model.findOne({ where: { id: qobj.id }, transaction: t });
...@@ -83,14 +83,14 @@ class Dao { ...@@ -83,14 +83,14 @@ class Dao {
} }
return null; return null;
} }
extraModelFilter(pobj) { extraModelFilter (pobj) {
//return {"key":"include","value":{model:this.db.models.app}}; //return {"key":"include","value":{model:this.db.models.app}};
return null; return null;
} }
extraWhere(obj, where) { extraWhere (obj, where) {
return where; return where;
} }
orderBy(qobj) { orderBy (qobj) {
//return {"key":"include","value":{model:this.db.models.app}}; //return {"key":"include","value":{model:this.db.models.app}};
if (!qobj.orderInfo || qobj.orderInfo.length == 0) { if (!qobj.orderInfo || qobj.orderInfo.length == 0) {
return [["created_at", "DESC"]]; return [["created_at", "DESC"]];
...@@ -99,15 +99,17 @@ class Dao { ...@@ -99,15 +99,17 @@ class Dao {
} }
} }
buildQuery(qobj) { buildQuery (qobj) {
var linkAttrs = []; var linkAttrs = [];
const pageNo = qobj.pageInfo.pageNo; const pageNo = qobj.pageInfo.pageNo;
const pageSize = qobj.pageInfo.pageSize; const pageSize = qobj.pageInfo.pageSize;
const search = qobj.search; const search = qobj.search;
var qc = {}; var qc = {};
//设置分页查询条件 //设置分页查询条件
qc.limit = pageSize; if (pageNo != -1) {
qc.offset = (pageNo - 1) * pageSize; qc.limit = pageSize;
qc.offset = (pageNo - 1) * pageSize;
}
//默认的查询排序 //默认的查询排序
qc.order = this.orderBy(qobj); qc.order = this.orderBy(qobj);
//构造where条件 //构造where条件
...@@ -157,7 +159,7 @@ class Dao { ...@@ -157,7 +159,7 @@ class Dao {
console.log(qc); console.log(qc);
return qc; return qc;
} }
buildaggs(qobj) { buildaggs (qobj) {
var aggsinfos = []; var aggsinfos = [];
if (qobj.aggsinfo) { if (qobj.aggsinfo) {
qobj.aggsinfo.sum.forEach(aggitem => { qobj.aggsinfo.sum.forEach(aggitem => {
...@@ -171,7 +173,7 @@ class Dao { ...@@ -171,7 +173,7 @@ class Dao {
} }
return aggsinfos; return aggsinfos;
} }
async findAggs(qobj, qcwhere) { async findAggs (qobj, qcwhere) {
var aggArray = this.buildaggs(qobj); var aggArray = this.buildaggs(qobj);
if (aggArray.length != 0) { if (aggArray.length != 0) {
qcwhere["attributes"] = {}; qcwhere["attributes"] = {};
...@@ -190,7 +192,7 @@ class Dao { ...@@ -190,7 +192,7 @@ class Dao {
} }
} }
async findAndCountAll(qobj, t) { async findAndCountAll (qobj, t) {
var qc = this.buildQuery(qobj); var qc = this.buildQuery(qobj);
let findList = {} let findList = {}
let count = await this.findCount({ where: qc.where }) let count = await this.findCount({ where: qc.where })
...@@ -203,18 +205,22 @@ class Dao { ...@@ -203,18 +205,22 @@ class Dao {
rtn.aggresult = aggresult; rtn.aggresult = aggresult;
return rtn; return rtn;
} }
preUpdate(obj) { preUpdate (obj) {
return obj; return obj;
} }
async update(obj, tm) { async update (obj, tm) {
var obj2 = this.preUpdate(obj); var obj2 = this.preUpdate(obj);
if (tm != null && tm != 'undefined') { if (tm != null && tm != 'undefined') {
return this.model.update(obj2, { where: { id: obj2.id }, transaction: tm }); await this.model.update(obj2, { where: { id: obj2.id }, transaction: tm });
let n = await this.model.findOne({ where: { id: obj2.id }, transaction: tm });
return n
} else { } else {
return this.model.update(obj2, { where: { id: obj2.id } }); await this.model.update(obj2, { where: { id: obj2.id } });
let n = await this.model.findById(obj2.id)
return n
} }
} }
async bulkCreate(ids, t) { async bulkCreate (ids, t) {
if (t != null && t != 'undefined') { if (t != null && t != 'undefined') {
return await this.model.bulkCreate(ids, { transaction: t }); return await this.model.bulkCreate(ids, { transaction: t });
} else { } else {
...@@ -222,7 +228,7 @@ class Dao { ...@@ -222,7 +228,7 @@ class Dao {
} }
} }
async updateByWhere(setObj, whereObj, t) { async updateByWhere (setObj, whereObj, t) {
let inWhereObj = {} let inWhereObj = {}
if (t && t != 'undefined') { if (t && t != 'undefined') {
if (whereObj && whereObj != 'undefined') { if (whereObj && whereObj != 'undefined') {
...@@ -236,10 +242,10 @@ class Dao { ...@@ -236,10 +242,10 @@ class Dao {
} }
return this.model.update(setObj, inWhereObj); return this.model.update(setObj, inWhereObj);
} }
async customExecAddOrPutSql(sql, paras = null) { async customExecAddOrPutSql (sql, paras = null) {
return this.db.query(sql, paras); return this.db.query(sql, paras);
} }
async customQuery(sql, paras, t) { async customQuery (sql, paras, t) {
var tmpParas = null;//||paras=='undefined'?{type: this.db.QueryTypes.SELECT }:{ replacements: paras, type: this.db.QueryTypes.SELECT }; var tmpParas = null;//||paras=='undefined'?{type: this.db.QueryTypes.SELECT }:{ replacements: paras, type: this.db.QueryTypes.SELECT };
if (t && t != 'undefined') { if (t && t != 'undefined') {
if (paras == null || paras == 'undefined') { if (paras == null || paras == 'undefined') {
...@@ -254,15 +260,15 @@ class Dao { ...@@ -254,15 +260,15 @@ class Dao {
} }
return this.db.query(sql, tmpParas); return this.db.query(sql, tmpParas);
} }
async findCount(whereObj = null) { async findCount (whereObj = null) {
return this.model.count(whereObj, { logging: false }).then(c => { return this.model.count(whereObj, { logging: false }).then(c => {
return c; return c;
}); });
} }
async findSum(fieldName, whereObj = null) { async findSum (fieldName, whereObj = null) {
return this.model.sum(fieldName, whereObj); return this.model.sum(fieldName, whereObj);
} }
async getPageList(pageIndex, pageSize, whereObj = null, orderObj = null, attributesObj = null, includeObj = null) { async getPageList (pageIndex, pageSize, whereObj = null, orderObj = null, attributesObj = null, includeObj = null) {
var tmpWhere = {}; var tmpWhere = {};
tmpWhere.limit = pageSize; tmpWhere.limit = pageSize;
tmpWhere.offset = (pageIndex - 1) * pageSize; tmpWhere.offset = (pageIndex - 1) * pageSize;
...@@ -283,20 +289,20 @@ class Dao { ...@@ -283,20 +289,20 @@ class Dao {
} }
return await this.model.findAndCountAll(tmpWhere); return await this.model.findAndCountAll(tmpWhere);
} }
async findOne(obj, attributes = []) { async findOne (obj, attributes = []) {
if (attributes.length > 0) { if (attributes.length > 0) {
return this.model.findOne({ "where": obj, attributes, row: true }); return this.model.findOne({ "where": obj, attributes, row: true });
} else { } else {
return this.model.findOne({ "where": obj, row: true }); return this.model.findOne({ "where": obj, row: true });
} }
} }
async findOneWithTm(obj, t) { async findOneWithTm (obj, t) {
return this.model.findOne({ "where": obj, transaction: t }); return this.model.findOne({ "where": obj, transaction: t });
} }
async findById(oid) { async findById (oid) {
return this.model.findById(oid); return this.model.findById(oid);
} }
async findAll(obj, include = [], other = {}) { async findAll (obj, include = [], other = {}) {
return this.model.findAll({ "where": obj, include, row: true, ...other }); return this.model.findAll({ "where": obj, include, row: true, ...other });
} }
} }
......
...@@ -101,6 +101,9 @@ class UserDao extends Dao { ...@@ -101,6 +101,9 @@ class UserDao extends Dao {
w[strq] = { [this.db.Op.like]: "%" + search[lnkKey] + "%" }; w[strq] = { [this.db.Op.like]: "%" + search[lnkKey] + "%" };
} }
qc.attributes = {
exclude: ["password", "jwtkey", "jwtsecret"]
}
return w; return w;
} }
async preUpdate(u) { async preUpdate(u) {
......
...@@ -45,6 +45,9 @@ module.exports = (db, DataTypes) => { ...@@ -45,6 +45,9 @@ module.exports = (db, DataTypes) => {
type: DataTypes.BOOLEAN, type: DataTypes.BOOLEAN,
defaultValue: false defaultValue: false
}, },
last_change_date: {
type: DataTypes.DATE,
},
isSuper: { isSuper: {
type: DataTypes.BOOLEAN, type: DataTypes.BOOLEAN,
defaultValue: false defaultValue: false
...@@ -75,6 +78,9 @@ module.exports = (db, DataTypes) => { ...@@ -75,6 +78,9 @@ module.exports = (db, DataTypes) => {
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: true, allowNull: true,
}, },
tx_uin: {
type: DataTypes.STRING,
},
isDelivery: { isDelivery: {
type: DataTypes.BOOLEAN, type: DataTypes.BOOLEAN,
defaultValue: false defaultValue: false
......
const system = require("../../../system");
const ServiceBase = require("../../sve.base");
var settings = require("../../../../config/settings");
const uuidv4 = require('uuid/v4');
var svgCaptcha = require('svg-captcha');
class CaptchaService {
constructor() {
this.redisClient = system.getObject("util.redisClient");
}
async apiGenerate(params) {
var key = uuidv4();
var options = {
size: 4,
noise: 1,
ignoreChars: '0o1iILl'
};
options.width = this.trim(params.width) || 120;
options.height = this.trim(params.height) || 32;
options.background = this.trim(params.background) || "#E8E8E8";
var captchaPrev = this.trim(params.captchaPrev);
var expire = Number(params.expire || 3 * 60)
try {
var cap = svgCaptcha.create(options);
console.log(cap);
await this.redisClient.setWithEx(key, cap.text, expire);
return system.getResultSuccess({
key: key,
text: cap.text,
captcha: cap.data,
});
} catch (error) {
return system.getResult(null, "接口异常:" + error.message);
}
}
async apiValidator(params) {
var key = this.trim(params.key);
var code = this.trim(params.code);
var cacheCode = await this.redisClient.get(key);
if(!cacheCode) {
return system.getResult(null, "验证码已过期,请点击重试");
}
if(code.toLowerCase() != cacheCode.toLowerCase()) {
await this.redisClient.delete(key);
return system.getResult(null, "验证码输入错误,请点击重试");
}
return system.getResultSuccess(1);
}
trim(o) {
if(!o) {
return "";
}
return o.toString().trim();
}
}
module.exports = CaptchaService;
\ No newline at end of file
...@@ -103,7 +103,7 @@ class ProductService extends ServiceBase { ...@@ -103,7 +103,7 @@ class ProductService extends ServiceBase {
if (productprices.length > 0) { if (productprices.length > 0) {
await self.priceDao.bulkCreate(productprices, t) await self.priceDao.bulkCreate(productprices, t)
} }
return {}; return currentProduct;
}); });
} }
} }
......
const system = require("../../../system"); const system = require("../../../system");
const ServiceBase = require("../../sve.base"); const ServiceBase = require("../../sve.base");
const _ = require("lodash");
class ProductpriceService extends ServiceBase { class ProductpriceService extends ServiceBase {
constructor() { constructor() {
super("product", ServiceBase.getDaoName(ProductpriceService)); super("product", ServiceBase.getDaoName(ProductpriceService));
...@@ -8,7 +9,7 @@ class ProductpriceService extends ServiceBase { ...@@ -8,7 +9,7 @@ class ProductpriceService extends ServiceBase {
* @param {*} pname 产品名称 * @param {*} pname 产品名称
* @param {*} spname 服务商名称 * @param {*} spname 服务商名称
*/ */
async findRegionsByProductName (productname, spname) { async findRegionsByProductName(productname, spname) {
let ps = await this.dao.model.findAll({ let ps = await this.dao.model.findAll({
where: { where: {
sptags: { [this.db.Op.like]: "%" + spname + "%" }, sptags: { [this.db.Op.like]: "%" + spname + "%" },
...@@ -53,7 +54,64 @@ class ProductpriceService extends ServiceBase { ...@@ -53,7 +54,64 @@ class ProductpriceService extends ServiceBase {
}) })
return psrtn return psrtn
} }
async updownProduct (uid) {
/**
* 为 财税 提供 产品 详情 接口
* @param {*} productname 产品名称 小规模纳税人、一般纳税人
* @param {*} region 地区
* @param {*} spname 服务商
*/
async findProductInfoForFt(productname, region, spname = '公司宝') {
let datas = await this.dao.model.findAll({
where: {
$and: [
{
sptags: { $like: "%" + spname + "%" },
isEnabled: true,
pname: { $like: "%" + "财税服务" + "%" },
}, {
pname: { $like: "%" + "代理记账" + "%" }
}
]
},
attributes: ['pname', 'strategyitems', "hignpriceref"], // 价格、地区、skucode
raw: true
});
let result = [];
//查询出地区
let address = await this.db.models.region.findAll({ attributes: ['code', 'name'], raw: true });
for (let val of datas) {
let area = val.pname.split("~")[1].split("/");
area = area[area.length - 1];
//按照名字去取地区编码
let areaCode = address.filter(f => {
if (f.name.indexOf(area) >= 0) {
return true
} else {
return false
}
})
areaCode = `${areaCode[0].code}00`;
result.push({
area,
areaCode,
type: val.strategyitems,
price: val.hignpriceref
})
}
result = _.groupBy(result, 'type')
if (productname) {
result = result[productname];
}
if (productname && region) {
result = _.find(result, (item) => {
return item.area.indexOf(region) >= 0
})
}
return result
}
async updownProduct(uid) {
let p = await this.dao.findById(uid) let p = await this.dao.findById(uid)
p.isEnabled = !p.isEnabled p.isEnabled = !p.isEnabled
await p.save() await p.save()
......
...@@ -11,11 +11,11 @@ class ServiceBase { ...@@ -11,11 +11,11 @@ class ServiceBase {
this.daoName = daoName; this.daoName = daoName;
this.dao = system.getObject("db." + gname + "." + daoName); this.dao = system.getObject("db." + gname + "." + daoName);
this.restS = system.getObject("util.restClient"); this.restS = system.getObject("util.restClient");
this.md5 = require("MD5"); this.crypto = require('crypto');
} }
/** /**
* *
* @param {*} str * @param {*} str
* @param {*} isComplexVerification 是否复杂验证 * @param {*} isComplexVerification 是否复杂验证
*/ */
getEncryptStr(str, isComplexVerification) { getEncryptStr(str, isComplexVerification) {
...@@ -25,9 +25,8 @@ class ServiceBase { ...@@ -25,9 +25,8 @@ class ServiceBase {
if (isComplexVerification) { if (isComplexVerification) {
this.complexVerification(str) this.complexVerification(str)
} }
let pwd = this.crypto.createHash("sha256").update(str + "_" + settings.salt, "utf8").digest("base64");
var md5 = this.md5(str + "_" + settings.salt); return pwd.toLowerCase();
return md5.toString().toLowerCase();
} }
complexVerification(str) { complexVerification(str) {
......
...@@ -6,7 +6,8 @@ class ExecClient { ...@@ -6,7 +6,8 @@ class ExecClient {
constructor() { constructor() {
this.cmdPostPattern = "curl -k -H 'Content-type: application/json' -d '{data}' {url}"; this.cmdPostPattern = "curl -k -H 'Content-type: application/json' -d '{data}' {url}";
this.cmdGetPattern = "curl -G -X GET '{url}'"; this.cmdGetPattern = "curl -G -X GET '{url}'";
this.cmdPostPattern3 = "curl -k -H 'Content-type: application/json' -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJvcnpaWmhXRXBKNVVFZzRZUU5uUmlyVEJXa1FQbnZ6UyIsImlhdCI6MTU5MjcwOTYzNn0.TWk_F6Tz3fRMqspoG24VSt5RiC4ldFembFYcLcAbowE' -H 'XAPPKEY: 647a68c9-da01-40d3-9763-1ffa0f64cf3f' -d '{data}' {url}"; this.cmdPostPattern3 = "curl -k -H 'Content-type: application/json' -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1OTg0MzQ2ODcsImlzcyI6InJFRVN6TU5ZUlM2RnBWNnZlY09vdExPNWdPcUNXSmFQIiwiaWF0IjoxNTk4NDMxMDg3fQ.isQ40HqHHfJ-rTsUQOhRIdu4XCitZU-AfzeqSH4kPbQ' -H 'XAPPKEY: f6b59b74-f943-4735-bb86-e05d6b7fd78e' -d '{data}' {url}";
//this.cmdPostPattern3 = "curl -k -H 'Content-type: application/json' -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJvcnpaWmhXRXBKNVVFZzRZUU5uUmlyVEJXa1FQbnZ6UyIsImlhdCI6MTU5MjcwOTYzNn0.TWk_F6Tz3fRMqspoG24VSt5RiC4ldFembFYcLcAbowE' -H 'XAPPKEY: 647a68c9-da01-40d3-9763-1ffa0f64cf3f' -d '{data}' {url}";
} }
async exec(cmd) { async exec(cmd) {
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
var System = require("../../base/system"); var System = require("../../base/system");
const chnelapi = System.getObject("api.common.channels") const chnelapi = System.getObject("api.common.channels")
var channelCache = {} var channelCache = {}
module.exports = function (app) { module.exports = function (app) {
app.get("/autologin", (req, res, next) => { app.get("/autologin", (req, res, next) => {
//读取cookie,获取cookie值, //读取cookie,获取cookie值,
...@@ -9,6 +10,7 @@ module.exports = function (app) { ...@@ -9,6 +10,7 @@ module.exports = function (app) {
//Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6ImRjMmM1MzMwMjNhMTExZTlhOTU3NjliODBiNDI4Y2QxIn0.eyJpZCI6IjViZDk2MWJkZWQxN2E5MmI1MDFjZWQ0ZCIsIm5hbWUiOiLpnZLph4kxMSIsImVtcGxveWVlIjoiNWQ5ZWNlODc1Zjk3ZGQzMzEwNzI4ZjY4IiwicGhvbmUiOiI3TFlYZ29ySkdGM2hBbHdqQTZGelFnPT0iLCJvcmdpZCI6IjViY2ZlOTVjYjBhMDFmMDAwOTI4NGJjMyIsInBsYXRmb3JtIjoiZDVmYTU4Yjk3NGExMjBlZTYxMTMzM2MwMDNjOWZlYzAiLCJ1bmlvbmlkIjoib2RuWjR0OERoV1V0N0lXT09maEF0UTdqM1docyIsImp0aSI6Imo3R0hLRGFzNDEzQTQ2OGkiLCJleHAiOjE1OTYwODEzMTEsImlhdCI6MTU5NTQ3NjUxMX0.I196XbcCR3k7r1O8uwoI2HUhow0UhGHKzii5wOR39vLmuNOUatNY7ccQTCHijqysbSCePP43Iuglrl2gLQASf5uAr9uqTzhTc3O4Z5iF3oR2qR1vlBxrzTDF8xuhKHQ4tO6Hbsib0FdOYVeU8fe0g_GZiIcuYIv-f8VsiAGMF9TEES129CDwZacJfVViw4EXVnXSivAzQG4JgGSwUACvPT140bCZ1XPeHi0GXmgtEN77NjWfOGI5RYGC0Gq3CGevlSWERjb3mUscAIjoXsOxlWNwy7dc1u1A7uX1a6bUhLU1wtiQ6md4TnyeR5OdYeVqGlIe3hZGcH_E3QrQMq988Q //Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6ImRjMmM1MzMwMjNhMTExZTlhOTU3NjliODBiNDI4Y2QxIn0.eyJpZCI6IjViZDk2MWJkZWQxN2E5MmI1MDFjZWQ0ZCIsIm5hbWUiOiLpnZLph4kxMSIsImVtcGxveWVlIjoiNWQ5ZWNlODc1Zjk3ZGQzMzEwNzI4ZjY4IiwicGhvbmUiOiI3TFlYZ29ySkdGM2hBbHdqQTZGelFnPT0iLCJvcmdpZCI6IjViY2ZlOTVjYjBhMDFmMDAwOTI4NGJjMyIsInBsYXRmb3JtIjoiZDVmYTU4Yjk3NGExMjBlZTYxMTMzM2MwMDNjOWZlYzAiLCJ1bmlvbmlkIjoib2RuWjR0OERoV1V0N0lXT09maEF0UTdqM1docyIsImp0aSI6Imo3R0hLRGFzNDEzQTQ2OGkiLCJleHAiOjE1OTYwODEzMTEsImlhdCI6MTU5NTQ3NjUxMX0.I196XbcCR3k7r1O8uwoI2HUhow0UhGHKzii5wOR39vLmuNOUatNY7ccQTCHijqysbSCePP43Iuglrl2gLQASf5uAr9uqTzhTc3O4Z5iF3oR2qR1vlBxrzTDF8xuhKHQ4tO6Hbsib0FdOYVeU8fe0g_GZiIcuYIv-f8VsiAGMF9TEES129CDwZacJfVViw4EXVnXSivAzQG4JgGSwUACvPT140bCZ1XPeHi0GXmgtEN77NjWfOGI5RYGC0Gq3CGevlSWERjb3mUscAIjoXsOxlWNwy7dc1u1A7uX1a6bUhLU1wtiQ6md4TnyeR5OdYeVqGlIe3hZGcH_E3QrQMq988Q
}) })
app.all("*", async function (req, res, next) { app.all("*", async function (req, res, next) {
try { try {
let channel = null let channel = null
...@@ -34,6 +36,11 @@ module.exports = function (app) { ...@@ -34,6 +36,11 @@ module.exports = function (app) {
res.end(JSON.stringify({ status: -1, message: e })); res.end(JSON.stringify({ status: -1, message: e }));
} }
}) })
app.post("/login/getpiccode", async (req, res, next) => {
let captchaSve = System.getObject("service.auth.captchaSve");
let data = await captchaSve.apiGenerate({})
res.end(JSON.stringify(data));
});
app.get('/api/:gname/:qname/:method', function (req, res) { app.get('/api/:gname/:qname/:method', function (req, res) {
// var classPath = req.params["qname"]; // var classPath = req.params["qname"];
var methodName = req.params["method"]; var methodName = req.params["method"];
......
...@@ -19,7 +19,8 @@ var settings = { ...@@ -19,7 +19,8 @@ var settings = {
encrypt_key: ENVINPUT.ENCRYPT_KEY, encrypt_key: ENVINPUT.ENCRYPT_KEY,
encrypt_secret: ENVINPUT.ENCRYPT_SECRET, encrypt_secret: ENVINPUT.ENCRYPT_SECRET,
salt: "%iatpD1gcxz7iF#B", salt: "%iatpD1gcxz7iF#B",
defaultpwd: "gsb2020", defaultpwd: "Temp123456",
changepwdcycle: 365,//密码更换周期 7天前登录提示更改密码 到期后直接禁用账户
basepath: path.normalize(path.join(__dirname, '../..')), basepath: path.normalize(path.join(__dirname, '../..')),
port: process.env.NODE_PORT || 80, port: process.env.NODE_PORT || 80,
logindex: "center_manage", logindex: "center_manage",
...@@ -28,7 +29,14 @@ var settings = { ...@@ -28,7 +29,14 @@ var settings = {
if (this.env == "localhost") { if (this.env == "localhost") {
var localsettings = require("./localsettings"); var localsettings = require("./localsettings");
return localsettings.kongurl; return localsettings.kongurl;
} else { }
else if (this.env == "test") {
return "http://kong-dbproxy.kong-test:8001/";
}
else if (this.env == "pre") {
return "http://kong-dbproxy.kong-pre:8001/";
}
else {
return "http://kong-dbproxy.kong:8001/"; return "http://kong-dbproxy.kong:8001/";
} }
}, },
...@@ -39,6 +47,13 @@ var settings = { ...@@ -39,6 +47,13 @@ var settings = {
return "http://icdeliver-service"; return "http://icdeliver-service";
} }
}, },
bookUrl: function () {
if (this.env == "localhost") {
return "http://192.168.1.19:8889";
} else {
return "http://icdeliver-service";
}
},
logUrl: function () { logUrl: function () {
if (this.env == "localhost") { if (this.env == "localhost") {
return "http://192.168.1.128:4019/api/queueAction/producer/springBoard"; return "http://192.168.1.128:4019/api/queueAction/producer/springBoard";
...@@ -46,6 +61,21 @@ var settings = { ...@@ -46,6 +61,21 @@ var settings = {
return "http://logs-sytxpublic-msgq-service/api/queueAction/producer/springBoard"; return "http://logs-sytxpublic-msgq-service/api/queueAction/producer/springBoard";
} }
}, },
pushUrl: function () {
if (this.env == "localhost") {
return "http://192.168.18.101:4018/api/queueAction/producer/springBoard";
} else {
return "http://logs-sytxpublic-msgq-service/api/queueAction/producer/springBoard";
}
},
bpushUrl: function () {
if (this.env == "localhost") {
return "http://192.168.1.19:4018/api/queueAction/producer/springBoard";
} else {
return "http://logs-sytxpublic-msgq-service/api/queueAction/producer/springBoard";
}
},
pmappname: "center-app", pmappname: "center-app",
pmappid: 1, pmappid: 1,
pmcompanyid: 1, pmcompanyid: 1,
...@@ -66,7 +96,6 @@ var settings = { ...@@ -66,7 +96,6 @@ var settings = {
database: function () { database: function () {
if (this.env == "localhost") { if (this.env == "localhost") {
var localsettings = require("./localsettings"); var localsettings = require("./localsettings");
console.log(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>....")
return localsettings.database; return localsettings.database;
} else { } else {
return { return {
......
...@@ -56,7 +56,8 @@ ...@@ -56,7 +56,8 @@
"sha256": "^0.2.0", "sha256": "^0.2.0",
"socket.io": "^2.1.1", "socket.io": "^2.1.1",
"uuid": "^3.2.1", "uuid": "^3.2.1",
"xml2js": "^0.4.19" "xml2js": "^0.4.19",
"svg-captcha": "^1.4.0"
}, },
"devDependencies": { "devDependencies": {
"del": "^5.1.0", "del": "^5.1.0",
......
ALTER TABLE `brg-center-manage`.`p_user`
ADD COLUMN `last_change_date` datetime NOT NULL COMMENT '最后更新时间'
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width,initial-scale=1.0"> <meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="/ccc.png"> <link rel="icon" href="/ccc.png">
<title></title> <title></title>
<link href="/0.js" rel="prefetch"><link href="/1.js" rel="prefetch"><link href="/10.js" rel="prefetch"><link href="/11.js" rel="prefetch"><link href="/12.js" rel="prefetch"><link href="/13.js" rel="prefetch"><link href="/14.js" rel="prefetch"><link href="/15.js" rel="prefetch"><link href="/16.js" rel="prefetch"><link href="/17.js" rel="prefetch"><link href="/18.js" rel="prefetch"><link href="/19.js" rel="prefetch"><link href="/2.js" rel="prefetch"><link href="/20.js" rel="prefetch"><link href="/21.js" rel="prefetch"><link href="/22.js" rel="prefetch"><link href="/23.js" rel="prefetch"><link href="/24.js" rel="prefetch"><link href="/25.js" rel="prefetch"><link href="/26.js" rel="prefetch"><link href="/27.js" rel="prefetch"><link href="/28.js" rel="prefetch"><link href="/29.js" rel="prefetch"><link href="/3.js" rel="prefetch"><link href="/30.js" rel="prefetch"><link href="/31.js" rel="prefetch"><link href="/32.js" rel="prefetch"><link href="/33.js" rel="prefetch"><link href="/34.js" rel="prefetch"><link href="/35.js" rel="prefetch"><link href="/36.js" rel="prefetch"><link href="/37.js" rel="prefetch"><link href="/38.js" rel="prefetch"><link href="/4.js" rel="prefetch"><link href="/5.js" rel="prefetch"><link href="/6.js" rel="prefetch"><link href="/7.js" rel="prefetch"><link href="/8.js" rel="prefetch"><link href="/9.js" rel="prefetch"><link href="/app.js" rel="preload" as="script"></head> <link href="/0.js" rel="prefetch"><link href="/1.js" rel="prefetch"><link href="/10.js" rel="prefetch"><link href="/11.js" rel="prefetch"><link href="/12.js" rel="prefetch"><link href="/13.js" rel="prefetch"><link href="/14.js" rel="prefetch"><link href="/15.js" rel="prefetch"><link href="/16.js" rel="prefetch"><link href="/17.js" rel="prefetch"><link href="/18.js" rel="prefetch"><link href="/19.js" rel="prefetch"><link href="/2.js" rel="prefetch"><link href="/20.js" rel="prefetch"><link href="/21.js" rel="prefetch"><link href="/22.js" rel="prefetch"><link href="/23.js" rel="prefetch"><link href="/24.js" rel="prefetch"><link href="/25.js" rel="prefetch"><link href="/26.js" rel="prefetch"><link href="/27.js" rel="prefetch"><link href="/28.js" rel="prefetch"><link href="/29.js" rel="prefetch"><link href="/3.js" rel="prefetch"><link href="/30.js" rel="prefetch"><link href="/31.js" rel="prefetch"><link href="/32.js" rel="prefetch"><link href="/33.js" rel="prefetch"><link href="/34.js" rel="prefetch"><link href="/35.js" rel="prefetch"><link href="/36.js" rel="prefetch"><link href="/37.js" rel="prefetch"><link href="/38.js" rel="prefetch"><link href="/39.js" rel="prefetch"><link href="/4.js" rel="prefetch"><link href="/5.js" rel="prefetch"><link href="/6.js" rel="prefetch"><link href="/7.js" rel="prefetch"><link href="/8.js" rel="prefetch"><link href="/9.js" rel="prefetch"><link href="/app.js" rel="preload" as="script"></head>
<body> <body>
<noscript> <noscript>
<strong>We're sorry but iview-admin doesn't work properly without JavaScript enabled. Please enable it to continue.</strong> <strong>We're sorry but iview-admin doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
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