Commit 567e162e by 蒋勇

d

parent f261272a
#!/bin/bash #!/bin/bash
FROM registry.cn-beijing.aliyuncs.com/hantang2/node105:v2 FROM registry.cn-beijing.aliyuncs.com/hantang2/node105:v2
MAINTAINER jy "jiangyong@gongsibao.com" MAINTAINER jy "jiangyong@gongsibao.com"
ADD bigdata /apps/bigdata/ ADD center-manage /apps/center-manage/
WORKDIR /apps/bigdata/ WORKDIR /apps/center-manage/
RUN cnpm install -S RUN cnpm install -S
CMD ["node","/apps/bigdata/main.js"] CMD ["node","/apps/center-manage/main.js"]
......
const system = require("../system");
const uuidv4 = require('uuid/v4');
const DocBase = require("./doc.base");
const settings = require("../../config/settings");
class APIBase extends DocBase {
constructor() {
super();
this.redisClient = system.getObject("util.redisClient");
this.cacheManager = system.getObject("db.common.cacheManager");
this.apitradeSvr = system.getObject("service.common.apitradeSve");
this.logCtl = system.getObject("web.common.oplogCtl");
}
getUUID() {
var uuid = uuidv4();
var u = uuid.replace(/\-/g, "");
return u;
}
/**
* 白名单验证
* @param {*} gname 组名
* @param {*} methodname 方法名
*/
async isCheckWhiteList(gname, methodname) {
var fullname = gname + "." + methodname;
var lst = [
"auth.getAccessKey",
"meta.getBaseComp",
"meta.doc",
"meta.clearAllCache",
"meta.upline",
];
var x = lst.indexOf(fullname);
return x >= 0;
}
async checkAcck(gname, methodname, pobj, query, req) {
var apptocheck = null;
var isCheckWhite = await this.isCheckWhiteList(gname, methodname);
if (!isCheckWhite) {//在验证请单里面,那么就检查访问token
var ak = req.headers["accesskey"];
try {
apptocheck = await this.cacheManager["ApiAccessKeyCache"].cache(ak, null, null, null);
} catch (e) {
this.logCtl.error({
optitle: "获取访问token异常_error",
op: pobj.classname + "/" + methodname,
content: e.stack,
clientIp: pobj.clientIp
});
}
}
return { app: apptocheck, ispass: isCheckWhite || apptocheck };
}
async doexec(gname, methodname, pobj, query, req) {
var requestid = req.headers["request-id"] || this.getUUID();
try {
//检查访问token
var isPassResult = await this.checkAcck(gname, methodname, pobj, query, req);
if (!isPassResult.ispass) {
var tmpResult = system.getResultFail(system.tokenFail, "访问token失效,请重新获取");
tmpResult.requestId = "";
return tmpResult;
}
// //检查appkey
// let key = await this.cacheManager["InitAppKeyCache"].getAppKeyVal(pobj.appKey);
// if(key==null){
// return system.getResultFail(system.appKeyError,"appKey授权有误");
// }
req.app = isPassResult.app;
var rtn = await this[methodname](pobj, query, req);
if (isPassResult.app) {
if (methodname && methodname.indexOf("apiAccessCount") < 0) {
this.apitradeSvr.create({
srcappkey: isPassResult.app.appkey,
tradeType: "consume",
op: req.classname + "/" + methodname,
params: JSON.stringify(pobj),
clientIp: req.clientIp,
agent: req.uagent + ";reqid=" + requestid,
destappkey: settings.appKey,
});
}
}
rtn.requestId = requestid;
return rtn;
} catch (e) {
console.log(e.stack, "api调用异常--error...................");
this.logCtl.error({
optitle: "api调用异常--error",
op: req.classname + "/" + methodname + ";reqid=" + requestid,
content: e.stack,
clientIp: req.clientIp
});
var rtnerror = system.getResultFail(-200, "出现异常,请联系管理员");
rtnerror.requestId = requestid;
return rtnerror;
}
}
}
module.exports = APIBase;
const system = require("../system");
const settings = require("../../config/settings");
const uuidv4 = require('uuid/v4');
class CtlBase {
constructor(gname, sname) {
this.serviceName = sname;
this.service = system.getObject("service." + gname + "." + sname);
this.cacheManager = system.getObject("db.common.cacheManager");
this.redisClient = system.getObject("util.redisClient");
// this.md5 = require("MD5");
this.appS = system.getObject("service.common.appSve");
this.comS=system.getObject("service.common.companySve");
}
getUUID() {
var uuid = uuidv4();
var u = uuid.replace(/\-/g, "");
return u;
}
async encryptPasswd(passwd) {
if (!passwd) {
throw new Error("请输入密码");
}
var rtn = await this.service.getEncryptStr(passwd);
return rtn;
}
notify(req, msg) {
if (req.session) {
req.session.bizmsg = msg;
}
}
async findOne(queryobj, qobj) {
var rd = await this.service.findOne(qobj);
return system.getResult(rd);
}
async findAndCountAll(obj, queryobj, req) {
obj.codepath = req.codepath;
obj.appid = req.appid;
if (req.session.user) {
obj.uid = req.session.user.id;
obj.appid = req.session.user.app_id;
obj.account_id = req.session.user.account_id;
}
var apps = await this.service.findAndCountAll(obj);
return system.getResult(apps);
}
async refQuery(qobj,queryobj,req) {
if(qobj.refwhere){
qobj.refwhere.app_id=req.appid;
qobj.refwhere.company_id=req.tocompanyid;
}else{
qobj.refwhere = { app_id: req.appid,company_id:req.tocompanyid};
}
var rd = await this.service.refQuery(qobj);
return system.getResult(rd);
}
async bulkDelete(queryobj, ids) {
var rd = await this.service.bulkDelete(ids);
return system.getResult(rd);
}
async delete(qobj, queryobj) {
var rd = await this.service.delete(qobj);
return system.getResult(rd);
}
async create(qobj, queryobj, req) {
if (req && req.session && req.session.app) {
qobj.app_id = req.appid;
if (req.codepath) {
qobj.codepath = req.codepath;
}
if (qobj.app_id == settings.platformid) {
qobj.company_id = settings.platformcompanyid;
}
}
if (req && req.tocompanyid) {//设置默认的公司id
qobj.company_id = req.tocompanyid;
// qobj.owner_id=req.tanentid;
}
var rd = await this.service.create(qobj,queryobj,req);
return system.getResult(rd);
}
async update(qobj, queryobj, req) {
if (req && req.session && req.session.user) {
qobj.onlyCode = req.session.user.unionId;
}
if (req.codepath) {
qobj.codepath = req.codepath;
}
var rd = await this.service.update(qobj);
return system.getResult(rd);
}
static getServiceName(ClassObj) {
return ClassObj["name"].substring(0, ClassObj["name"].lastIndexOf("Ctl")).toLowerCase() + "Sve";
}
async initNewInstance(queryobj, req) {
return system.getResult({});
}
async findById(oid) {
var rd = await this.service.findById(oid);
return system.getResult(rd);
}
async timestampConvertDate(time) {
if (time == null) {
return "";
}
var date = new Date(Number(time * 1000));
var y = 1900 + date.getYear();
var m = "0" + (date.getMonth() + 1);
var d = "0" + date.getDate();
return y + "-" + m.substring(m.length - 2, m.length) + "-" + d.substring(d.length - 2, d.length);
}
async universalTimeConvertLongDate(time) {
if (time == null) {
return "";
}
var d = new Date(time);
return d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate() + ' ' + d.getHours() + ':' + d.getMinutes() + ':' + d.getSeconds();
}
async universalTimeConvertShortDate(time) {
if (time == null) {
return "";
}
var d = new Date(time);
return d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate();
}
async setContextParams(pobj, qobj, req) {
req.appid = req.session.app ? req.session.app.id : null;
req.appkey = req.session.app ? req.session.app.appkey : null;
pobj.userid = req.session.user ? req.session.user.id : null;
var tocompany = req.session.tocompany;
if (!req.session.app || qobj.toKey) {
var appkey = qobj.appKey;
var tokey = qobj.toKey;
if (appkey) {
var app = await this.appS.getApp(appkey);
var toapp = await this.appS.getApp(tokey);
req.session.app = app;
req.session.toapp = toapp;
req.appid = app.id;
req.appkey = app.appkey;
}else{//如果空,并且没有参数appkey
var app = await this.appS.getApp(settings.appKey);
req.session.app = app;
req.appid = app.id;
req.appkey = app.appkey;
}
}
if(!tocompany && qobj.companyKey){
//说明是自主登录后,跳转到目标平台进行管理操作
tocompany=await this.comS.findOne({companykey:qobj.companyKey});
req.session.tocompany=tocompany;
}
//只要当前APP支持saas,并且非平台那么就设置
if (req.session.app && req.session.app.id != settings.platformid) {
if (req.session.app.isSaas && tocompany) {
req.tocompanyid = tocompany.id;
pobj.tocompanyid = tocompany.id;
} else {
req.tocompanyid = null;
pobj.tocompanyid = null;
}
} else {
req.tocompanyid = settings.platformcompanyid;
pobj.tocompanyid = settings.platformcompanyid;
}
}
async doexec(methodname, pobj, query, req) {
try {
await this.setContextParams(pobj, query, req);
// //检查appkey
// let key = await this.cacheManager["InitAppKeyCache"].getAppKeyVal(pobj.appKey);
// if(key==null){
// return system.getResultFail(system.tokenFail,"appKey授权有误");
// }
var rtn = await this[methodname](pobj, query, req);
// await this. apitradeSvr .create({
// appkey: pobj.appKey,
// tradeType: "consume",
// op: pobj.classname + "/" + methodname,
// params: JSON.stringify(pobj),
// clientIp: pobj.clientIp,
// agent: pobj.agent,
// });
return rtn;
} catch (e) {
console.log(e.stack, "出现异常,请联系管理员.......");
// this.logCtl.error({
// optitle: "api调用出错",
// op: pobj.classname + "/" + methodname,
// content: e.stack,
// clientIp: pobj.clientIp
// });
return system.getResultFail(-200, "出现异常,请联系管理员");
}
}
}
module.exports = CtlBase;
const CacheBase = require("../cache.base");
const system = require("../../system");
const settings = require("../../../config/settings");
//开放平台缓存所有的应用的访问token
class ApiAccessKeyCache extends CacheBase {
constructor() {
super();
this.appDao = system.getObject("db.common.appDao");
}
desc() {
return "缓存访问Token";
}
prefix() {
return "gapps_accesskey:";
}
async buildCacheVal(cachekey, inputkey, val, ex, ...items) {
if (!items || items.length == 0) {
return null;
}
const configValue = await this.appDao.findOne(items[0], val);
if (configValue) {
return JSON.stringify(configValue);
}
return null;
}
}
module.exports = ApiAccessKeyCache;
const CacheBase = require("../cache.base");
const system = require("../../system");
const settings = require("../../../config/settings");
const uuidv4 = require('uuid/v4');
class ApiAccessKeyClientCache extends CacheBase {
constructor() {
super();
this.restS = system.getObject("util.restClient");
}
desc() {
return "平台作为一个应用,缓存访问token";
}
prefix() {
return "req_appkey_cachetoken:";
}
buildCacheVal(cachekey, inputkey, val, ex, ...items) {
return JSON.stringify({ accessKey: val });
}
}
module.exports = ApiAccessKeyClientCache;
const CacheBase=require("../cache.base");
const system=require("../../system");
//缓存首次登录的赠送的宝币数量
class ApiAccuCache extends CacheBase{
constructor(){
super();
this.apitradeDao=system.getObject("db.callcount.apitradeDao");
}
desc(){
return "API累计调用次数和累计余额";
}
prefix(){
return "api_accu:";
}
async addCallCount(apikey,n){
var key=this.prefix+apikey;
var result=await this.redisClient.hincrby(key,"callcount",n);
return result;
}
async addCallBalance(apikey,n){
var key=this.prefix+apikey;
var result=await this.redisClient.hincrby(key,"amount",n);
return result;
}
async getApiCallAccu(srckey){
var apikey=srckey.split("_")[0];
var key=this.prefix+srckey;
const cachedVal= await this.redisClient.hgetall(key);
if(!cachedVal || cachedVal=="undefined"){
var count= await this.apitradeDao.model.count({
where:{
srcappkey:apikey,
tradeType:"consume",
}
});
var amount=await this.apitradeDao.model.sum("amount",{
where:{
srcappkey:apikey,
}
});
var map={"callcount":count?count:0,"amount":amount?amount:0};
this.redisClient.hmset(key,map);
//缓存当前应用所有的缓存key及其描述
this.redisClient.sadd(this.cacheCacheKeyPrefix, [key + "|" + this.desc]);
return map;
}else{
return cachedVal;
}
}
}
module.exports=ApiAccuCache;
const CacheBase=require("../cache.base");
const system=require("../../system");
//缓存首次登录的赠送的宝币数量
class ApiCallCountCache extends CacheBase{
constructor(){
super();
this.apitradeDao=system.getObject("db.common.apitradeDao");
}
desc(){
return "API调用次数";
}
prefix(){
return "api_call:";
}
async addCallCount(apikey,callpath,n){
var key=this.prefix+apikey+"_"+callpath;
var result=await this.redisClient.hincrby(key,"callcount",n);
return result;
}
async addCallBalance(apikey,callpath,n){
var key=this.prefix+apikey+"_"+callpath;
var result=await this.redisClient.hincrby(key,"amount",n);
return result;
}
async getApiCallCount(apikey,callpath){
var key=this.prefix+apikey+"_"+callpath;
const cachedVal= await this.redisClient.hgetall(key);
if(!cachedVal || cachedVal=="undefined"){
var count= await this.apitradeDao.model.count({
where:{
srcappkey:apikey,
op:callpath,
tradeType:"consume",
}
});
var amount=await this.apitradeDao.model.sum("amount",{
where:{
srcappkey:apikey,
op:callpath,
tradeType:"consume",
}
});
var map={"callcount":count?count:0,"amount":amount?amount:0};
this.redisClient.hmset(key,map);
//缓存当前应用所有的缓存key及其描述
this.redisClient.sadd(this.cacheCacheKeyPrefix, [key + "|" + this.desc]);
return map;
}else{
return cachedVal;
}
}
}
module.exports=ApiCallCountCache;
const CacheBase=require("../cache.base");
const system=require("../../system");
const settings = require("../../../config/settings");
//缓存首次登录的赠送的宝币数量
class AppCache extends CacheBase{
constructor(){
super();
this.prefix="g_appkey:";
this.appDao=system.getObject("db.common.appDao");
}
isdebug(){
return settings.env=="dev";
}
desc(){
return "缓存本地应用对象";
}
prefix(){
return "g_applocal_"
}
async buildCacheVal(cachekey,inputkey, val, ex, ...items) {
const configValue=await this.appDao.findOne2(inputkey);
if (configValue) {
return JSON.stringify(configValue);
}
return null;
}
}
module.exports=AppCache;
const CacheBase=require("../cache.base");
const system=require("../../system");
//缓存首次登录的赠送的宝币数量
class InitGiftCache extends CacheBase{
constructor(){
super();
this.pConfigDao=system.getObject("db.common.pconfigDao");
}
desc(){
return "初始赠送";
}
prefix(){
return "g_pconfig_initGift";
}
async buildCacheVal(cachekey,inputkey,val,ex,...items){
const config=await this.pConfigDao.model.findOne({where:{configType:'initGift',appkey:inputkey},raw:true});
const num2=Number(config.configValue);
return num2;
}
}
module.exports=InitGiftCache;
const CacheBase=require("../cache.base");
//缓存当前登录用户的opencode--指向公共平台的委托登录code
class OpenCodeCache extends CacheBase{
constructor(){
super();
}
desc(){
return "开放用户缓存";
}
prefix(){
return "pl_opencode_";
}
async buildCacheVal(cachekey,inputkey,val,ex,...items){
return JSON.stringify(val);
}
}
module.exports=OpenCodeCache;
const CacheBase=require("../cache.base");
const system=require("../../system");
//缓存首次登录的赠送的宝币数量
class PConfigCache extends CacheBase{
constructor(){
super();
this.pConfigDao=system.getObject("db.common.pconfigDao");
}
desc(){
return "平台配置参数";
}
prefix(){
return "g_pconfig";
}
async buildCacheVal(cachekey,inputkey,val,ex,...items){
const configValue=await this.pConfigDao.model.findAll({where:{appkey:inputkey},attributes:["name","configType","configValue"],raw:true});
var s=JSON.stringify(configValue);
return s;
}
}
module.exports=PConfigCache;
const CacheBase=require("../cache.base");
const system=require("../../system");
const settings = require("../../../config/settings");
//缓存首次登录的赠送的宝币数量
class UIConfigCache extends CacheBase{
constructor(){
super();
}
isdebug(){
return settings.env=="dev";
}
desc(){
return "应用UI配置缓存";
}
prefix(){
return "g_uiconfig:";
}
async buildCacheVal(cachekey,inputkey,val,ex,...items){
var configValue =system.getUiConfig2(inputkey);
return JSON.stringify(configValue);
}
}
module.exports=UIConfigCache;
const CacheBase = require("../cache.base");
const system = require("../../system");
const settings = require("../../../config/settings");
// const authUtils = require("../../utils/businessManager/authUtils");
const uuidv4 = require('uuid/v4');
//缓存首次登录的赠送的宝币数量
class UIRemoteConfigCache extends CacheBase {
constructor() {
super();
}
desc() {
return "非平台应用UI配置缓存";
}
prefix() {
return "g_uiremoteconfig_";
}
getUUID() {
var uuid = uuidv4();
var u = uuid.replace(/\-/g, "");
return u;
}
async buildCacheVal(cachekey, inputkey, val, ex, ...items) {
var url = items[0];
const cacheManager = await system.getObject("db.common.cacheManager");
var authUtils = system.getObject("util.businessManager.authUtils");
var appData = await authUtils.getTokenInfo(settings.appKey, settings.secret);
if (appData.status != 0) {
return null;
}
//按照访问token
var rtnKey=appData.data.accessKey;
const restS = await system.getObject("util.restClient");
var restResult = await restS.execPostWithAK({}, url, rtnKey);
if (restResult) {
if (restResult.status == 0) {
var resultRtn = restResult.data;
return JSON.stringify(resultRtn);
}
}
return null;
}
}
module.exports = UIRemoteConfigCache;
module.exports={
"bizName":"allapps",
"list":{
columnMetaData:[
{"width":"230","label":"应用KEY","prop":"appkey","isShowTip":true,"isTmpl":false},
{"width":"200","label":"应用类型","prop":"appType","isShowTip":true,"isTmpl":false},
{"width":"200","label":"是否公共服务","prop":"isCommon","isShowTip":true,"isTmpl":false},
{"width":"100","label":"应用名称","prop":"name","isShowTip":true,"isTmpl":false},
{"width":"200","label":"应用密钥","prop":"secret","isShowTip":true,"isTmpl":false},
{"width":"200","label":"是否启用","prop":"isEnabled","isShowTip":true,"isTmpl":false},
{"width":"null","label":"操作","name":"null","isShowTip":false,"isTmpl":true,"isBtns":"true"},
]
},
"form":[
{
"title":"应用控制",
"colnum":2,
"ctls":[
{"type":"switch","label":"是否启用","prop":"isEnabled","acText":"启用","inactText":"停用","placeHolder":"","style":""},
{"type":"switch","label":"是否公共服务","prop":"isCommon","acText":"是","inactText":"否","placeHolder":"","style":""},
{"type":"switch","label":"是否私有","prop":"isPublish","acText":"否","inactText":"是","placeHolder":"","style":""},
{ "type": "select", "label": "应用类型", "dicKey": "app_type", "prop": "appType", "labelField": "label", "valueField": "value", "placeHolder": "请选择支付类型", "style": "" },
// {"type":"switch","label":"启用多租户","prop":"isSaas","acText":"启用","inactText":"停用","placeHolder":"","style":""},
]
},
{
"title":"概要介绍",
"colnum":1,
"ctls":[
{ "type": "textarea", "label": "简介", "prop": "description", "placeHolder": "请输入产品简介", "style": "width:600px" }
]
},
{
"title":"基本信息",
"colnum":3,
"ctls":[
{"type":"input","label":"应用KEY","prop":"appkey","disabled":true,"placeHolder":"","style":""},
{"type":"input","label":"应用名称","prop":"name","placeHolder":"应用名称","style":""},
{"type":"input","label":"应用密钥","prop":"secret","disabled":true,"placeHolder":"","style":""},
{"type":"input","label":"域名","prop":"domainName","disabled":false,"placeHolder":"","style":""},
{"type":"input","label":"首页","prop":"homePage","disabled":false,"placeHolder":"","style":""},
{"type":"input","label":"认证URL","prop":"authUrl","disabled":false,"placeHolder":"","style":""},
{"type":"input","label":"文档URL","prop":"docUrl","disabled":false,"placeHolder":"","style":""},
{"type":"input","label":"配置URL","prop":"uiconfigUrl","disabled":false,"placeHolder":"","style":""},
{"type":"input","label":"缓存操作URL","prop":"opCacheUrl","disabled":false,"placeHolder":"","style":""},
{"type":"input","label":"接受API调用计数URL","prop":"notifyCacheCountUrl","disabled":false,"placeHolder":"","style":""},
]
},
{
"title":"个性化信息",
"colnum":2,
"ctls":[
{"type":"upload","label":"logo","prop":"logoUrl","disabled":false,"placeHolder":"","style":""},
{"type":"upload","label":"背景图","prop":"bkimageUrl","placeHolder":"应用名称","style":""},
{"type":"upload","label":"缩略图","prop":"showimgUrl","disabled":false,"placeHolder":"","style":"width:100px;height:100px"},
{"type":"upload","label":"细节图","prop":"detailimgUrl","disabled":false,"placeHolder":"","style":""},
]
},
],
"search":[
{
"title":"基本查询",
ctls:[
{"type":"input","label":"应用名称","prop":"name","placeHolder":"应用名称","style":""},
]
},
],
"auth":{
"add":[
{"icon":"el-icon-plus","title":"新增","type":"default","key":"new","isOnGrid":true},
{"icon":"el-icon-save","title":"保存","type":"default","key":"save","isOnForm":true},
],
"edit":[
{"icon":"el-icon-edit","title":"修改","type":"default","key":"edit","isInRow":true},
// {"icon":"el-icon-edit","title":"管理员","type":"default","key":"adminModi","isInRow":true},
// {"icon":"el-icon-edit","title":"重置密码","type":"default","key":"resetpwd","isInRow":true},
],
"delete":[
{"icon":"el-icon-remove","title":"删除","type":"default","key":"delete","isInRow":true},
],
"common":[
{"icon":"el-icon-cancel","title":"取消","type":"default","key":"cancel","isOnForm":true},
],
}
}
module.exports={
"list":{
columnMetaData:[
{"width":"100","label":"昵称","prop":"nickName","isShowTip":true,"isTmpl":false},
{"width":"100","label":"登录账号","prop":"userName","isShowTip":true,"isTmpl":false},
{"width":"100","label":"角色","prop":"Roles","isShowTip":true,"isTmpl":false},
{"width":"80","label":"状态","prop":"isEnabled","isShowTip":true,"isTmpl":false},
{"width":"null","label":"操作","name":"null","isShowTip":false,"isTmpl":true,"isBtns":true},
]
},
"form":[
{
"title":"控制信息",
ctls:[
{"type":"switch","prop":"isAdmin","acText":"是管理员","inactText":"否","placeHolder":"请输入单次使用消耗的宝币数","style":""},
// {"type":"select","refModel":"pmproduct","isMulti":false,"label":"所属产品","prop":"pmproduct_id","labelField":"name","valueField":"id","style":""},
]
},
{
"title":"基本信息",
ctls:[
{"type":"input","label":"账号","prop":"userName","placeHolder":"登录账号","style":"",rules:[ { "required": true, "message": ' ', "trigger": 'blur' },]},
{"type":"input","label":"昵称","prop":"nickName","placeHolder":"昵称","style":"",rules:[ { "required": true, "message": ' ', "trigger": 'blur' },]},
{"type":"input","label":"电话","prop":"mobile","placeHolder":"请输入电话","style":"",rules:[ { "validator":"validatex","trigger": 'blur' },{ "required": true, "message": ' ', "trigger": 'blur' },]},
// {"type":"select","refModel":"auth.role","isMulti":true,"label":"角色","prop":"roles","labelField":"name","valueField":"id","style":""},
]
}
],
"search":[
{
"title":"基本查询",
ctls:[
{"type":"input","label":"昵称","prop":"nickName","placeHolder":"请输入昵称","style":""},
]
},
],
"auth":{
"add":[
{"icon":"el-icon-plus","title":"新增","type":"default","key":"new","isOnGrid":true},
{"icon":"el-icon-save","title":"保存","type":"default","key":"save","isOnForm":true},
],
"edit":[
{"icon":"el-icon-edit","title":"修改","type":"default","key":"edit","isInRow":true},
],
"delete":[
{"icon":"el-icon-remove","title":"删除","type":"default","key":"delete","isInRow":true},
{"icon":"el-icon-edit","title":"停用","type":"default","key":"stopUser","isInRow":true,"boolProp":"isEnabled","falseText":"启用"},
],
"common":[
{"icon":"el-icon-cancel","title":"取消","type":"default","key":"cancel","isOnForm":true},
],
}
}
module.exports={
"bizName":"appconfig",
"list":{
columnMetaData:[
{"width":"100","label":"配置名称","prop":"name","isShowTip":true,"isTmpl":false},
{"width":"200","label":"配置类型","prop":"configType","isShowTip":true,"isTmpl":false},
{"width":"200","label":"配置内容","prop":"configValue","isShowTip":true,"isTmpl":false},
{"width":"null","label":"操作","name":"null","isShowTip":false,"isTmpl":true,"isBtns":"true"},
]
},
"form":[
{
"title":"配置信息",
"colnum":2,
"ctls":[
{"type":"select","label":"配置类型","dicKey":"configType","prop":"configType","labelField":"label","valueField":"value","placeHolder":"","style":""},
{"type":"input","label":"配置内容","prop":"configValue","disabled":false,"placeHolder":"","style":""},
]
},
],
"search":[
{
"title":"基本查询",
ctls:[
{"type":"select","label":"配置类型","dicKey":"configType","prop":"configType","labelField":"label","valueField":"value","placeHolder":"","style":""},
{"type":"input","label":"配置名称","prop":"name","placeHolder":"应用名称","style":""},
]
},
],
"auth":{
"add":[
{"icon":"el-icon-plus","title":"新增","type":"default","key":"new","isOnGrid":true},
{"icon":"el-icon-save","title":"保存","type":"default","key":"save","isOnForm":true},
],
"edit":[
{"icon":"el-icon-edit","title":"修改","type":"default","key":"edit","isInRow":true},
],
"delete":[
{"icon":"el-icon-remove","title":"删除","type":"default","key":"delete","isInRow":true},
],
"common":[
{"icon":"el-icon-cancel","title":"取消","type":"default","key":"cancel","isOnForm":true},
],
}
}
module.exports={
"list":{
columnMetaData:[
{"width":"100","label":"编码","prop":"code","isShowTip":true,"isTmpl":false},
{"width":"200","label":"名称","prop":"name","isShowTip":true,"isTmpl":false},
{"width":"200","label":"是否系统角色","prop":"isSystem","isShowTip":true,"isTmpl":false},
{"width":"200","label":"描述","prop":"description","isShowTip":true,"isTmpl":false},
{"width":"null","label":"操作","name":"null","isShowTip":false,"isTmpl":true,"isBtns":true},
]
},
"form":[
{
"title":"基本信息",
"column":1,
ctls:[
{"type":"input","label":"编码","prop":"code","placeHolder":"请输入一个编码","style":"",rules:[ { "required": true, "message": '请选择产品大类', "trigger": 'blur' },]},
{"type":"input","label":"名称","prop":"name","placeHolder":"请输入一个名称","style":"",rules:[ { "required": true, "message": '请选择产品大类', "trigger": 'blur' },]},
{"type":"input","label":"描述","prop":"description","placeHolder":"描述","style":"",rules:[ { "required": true, "message": '请选择产品大类', "trigger": 'blur' },]},
]
},
],
"search":[
{
"title":"高级查询",
ctls:[
{"type":"input","label":"名称","prop":"name","placeHolder":"请输入角色名称","style":""},
]
},
],
"auth":{
"add":[
{"icon":"el-icon-plus","title":"新增","type":"default","key":"new","isOnGrid":true},
{"icon":"el-icon-save","title":"保存","type":"default","key":"save","isOnForm":true},
],
"edit":[
{"icon":"el-icon-edit","title":"修改","type":"default","key":"edit","isInRow":true},
{"icon":"el-icon-edit","title":"授权","type":"default","key":"auth","isInRow":true},
],
"delete":[
{"icon":"el-icon-remove","title":"删除","type":"default","key":"delete","isInRow":true},
],
"common":[
{"icon":"el-icon-cancel","title":"取消","type":"default","key":"cancel","isOnForm":true},
],
}
}
module.exports={
"list":{
columnMetaData:[
{"width":"100","label":"昵称","prop":"nickName","isShowTip":true,"isTmpl":false},
{"width":"100","label":"登录账号","prop":"userName","isShowTip":true,"isTmpl":false},
{"width":"100","label":"角色","prop":"Roles","isShowTip":true,"isTmpl":false},
{"width":"50","label":"状态","prop":"isEnabled","isShowTip":true,"isTmpl":false},
{"width":"300","label":"操作","name":"null","isShowTip":false,"isTmpl":true,"isBtns":true},
]
},
"form":[
{
"title":"控制信息",
ctls:[
{"type":"switch","prop":"isAdmin","acText":"是管理员","inactText":"否","placeHolder":"请输入单次使用消耗的宝币数","style":""},
// {"type":"select","refModel":"auth.role","isMulti":true,"label":"角色","prop":"roles","labelField":"name","valueField":"id","style":""},
// {"type":"select","refModel":"pmproduct","isMulti":false,"label":"所属产品","prop":"pmproduct_id","labelField":"name","valueField":"id","style":""},
]
},
{
"title":"基本信息",
ctls:[
{"type":"input","label":"账号","prop":"userName","placeHolder":"登录账号","style":"",rules:[ { "required": true, "message": ' ', "trigger": 'blur' },]},
{"type":"input","label":"昵称","prop":"nickName","placeHolder":"昵称","style":"",rules:[ { "required": true, "message": ' ', "trigger": 'blur' },]},
{"type":"input","label":"电话","prop":"mobile","placeHolder":"请输入电话","style":"",rules:[ { "validator":"validatex","trigger": 'blur' },{ "required": true, "message": ' ', "trigger": 'blur' },]},
]
}
],
"search":[
{
"title":"基本查询",
ctls:[
{"type":"input","label":"昵称","prop":"nickName","placeHolder":"请输入昵称","style":""},
]
},
],
"auth":{
"add":[
{"icon":"el-icon-plus","title":"新增","type":"default","key":"new","isOnGrid":true},
{"icon":"el-icon-save","title":"保存","type":"default","key":"save","isOnForm":true},
],
"edit":[
{"icon":"el-icon-edit","title":"修改","type":"default","key":"edit","isInRow":true},
{"icon":"el-icon-edit","title":"岗位变更","type":"default","key":"positionChange","isInRow":true},
{"icon":"el-icon-edit","title":"数据授权","type":"default","key":"datapriv","isInRow":true},
],
"delete":[
{"icon":"el-icon-remove","title":"删除","type":"default","key":"delete","isInRow":true},
{"icon":"el-icon-edit","title":"停用","type":"default","key":"stopUser","isInRow":true,"boolProp":"isEnabled","falseText":"启用"},
],
"common":[
{"icon":"el-icon-cancel","title":"取消","type":"default","key":"cancel","isOnForm":true},
],
}
}
module.exports={
"bizName":"cachearches",
"list":{
columnMetaData:[
{"width":"300","label":"缓存键","prop":"name","isShowTip":true,"isTmpl":false},
{"width":"300","label":"缓存说明","prop":"val","isShowTip":true,"isTmpl":false},
{"width":"null","label":"操作","name":"null","isShowTip":false,"isTmpl":true,"isBtns":"true"},
]
},
"form":[
],
"search":[
{
"title":"键名称",
ctls:[
{"type":"input","label":"键名称","prop":"name","placeHolder":"键名称","style":""},
]
},
],
"auth":{
"add":[
],
"edit":[
{"icon":"el-icon-edit","title":"清空所有缓存","type":"default","key":"clearAll","isOnGrid":true},
{"icon":"el-icon-edit","title":"使失效","type":"default","key":"invalidate","isInRow":true},
],
"delete":[
],
"common":[
],
}
}
module.exports={
"bizName":"comapps",
"list":{
columnMetaData:[
{"width":"200","label":"应用KEY","prop":"appkey","isShowTip":true,"isTmpl":false},
{"width":"100","label":"应用名称","prop":"name","isShowTip":true,"isTmpl":false},
{"width":"200","label":"应用密钥","prop":"secret","isShowTip":true,"isTmpl":false},
{"width":"200","label":"是否启用","prop":"isEnabled","isShowTip":true,"isTmpl":false},
{"width":"null","label":"操作","name":"null","isShowTip":false,"isTmpl":true,"isBtns":"true"},
]
},
"form":[
{
"title":"应用控制",
"colnum":1,
"ctls":[
{"type":"switch","label":"是否启用","prop":"isEnabled","acText":"启用","inactText":"停用","placeHolder":"","style":""},
{"type":"switch","label":"是否私有","prop":"isPublish","acText":"否","inactText":"是","placeHolder":"","style":""},
{ "type": "select", "label": "应用类型", "dicKey": "app_type", "prop": "appType", "labelField": "label", "valueField": "value", "placeHolder": "请选择支付类型", "style": "" },
]
},
{
"title":"概要介绍",
"colnum":1,
"ctls":[
{ "type": "textarea", "label": "简介", "prop": "description", "placeHolder": "请输入产品简介", "style": "width:600px" }
]
},
{
"title":"基本信息",
"colnum":3,
"ctls":[
{"type":"input","label":"应用KEY","prop":"appkey","disabled":true,"placeHolder":"","style":""},
{"type":"input","label":"应用名称","prop":"name","placeHolder":"应用名称","style":""},
{"type":"input","label":"应用密钥","prop":"secret","disabled":false,"placeHolder":"","style":""},
{"type":"input","label":"域名","prop":"domainName","disabled":false,"placeHolder":"","style":""},
{"type":"input","label":"首页","prop":"homePage","disabled":false,"placeHolder":"","style":""},
{"type":"input","label":"认证URL","prop":"authUrl","disabled":false,"placeHolder":"","style":""},
{"type":"input","label":"文档URL","prop":"docUrl","disabled":false,"placeHolder":"","style":""},
{"type":"input","label":"配置URL","prop":"uiconfigUrl","disabled":false,"placeHolder":"","style":""},
{"type":"input","label":"缓存操作URL","prop":"opCacheUrl","disabled":false,"placeHolder":"","style":""},
{"type":"input","label":"接受API调用计数URL","prop":"notifyCacheCountUrl","disabled":false,"placeHolder":"","style":""},
]
},
{
"title":"个性化信息",
"colnum":2,
"ctls":[
{"type":"upload","label":"logo","prop":"logoUrl","disabled":false,"placeHolder":"","style":""},
{"type":"upload","label":"背景图","prop":"bkimageUrl","placeHolder":"应用名称","style":""},
{"type":"upload","label":"缩略图","prop":"showimgUrl","disabled":false,"placeHolder":"","style":"width:100px;height:100px"},
{"type":"upload","label":"细节图","prop":"domainName","disabled":false,"placeHolder":"","style":""},
]
},
],
"search":[
{
"title":"基本查询",
ctls:[
{"type":"input","label":"应用名称","prop":"name","placeHolder":"应用名称","style":""},
]
},
],
"auth":{
"add":[
],
"edit":[
{"icon":"el-icon-edit","title":"弃租","type":"default","key":"giveup","isInRow":true},
],
"delete":[
],
"common":[
],
}
}
module.exports={
"list":{
columnMetaData:[
]
},
"form":[
{
"title":"基本信息",
"colnum":1,
ctls:[
{"type":"input","label":"编码","prop":"code","placeHolder":"输入组织编码","style":"",rules:[ { "required": true, "message": ' ', "trigger": 'blur' },]},
{"type":"input","label":"名称","prop":"name","placeHolder":"输入组织名称","style":"",rules:[ { "required": true, "message": ' ', "trigger": 'blur' },]},
// {"type":"switch","label":"是否岗位","targetprop":"Roles,isMain","prop":"isPosition","acText":"是","inactText":"否","placeHolder":"","style":""},
// {"type":"select","refModel":"auth.role","defaultHide":true,"isMulti":true,"label":"角色","prop":"Roles","labelField":"name","valueField":"id","style":""},
// {"type":"switch","label":"是否负责人岗","defaultHide":true,"prop":"isMain","acText":"是","inactText":"否","placeHolder":"","style":""},
{"type":"btn","label":"保存","prop":"btnLogin","placeHolder":"保存","style":{"width":"150px","margin-left":"100px","margin-top":"20px"},"face":"warning"},
]
}
],
"search":[
],
"auth":{
"add":[
{"icon":"el-icon-plus","title":"新增","type":"default","key":"new","isOnGrid":true},
{"icon":"el-icon-save","title":"保存","type":"default","key":"save","isOnForm":true},
],
"edit":[
{"icon":"el-icon-edit","title":"修改","type":"default","key":"edit","isInRow":true},
{"icon":"el-icon-edit","title":"数据授权","type":"default","key":"datapriv","isInRow":true},
],
"delete":[
{"icon":"el-icon-remove","title":"删除","type":"default","key":"delete","isInRow":true},
{"icon":"el-icon-edit","title":"停用","type":"default","key":"stopUser","isInRow":true,"boolProp":"isEnabled","falseText":"启用"},
],
"common":[
{"icon":"el-icon-cancel","title":"取消","type":"default","key":"cancel","isOnForm":true},
],
}
}
module.exports={
"bizName":"allapps",
"list":{
columnMetaData:[
{"width":"230","label":"名称","prop":"name","isShowTip":true,"isTmpl":false},
{"width":"100","label":"是否当前公司","prop":"isCurrent","isShowTip":true,"isTmpl":false},
{"width":"null","label":"操作","name":"null","isShowTip":false,"isTmpl":true,"isBtns":"true"},
]
},
"form":[
{
"title":"基本信息",
"colnum":2,
"ctls":[
{"type":"input","label":"公司名称","prop":"name","placeHolder":"请输入公司名称","style":"width:300px",rules:[{ "required": true, "message": " ", "trigger": 'blur' }]},
{"type":"input","label":"信用代码","prop":"creditCode","placeHolder":"应用名称","style":""},
{"type":"upload","label":"营业执照","prop":"licenseUrl","disabled":false,"placeHolder":"","style":""},
{"type":"input","label":"备注","prop":"description","disabled":false,"placeHolder":"","style":""},
]
},
],
"search":[
{
"title":"公司信息",
ctls:[
{"type":"input","label":"公司名称","prop":"name","placeHolder":"应用名称","style":""},
]
},
],
"auth":{
"add":[
{"icon":"el-icon-plus","title":"新增","type":"default","key":"new","isOnGrid":true},
{"icon":"el-icon-edit","title":"修改","type":"default","key":"edit","isInRow":true},
{"icon":"el-icon-save","title":"保存","type":"default","key":"save","isOnForm":true},
],
"edit":[
{"icon":"el-icon-edit","title":"设置为当前","type":"default","key":"setcurrent","isInRow":true},
{"icon":"el-icon-edit","title":"组织结构","type":"default","key":"comorgs","isInRow":true},
{"icon":"el-icon-edit","title":"租用列表","type":"default","key":"comapps","isInRow":true},
],
"delete":[
{"icon":"el-icon-remove","title":"删除","type":"default","key":"delete","isInRow":true},
],
"common":[
{"icon":"el-icon-cancel","title":"取消","type":"default","key":"cancel","isOnForm":true},
],
}
}
module.exports={
"list":{
columnMetaData:[
{"width":"100","label":"应用","prop":"app.name","isShowTip":true,"isTmpl":false},
{"width":"100","label":"昵称","prop":"nickName","isShowTip":true,"isTmpl":false},
{"width":"100","label":"登录账号","prop":"userName","isShowTip":true,"isTmpl":false},
{"width":"100","label":"角色","prop":"Roles","isShowTip":true,"isTmpl":false},
{"width":"100","label":"管理员","prop":"isAdmin","isShowTip":true,"isTmpl":false},
{"width":"80","label":"状态","prop":"isEnabled","isShowTip":true,"isTmpl":false},
{"width":"null","label":"操作","name":"null","isShowTip":false,"isTmpl":true,"isBtns":true},
]
},
"form":[
{
"title":"控制信息",
ctls:[
{"type":"switch","prop":"isAdmin","acText":"是管理员","inactText":"否","placeHolder":"请输入单次使用消耗的宝币数","style":""},
// {"type":"select","refModel":"pmproduct","isMulti":false,"label":"所属产品","prop":"pmproduct_id","labelField":"name","valueField":"id","style":""},
]
},
{
"title":"基本信息",
ctls:[
{"type":"input","label":"账号","prop":"userName","placeHolder":"登录账号","style":"",rules:[ { "required": true, "message": ' ', "trigger": 'blur' },]},
{"type":"input","label":"昵称","prop":"nickName","placeHolder":"昵称","style":"",rules:[ { "required": true, "message": ' ', "trigger": 'blur' },]},
{"type":"input","label":"电话","prop":"mobile","placeHolder":"请输入电话","style":"",rules:[ { "validator":"validatex","trigger": 'blur' },{ "required": true, "message": ' ', "trigger": 'blur' },]},
// {"type":"select","refModel":"auth.role","isMulti":true,"label":"角色","prop":"roles","labelField":"name","valueField":"id","style":""},
]
}
],
"search":[
{
"title":"基本查询",
ctls:[
{"type":"input","label":"昵称","prop":"nickName","placeHolder":"请输入昵称","style":""},
]
},
],
"auth":{
"add":[
// {"icon":"el-icon-plus","title":"新增","type":"default","key":"new","isOnGrid":true},
// {"icon":"el-icon-save","title":"保存","type":"default","key":"save","isOnForm":true},
],
"edit":[
// {"icon":"el-icon-edit","title":"修改","type":"default","key":"edit","isInRow":true},
],
"delete":[
// {"icon":"el-icon-remove","title":"删除","type":"default","key":"delete","isInRow":true},
// {"icon":"el-icon-edit","title":"停用","type":"default","key":"stopUser","isInRow":true,"boolProp":"isEnabled","falseText":"启用"},
],
"common":[
{"icon":"el-icon-cancel","title":"取消","type":"default","key":"cancel","isOnForm":true},
],
}
}
module.exports={
"list":{
columnMetaData:[
]
},
"form":[
{
"title":"基本信息",
"colnum":1,
ctls:[
{"type":"input","label":"编码","prop":"code","placeHolder":"输入组织编码","style":"",rules:[ { "required": true, "message": ' ', "trigger": 'blur' },]},
{"type":"input","label":"名称","prop":"name","placeHolder":"输入组织名称","style":"",rules:[ { "required": true, "message": ' ', "trigger": 'blur' },]},
{"type":"switch","label":"是否岗位","targetprop":"Roles,isMain","prop":"isPosition","acText":"是","inactText":"否","placeHolder":"","style":""},
{"type":"select","refModel":"auth.role","defaultHide":true,"isMulti":true,"label":"角色","prop":"Roles","labelField":"name","valueField":"id","style":""},
{"type":"switch","label":"是否负责人岗","defaultHide":true,"prop":"isMain","acText":"是","inactText":"否","placeHolder":"","style":""},
{"type":"btn","label":"保存","prop":"btnLogin","placeHolder":"保存","style":{"width":"150px","margin-left":"100px","margin-top":"20px"},"face":"warning"},
]
}
],
"search":[
],
"auth":{
"add":[
{"icon":"el-icon-plus","title":"新增","type":"default","key":"new","isOnGrid":true},
{"icon":"el-icon-save","title":"保存","type":"default","key":"save","isOnForm":true},
],
"edit":[
{"icon":"el-icon-edit","title":"修改","type":"default","key":"edit","isInRow":true},
{"icon":"el-icon-edit","title":"数据授权","type":"default","key":"datapriv","isInRow":true},
],
"delete":[
{"icon":"el-icon-remove","title":"删除","type":"default","key":"delete","isInRow":true},
{"icon":"el-icon-edit","title":"停用","type":"default","key":"stopUser","isInRow":true,"boolProp":"isEnabled","falseText":"启用"},
],
"common":[
{"icon":"el-icon-cancel","title":"取消","type":"default","key":"cancel","isOnForm":true},
],
}
}
module.exports={
"bizName":"myapps",
"list":{
columnMetaData:[
{"width":"200","label":"应用KEY","prop":"appkey","isShowTip":true,"isTmpl":false},
{"width":"100","label":"应用名称","prop":"name","isShowTip":true,"isTmpl":false},
{"width":"200","label":"应用密钥","prop":"secret","isShowTip":true,"isTmpl":false},
{"width":"200","label":"是否启用","prop":"isEnabled","isShowTip":true,"isTmpl":false},
{"width":"null","label":"操作","name":"null","isShowTip":false,"isTmpl":true,"isBtns":"true"},
]
},
"form":[
{
"title":"应用控制",
"colnum":1,
"ctls":[
{"type":"switch","label":"是否启用","prop":"isEnabled","acText":"启用","inactText":"停用","placeHolder":"","style":""},
{"type":"switch","label":"是否私有","prop":"isPublish","acText":"否","inactText":"是","placeHolder":"","style":""},
{ "type": "select", "label": "应用类型", "dicKey": "app_type", "prop": "appType", "labelField": "label", "valueField": "value", "placeHolder": "请选择支付类型", "style": "" },
]
},
{
"title":"概要介绍",
"colnum":1,
"ctls":[
{ "type": "textarea", "label": "简介", "prop": "description", "placeHolder": "请输入产品简介", "style": "width:600px" }
]
},
{
"title":"基本信息",
"colnum":3,
"ctls":[
{"type":"input","label":"应用KEY","prop":"appkey","disabled":true,"placeHolder":"","style":""},
{"type":"input","label":"应用名称","prop":"name","placeHolder":"应用名称","style":""},
{"type":"input","label":"应用密钥","prop":"secret","disabled":false,"placeHolder":"","style":""},
{"type":"input","label":"域名","prop":"domainName","disabled":false,"placeHolder":"","style":""},
{"type":"input","label":"首页","prop":"homePage","disabled":false,"placeHolder":"","style":""},
{"type":"input","label":"认证URL","prop":"authUrl","disabled":false,"placeHolder":"","style":""},
{"type":"input","label":"文档URL","prop":"docUrl","disabled":false,"placeHolder":"","style":""},
{"type":"input","label":"配置URL","prop":"uiconfigUrl","disabled":false,"placeHolder":"","style":""},
{"type":"input","label":"缓存操作URL","prop":"opCacheUrl","disabled":false,"placeHolder":"","style":""},
{"type":"input","label":"接受API调用计数URL","prop":"notifyCacheCountUrl","disabled":false,"placeHolder":"","style":""},
]
},
{
"title":"个性化信息",
"colnum":2,
"ctls":[
{"type":"upload","label":"logo","prop":"logoUrl","disabled":false,"placeHolder":"","style":""},
{"type":"upload","label":"背景图","prop":"bkimageUrl","placeHolder":"应用名称","style":""},
{"type":"upload","label":"缩略图","prop":"showimgUrl","disabled":false,"placeHolder":"","style":"width:100px;height:100px"},
{"type":"upload","label":"细节图","prop":"domainName","disabled":false,"placeHolder":"","style":""},
]
},
],
"search":[
{
"title":"基本查询",
ctls:[
{"type":"input","label":"应用名称","prop":"name","placeHolder":"应用名称","style":""},
]
},
],
"auth":{
"add":[
{"icon":"el-icon-plus","title":"新增","type":"default","key":"new","isOnGrid":true},
{"icon":"el-icon-save","title":"保存","type":"default","key":"save","isOnForm":true},
{"icon":"el-icon-cancel","title":"取消","type":"default","key":"cancel","isOnForm":true},
],
"edit":[
{"icon":"el-icon-edit","title":"修改","type":"default","key":"edit","isInRow":true},
// {"icon":"el-icon-edit","title":"管理员","type":"default","key":"adminModi","isInRow":true},
// {"icon":"el-icon-edit","title":"重置密码","type":"default","key":"resetpwd","isInRow":true},
],
"delete":[
{"icon":"el-icon-remove","title":"删除","type":"default","key":"delete","isInRow":true},
],
"common":[
],
}
}
const fs=require("fs");
const path=require("path");
const appsPath=path.normalize(__dirname+"/apps");
const bizsPath=path.normalize(__dirname+"/bizs");
var appJsons={
}
function getBizFilePath(appJson,bizCode){
const filePath=bizsPath+"/"+appJson.appid+"/"+bizCode+".js";
return filePath;
}
//异常日志处理todo
function initAppBizs(appJson){
for(var bizCode in appJson.config.bizs)
{
const bizfilePath=getBizFilePath(appJson,bizCode);
try{
delete require.cache[bizfilePath];
const bizConfig=require(bizfilePath);
appJson.config.bizs[bizCode].config=bizConfig;
}catch(e){
console.log("bizconfig meta file not exist........");
}
}
return appJson;
}
//初始化资源树--objJson是rstree
function initRsTree(appjson,appidfolder,objJson,parentCodePath){
if(!parentCodePath){//说明当前是根结点
objJson.codePath=objJson.code;
}else{
objJson.codePath=parentCodePath+"/"+objJson.code;
}
if(objJson["bizCode"]){//表示叶子节点
objJson.auths=[];
if(appjson.config.bizs[objJson["bizCode"]]){
objJson.bizConfig=appjson.config.bizs[objJson["bizCode"]].config;
objJson.path=appjson.config.bizs[objJson["bizCode"]].path;
appjson.config.bizs[objJson["bizCode"]].codepath=objJson.codePath;
}
}else{
if(objJson.children){
objJson.children.forEach(obj=>{
initRsTree(appjson,appidfolder,obj,objJson.codePath);
});
}
}
}
fs.readdirSync(appsPath).forEach(f=>{
const ff=path.join(appsPath,f);
delete require.cache[ff];
var appJson=require(ff);
appJson= initAppBizs(appJson);
initRsTree(appJson,appJson.appid,appJson.config.rstree,null);
appJsons[appJson.appid]=appJson;
});
module.exports=appJsons;
module.exports={
"appid":"wx76a324c5d201d1a4",
"label":"企业服务工具箱",
"config":{
"rstree":{
"code":"toolroot",
"label":"工具箱",
"children":[
{
"code":"toggleHeader",
"icon":"el-icon-sort",
"isMenu":true,
"label":"折叠",
},
{
"code":"personCenter",
"label":"个人信息",
"src":"/imgs/logo.png",
"isSubmenu":true,
"children":[
{"code":"wallet","isGroup":true,"label":"账户","children":[
{"code":"mytraderecord","label":"交易记录","isMenu":true,"bizCode":"trades","bizConfig":null,"path":""},
{"code":"smallmoney","label":"钱包","isMenu":true,"bizCode":"oplogs","bizConfig":null,"path":""},
{"code":"fillmoney","label":"充值","isMenu":true,},
]},
{"code":"tool","isGroup":true,"label":"工具","children":[
{"code":"entconfirm","label":"企业用户认证","isMenu":true,"bizCode":"apps","bizConfig":null,"path":""},
{"code":"fav","label":"收藏夹","isMenu":true,"bizCode":"fav","bizConfig":null,"path":""},
{"code":"filebox","label":"文件柜","isMenu":true,"bizCode":"filebox","bizConfig":null,"path":""},
]},
],
},
{
"code":"fillmoney",
"icon":"fa fa-money",
"isMenu":true,
"label":"充值",
},
{
"code":"platformop",
"label":"平台运营",
"icon":"fa fa-cubes",
"isSubmenu":true,
"children":[
{"code":"papp","isGroup":true,"label":"平台数据","children":[
{"code":"papparch","label":"应用档案","isMenu":true,"bizCode":"apps","bizConfig":null,"path":""},
{"code":"userarch","label":"用户档案","isMenu":true,"bizCode":"pusers","bizConfig":null,"path":""},
{"code":"traderecord","label":"交易记录","isMenu":true,"bizCode":"trades","bizConfig":null,"qp":"my","path":""},
{"code":"pconfigs","label":"平台配置","isMenu":true,"bizCode":"pconfigs","bizConfig":null,"qp":"my","path":""},
]},
{"code":"pop","isGroup":true,"label":"平台运维","children":[
{"code":"cachearch","label":"缓存档案","isMenu":true,"bizCode":"cachearches","bizConfig":null,"path":""},
{"code":"oplogmag","label":"行为日志","isMenu":true,"bizCode":"oplogs","bizConfig":null,"path":""},
{"code":"machinearch","label":"机器档案","isMenu":true,"bizCode":"machines","bizConfig":null,"path":""},
{"code":"codezrch","label":"代码档案","isMenu":true,"bizCode":"codezrch","bizConfig":null,"path":""},
{"code":"imagearch","label":"镜像档案","isMenu":true},
{"code":"containerarch","label":"容器档案","isMenu":true},
]},
],
},
{
"code":"sysmag",
"label":"系统管理",
"icon":"fa fa-cube",
"isSubmenu":true,
"children":[
{"code":"usermag","isGroup":true,"label":"用户管理","children":[
{"code":"rolearch","label":"角色档案","isMenu":true,"bizCode":"roles","bizConfig":null},
{"code":"appuserarch","label":"用户档案","isMenu":true,"bizCode":"appusers","bizConfig":null},
]},
{"code":"productmag","isGroup":true,"label":"产品管理","children":[
{"code":"productarch","label":"产品档案","bizCode":"mgproducts","isMenu":true,"bizConfig":null},
{"code":"products","label":"首页产品档案","bizCode":"products","isMenu":false,"bizConfig":null},
]},
],
},
{
"code":"exit",
"icon":"fa fa-power-off",
"isMenu":true,
"label":"退出",
},
{
"code":"toolCenter",
"label":"工具集",
"src":"/imgs/logo.png",
"isSubmenu":false,
"isMenu":false,
"children":[
{"code":"tools","isGroup":true,"label":"查询工具","children":[
{"code":"xzquery","label":"续展查询","bizCode":"xzsearch","bizConfig":null,"path":""},
{"code":"xzgqquery","label":"续展过期查询","bizCode":"xzgqsearch","bizConfig":null,"path":""},
]},
],
},
],
},
"bizs":{
"cachearches":{"title":"首页产品档案","config":null,"path":"/platform/cachearches","comname":"cachearches"},
"products":{"title":"首页产品档案","config":null,"path":"/","comname":"products"},
"mgproducts":{"title":"产品档案","config":null,"path":"/platform/mgproducts","comname":"mgproducts"},
"codezrch":{"title":"代码档案","config":null,"path":"/platform/codezrch","comname":"codezrch"},
"machines":{"title":"机器档案","config":null,"path":"/platform/machines","comname":"machines"},
"pconfigs":{"title":"平台配置","config":null,"path":"/platform/pconfigs","comname":"pconfigs"},
"apps":{"title":"应用档案","config":null,"path":"/platform/apps","comname":"apps"},
"roles":{"title":"角色档案","config":null,"path":"/platform/roles","comname":"roles"},
"pusers":{"title":"平台用户档案","config":null,"path":"/platform/pusers","comname":"users"},
"appusers":{"title":"某应用用户档案","config":null,"path":"/platform/appusers","comname":"users"},
"oplogs":{"title":"行为日志","config":null,"path":"/platform/op/oplogs","comname":"oplogs"},
"trades":{"title":"交易记录","config":null,"path":"/platform/uc/trades","comname":"trades"},
"xzsearch":{"title":"续展查询","config":null,"isDynamicRoute":true,"path":"/products/xzsearch","comname":"xzsearch"},
"xzgqsearch":{"title":"续展过期查询","config":null,"isDynamicRoute":true,"path":"/products/xzgqsearch","comname":"xzgqsearch"},
},
"pauths":[
"add","edit","delete","export","show"
],
"pdict":{
"sex":{"male":"男","female":"女"},
"configType":{"price":"宝币兑换率","initGift":"初次赠送"},
"productCata":{"ip":"知产","ic":"工商","tax":"财税","hr":"人力","common":"常用"},
"logLevel":{"debug":0,"info":1,"warn":2,"error":3,"fatal":4},
"tradeType":{"fill":"充值","consume":"消费","gift":"赠送","giftMoney":"红包","refund":"退款"},
"tradeStatus":{"unSettle":"未结算","settled":"已结算"}
}
}
}
const system=require("../system")
const logCtl=system.getObject("web.oplogCtl");
class TaskBase{
constructor(className){
this.redisClient=system.getObject("util.redisClient");
this.serviceName=className;
}
async doTask(){
try {
await this.subDoTask();
//日志记录
logCtl.info({
optitle:this.serviceName+",任务成功执行完成",
op:"base/db/task.base.js",
content:"",
clientIp:""
});
} catch (e) {
//日志记录
logCtl.error({
optitle:this.serviceName+"任务执行异常",
op:"base/db/task.base.js",
content:e.stack,
clientIp:""
});
}
}
async subDoTask(){
console.log("请在子类中重写此方法进行操作业务逻辑............................!");
}
static getServiceName(ClassObj){
return ClassObj["name"];
}
}
module.exports=TaskBase;
const TaskBase=require("../task.base");
var system=require("../../system")
const logCtl=system.getObject("web.oplogCtl");
class BehivetoBossCustomerTask extends TaskBase{
constructor(){
super(TaskBase.getServiceName(BehivetoBossCustomerTask));
this.wxapi=system.getObject("applet.bossShopApplet");
}
async subDoTask(){
await this.execCustomer();
await this.execOrder();
await this.exectm();
}
async execCustomer(){
console.log("导入老客户数据*******************************任务*************************************99");
var tmp=await this.wxapi.customersbysalemanlist();
//日志记录
logCtl.info({
optitle:"导入老客户数据",
op:"base/db/task/BehivetoBossCustomerTask.js",
content:"执行结果:"+JSON.stringify(tmp),
clientIp:""
});
}
async execOrder(){
console.log("导入老客户订单数据*******************************任务*************************************99");
var tmp=await this.wxapi.customersbysalemanlist();
//日志记录
logCtl.info({
optitle:"导入老客户订单数据",
op:"base/db/task/BehivetoBossCustomerTask.js",
content:"执行结果:"+JSON.stringify(tmp),
clientIp:""
});
}
async exectm(){
console.log("导入商标数据*******************************任务*************************************99");
var tmp=await this.wxapi.findbhtm();
//日志记录
logCtl.info({
optitle:"导入商标数据",
op:"base/db/task/BehivetoBossCustomerTask.js",
content:"执行结果:"+JSON.stringify(tmp),
clientIp:""
});
}
}
module.exports=BehivetoBossCustomerTask;
//
// var task=new PlatformBalanceTask();
// task.checkPlatformBalance().then(function(result){
// console.log((result));
// }).catch(function(e){
// console.log(e);
// });
const TaskBase=require("../task.base");
var system=require("../../system")
const logCtl=system.getObject("web.oplogCtl");
class BusinessOneAllotTask extends TaskBase{
constructor(){
super(TaskBase.getServiceName(BusinessOneAllotTask));
this.channelmanageallotSve=system.getObject("service.channelmanageallotSve");
}
async subDoTask(){
await this.execTj();
}
async execTj(){
console.log("商机分配平台待服务执行结果*******************************任务*************************************99");
var tmp=await this.channelmanageallotSve.businessOneAllot("https://boss.gongsibao.com/distributeneed#/businesschance/waitdeal?from=mobile");
//日志记录
logCtl.info({
optitle:"商机分配平台待服务执行结果",
op:"base/db/task/BusinessOneAllotTask.js",
content:"执行结果:"+JSON.stringify(tmp),
clientIp:""
});
}
}
module.exports=BusinessOneAllotTask;
//
// var task=new PlatformBalanceTask();
// task.checkPlatformBalance().then(function(result){
// console.log((result));
// }).catch(function(e){
// console.log(e);
// });
const TaskBase=require("../task.base");
var system=require("../../system")
const logCtl=system.getObject("web.oplogCtl");
class BusinessTwoAllotTask extends TaskBase{
constructor(){
super(TaskBase.getServiceName(BusinessTwoAllotTask));
this.channelmanageallotSve=system.getObject("service.channelmanageallotSve");
}
async subDoTask(){
await this.execTj();
}
async execTj(){
console.log("商机分配平台跟进中执行结果*******************************任务*************************************88");
var tmp=await this.channelmanageallotSve.businessOneAllot("https://boss.gongsibao.com/distributeneed#/businesschance/waitdeal?from=mobile");
//日志记录
logCtl.info({
optitle:"商机分配平台跟进中执行结果",
op:"base/db/task/BusinessTwoAllotTask.js",
content:"执行结果:"+JSON.stringify(tmp),
clientIp:""
});
}
}
module.exports=BusinessTwoAllotTask;
//
// var task=new PlatformBalanceTask();
// task.checkPlatformBalance().then(function(result){
// console.log((result));
// }).catch(function(e){
// console.log(e);
// });
const TaskBase=require("../task.base");
const system=require("../../system")
class CheckDownloadTask extends TaskBase{
constructor(){
super(TaskBase.getServiceName(CheckDownloadTask));
this.rs=system.getObject("util.restClient");
}
async subDoTask(){
//循环检查downloadtasks队列中的记录
console.log("CheckDownloadTask.........outer");
var xt=await this.redisClient.rpop("downloadtaxtasks");
console.log("CheckDownloadTask........."+xt);
while(xt && xt.indexOf("_")>=0){
console.log("CheckDownloadTask inner.........");
var ccid=xt.split("_")[0];
var cemail=xt.split("_")[1];
//await this.rs.execPost({cid:ccid,email:cemail},"http://127.0.0.1:3000/web/taskCtl/makerpt");
this.rs.execPost({sharecode:ccid,email:cemail},"https://boss.gongsibao.com/web/taskCtl/makerpt");
xt=await this.redisClient.rpop("downloadtaxtasks");
}
}
}
module.exports=CheckDownloadTask;
const TaskBase=require("../task.base");
var system=require("../../system")
const http=require("http")
const querystring = require('querystring');
var settings=require("../../../config/settings");
class PlatformBalanceTask extends TaskBase{
constructor(){
super(TaskBase.getServiceName(PlatformBalanceTask));
this.tradeSve=system.getObject("service.tradeSve");
this.pAccountDao=system.getObject("db.pAccountDao");
this.accountlogSve=system.getObject("service.accountlogSve");
}
async subDoTask(){
await this.checkPlatformBalance();
}
async checkPlatformBalance(){
var accounts = await this.pAccountDao.model.findAll({attributes:["id","baoBalance","renBalance"],raw:true});
var that = this;
var sumBao=0;
var sumRen=0;
if(accounts.length>0){
var account = accounts[0];
var trades = await this.tradeSve.dao.model.findAll({attributes:["id","baoAmount","renAmount","tradeType","status"],raw:true});
trades.forEach(trade=>{
// "fill": "充值", "consume": "消费", "gift": "赠送", "giftMoney": "红包", "refund": "退款","payment":"付款",
// "orderTrade": "订单交易", "orderRefund": "订单退款", "orderPersonFee": "订单个人分润",
// "orderPlatformFee": "订单平台分润","recommendFee": "推荐分润", "tmSubDeductCoin": "商标提报宝币扣除",
// "cashWithdrawal": "现金提现","platUseFee":"平台使用费","publicExpense":"官费","invoiceTaxes":"税费"
//宝币:
// user: "fill": "充值", "consume": "消费", "gift": "赠送","tmSubDeductCoin": "商标提报宝币扣除",
// platform:
//人民币:
// user: "fill": "充值","orderPersonFee": "订单个人分润","recommendFee": "推荐分润","cashWithdrawal": "现金提现",
// platform: "orderTrade": "订单交易","orderRefund": "订单退款","orderPlatformFee": "订单平台分润","platUseFee":"平台使用费","publicExpense":"官费","invoiceTaxes":"税费"
sumBao=sumBao - Number(trade.baoAmount);
if(trade.tradeType!="orderTrade" ){
if(trade.tradeType=="fill" || trade.tradeType=="orderPersonFee" || trade.tradeType=="recommendFee" ){
sumRen=(sumRen*10000-Number(trade.renAmount)*10000)/10000;
}else if(trade.tradeType=="platformPayment" || trade.tradeType=="subPublicExpense"){
sumRen=(sumRen*10000+Number(trade.renAmount)*10000)/10000;
}
}else{
sumRen=(sumRen*10000+Number(trade.renAmount)*10000)/10000;
}
});
if(sumBao==Number(account.baoBalance) && sumRen==Number(account.renBalance)){
console.log(account.id+"---------------------------------success");
}else{
console.log(account.id+"+++++++++++"+sumBao+"++++++++++++++"+sumRen+"++++++++++++"+account.baoBalance+"++++++"+account.renBalance+"--");
// var obj={id:account.id,baoBalance:sumBao,renBalance:sumRen};
// var logObj={
// accountId:account.id,beforeBaoBalance:account.baoBalance,beforeRenBalance:account.renBalance,
// afterBaoBalance:sumBao,afterRenBalance:sumRen,logType:"platform"
// };
// var a = await that.tradeSve.db.transaction(async function (t){
// var accountUpdate = await that.pAccountDao.update(obj,t);
// var log = await that.accountlogSve.create(logObj,t);
// });
}
}
}
}
module.exports=PlatformBalanceTask;
// var task=new PlatformBalanceTask();
// task.checkPlatformBalance().then(function(result){
// console.log((result));
// }).catch(function(e){
// console.log(e);
// });
const TaskBase=require("../task.base");
var system=require("../../system")
// const http=require("http")
// const querystring = require('querystring');
// var settings=require("../../../config/settings");
class StatisticalRateTask extends TaskBase{
constructor(){
super(TaskBase.getServiceName(StatisticalRateTask));
this.statisticalrateSve=system.getObject("service.statisticalrateSve");
}
async subDoTask(){
await this.execTj();
}
async execTj(){
await this.statisticalrateSve.syncStatisticsData();
}
}
module.exports=StatisticalRateTask;
//
// var task=new PlatformBalanceTask();
// task.checkPlatformBalance().then(function(result){
// console.log((result));
// }).catch(function(e){
// console.log(e);
// });
const TaskBase=require("../task.base");
class TestTask extends TaskBase{
constructor(){
super(TaskBase.getServiceName(TestTask));
}
async subDoTask(){
console.log("TestTask1.....");
}
}
module.exports=TestTask;
const TaskBase=require("../task.base");
class TestTask0 extends TaskBase{
constructor(){
super(TaskBase.getServiceName(TestTask0));
}
async subDoTask(){
console.log("TestTask0.....");
}
}
module.exports=TestTask0;
const TaskBase = require("../task.base");
var system = require("../../system")
const logCtl = system.getObject("web.oplogCtl");
class TmDynamicsAllotTask extends TaskBase {
constructor() {
super(TaskBase.getServiceName(BusinessOneAllotTask));
this.bytmdynamicsSve = system.getObject("service.bytmdynamicsSve");
}
async subDoTask() {
await this.execSend();
}
async execSend() {
var tmp = await this.bytmdynamicsSve.notifyWxTmDynamics();
//日志记录
logCtl.info({
optitle: "商标监控动态数量增加微信通知执行结果",
op: "base/db/task/TmDynamicsAllotTask.js",
content: "执行结果:" + tmp,
clientIp: ""
});
}
}
module.exports = TmDynamicsAllotTask;
const TaskBase=require("../task.base");
var system=require("../../system")
const http=require("http")
const querystring = require('querystring');
var settings=require("../../../config/settings");
class UserBalanceTask extends TaskBase{
constructor(){
super(TaskBase.getServiceName(UserBalanceTask));
this.tradeSve=system.getObject("service.tradeSve");
this.accountSve=system.getObject("service.accountSve");
this.accountlogSve=system.getObject("service.accountlogSve");
}
async subDoTask(){
await this.checkUserBalance();
}
async checkUserBalance(){
// console.log("checkUserBalance------------------------------------------------------------");
var accounts = await this.accountSve.dao.model.findAll({attributes:["id","unionId","baoBalance","renBalance"],raw:true});
// console.log(accounts);
// console.log("遍历--------------------------------------------------");
var that = this;
for(var i=0;i<accounts.length;i++){
var sumBao=0;
var sumRen=0;
var account = accounts[i];
var trades = await this.tradeSve.dao.model.findAll({where:{account_id:account.id},raw:true});
trades.forEach(trade=>{
if(trade.tradeType=="orderPersonFee" || trade.tradeType=="recommendFee" || trade.tradeType=="cashWithdrawal"
|| trade.tradeType=="gift"
|| trade.tradeType=="consume" || trade.tradeType=="fill" || trade.tradeType=="tmSubDeductCoin"){
sumBao=(Number(trade.baoAmount)*10000+sumBao*10000)/10000;
if(trade.tradeType!="fill"){
sumRen=(Number(trade.renAmount)*10000+sumRen*10000)/10000;
}
// console.log(sumBao+"++++++++++++++++"+sumRen);
// else{
// sumRen=Number(trade.renAmount)-sumRen;
// }
}
// "fill": "充值", "consume": "消费", "gift": "赠送", "giftMoney": "红包", "refund": "退款","payment":"付款",
// "orderTrade": "订单交易", "orderRefund": "订单退款", "orderPersonFee": "订单个人分润",
// "orderPlatformFee": "订单平台分润","recommendFee": "推荐分润", "tmSubDeductCoin": "商标提报宝币扣除",
// "cashWithdrawal": "现金提现","platUseFee":"平台使用费","publicExpense":"官费","invoiceTaxes":"税费"
//宝币:
// user: "fill": "充值", "consume": "消费", "gift": "赠送","tmSubDeductCoin": "商标提报宝币扣除",
// platform:
//人民币:
// user: "fill": "充值","orderPersonFee": "订单个人分润","recommendFee": "推荐分润","cashWithdrawal": "现金提现",
// platform: "orderTrade": "订单交易","orderRefund": "订单退款","orderPlatformFee": "订单平台分润","platUseFee":"平台使用费","publicExpense":"官费","invoiceTaxes":"税费"
});
if(sumBao==Number(account.baoBalance) && sumRen==Number(account.renBalance)){
// console.log(account.id+"---------------------------------success");
}else{
console.log(account.id+"+++++"+sumBao+"+++++"+sumRen+"+++++"+account.baoBalance+"+++++"+account.renBalance+"--");
// var obj={id:account.id,baoBalance:sumBao,renBalance:sumRen};
// var logObj={
// accountId:account.id,accountUnionId:account.unionId,beforeBaoBalance:account.baoBalance,beforeRenBalance:account.renBalance,
// afterBaoBalance:sumBao,afterRenBalance:sumRen,logType:"user"
// };
// var a = await that.accountSve.db.transaction(async function (t){
// var accountUpdate = await that.accountSve.update(obj,t);
// var log = await that.accountlogSve.create(logObj,t);
// });
}
}
}
}
module.exports=UserBalanceTask;
// var task=new UserBalanceTask();
// task.checkUserBalance().then(function(result){
// console.log((result));
// }).catch(function(e){
// console.log(e);
// });
const TaskBase=require("../task.base");
class TestTask extends TaskBase{
constructor(){
super();
}
async doTask(){
console.log("TestTask.....");
}
}
module.exports=TestTask;
var sha1 = require('sha1'),
events = require('events'),
emitter = new events.EventEmitter(),
xml2js = require('xml2js');
// 微信类
var Weixin = function(path) {
this.data = '';
this.msgType = 'text';
this.fromUserName = '';
this.toUserName = '';
this.funcFlag = 0;
this.path=path;
}
// 验证
Weixin.prototype.checkSignature = function(req) {
// 获取校验参数
this.signature = req.query.signature,
this.timestamp = req.query.timestamp,
this.nonce = req.query.nonce,
this.echostr = req.query.echostr;
// 按照字典排序
var array = [this.token, this.timestamp, this.nonce];
array.sort();
// 连接
var str = sha1(array.join(""));
// 对比签名
if(str == this.signature) {
return true;
} else {
return false;
}
}
// ------------------ 监听 ------------------------
// 监听文本消息
Weixin.prototype.textMsg = function(callback) {
emitter.on("weixinTextMsg", callback);
return this;
}
// 监听图片消息
Weixin.prototype.imageMsg = function(callback) {
emitter.on("weixinImageMsg", callback);
return this;
}
// 监听地理位置消息
Weixin.prototype.locationMsg = function(callback) {
emitter.on("weixinLocationMsg", callback);
return this;
}
// 监听链接消息
Weixin.prototype.urlMsg = function(callback) {
emitter.on("weixinUrlMsg", callback);
return this;
}
// 监听事件
Weixin.prototype.eventMsg = function(callback) {
emitter.on("weixinEventMsg", callback);
return this;
}
// ----------------- 消息处理 -----------------------
/*
* 文本消息格式:
* ToUserName 开发者微信号
* FromUserName 发送方帐号(一个OpenID)
* CreateTime 消息创建时间 (整型)
* MsgType text
* Content 文本消息内容
* MsgId 消息id,64位整型
*/
Weixin.prototype.parseTextMsg = function() {
var msg = {
"toUserName" : this.data.ToUserName[0],
"fromUserName" : this.data.FromUserName[0],
"createTime" : this.data.CreateTime[0],
"msgType" : this.data.MsgType[0],
"content" : this.data.Content[0],
"msgId" : this.data.MsgId[0],
}
emitter.emit("weixinTextMsg", msg);
return this;
}
/*
* 图片消息格式:
* ToUserName 开发者微信号
* FromUserName 发送方帐号(一个OpenID)
* CreateTime 消息创建时间 (整型)
* MsgType image
* Content 图片链接
* MsgId 消息id,64位整型
*/
Weixin.prototype.parseImageMsg = function() {
var msg = {
"toUserName" : this.data.ToUserName[0],
"fromUserName" : this.data.FromUserName[0],
"createTime" : this.data.CreateTime[0],
"msgType" : this.data.MsgType[0],
"picUrl" : this.data.PicUrl[0],
"msgId" : this.data.MsgId[0],
}
emitter.emit("weixinImageMsg", msg);
return this;
}
/*
* 地理位置消息格式:
* ToUserName 开发者微信号
* FromUserName 发送方帐号(一个OpenID)
* CreateTime 消息创建时间 (整型)
* MsgType location
* Location_X x
* Location_Y y
* Scale 地图缩放大小
* Label 位置信息
* MsgId 消息id,64位整型
*/
Weixin.prototype.parseLocationMsg = function(data) {
var msg = {
"toUserName" : this.data.ToUserName[0],
"fromUserName" : this.data.FromUserName[0],
"createTime" : this.data.CreateTime[0],
"msgType" : this.data.MsgType[0],
"locationX" : this.data.Location_X[0],
"locationY" : this.data.Location_Y[0],
"scale" : this.data.Scale[0],
"label" : this.data.Label[0],
"msgId" : this.data.MsgId[0],
}
emitter.emit("weixinLocationMsg", msg);
return this;
}
/*
* 链接消息格式:
* ToUserName 开发者微信号
* FromUserName 发送方帐号(一个OpenID)
* CreateTime 消息创建时间 (整型)
* MsgType link
* Title 消息标题
* Description 消息描述
* Url 消息链接
* MsgId 消息id,64位整型
*/
Weixin.prototype.parseLinkMsg = function() {
var msg = {
"toUserName" : this.data.ToUserName[0],
"fromUserName" : this.data.FromUserName[0],
"createTime" : this.data.CreateTime[0],
"msgType" : this.data.MsgType[0],
"title" : this.data.Title[0],
"description" : this.data.Description[0],
"url" : this.data.Url[0],
"msgId" : this.data.MsgId[0],
}
emitter.emit("weixinUrlMsg", msg);
return this;
}
/*
* 事件消息格式:
* ToUserName 开发者微信号
* FromUserName 发送方帐号(一个OpenID)
* CreateTime 消息创建时间 (整型)
* MsgType event
* Event 事件类型,subscribe(订阅)、unsubscribe(取消订阅)、CLICK(自定义菜单点击事件)
* EventKey 事件KEY值,与自定义菜单接口中KEY值对应
*/
Weixin.prototype.parseEventMsg = function() {
var eventKey = '';
if (this.data.EventKey) {
eventKey = this.data.EventKey[0];
}
var msg = {
"toUserName" : this.data.ToUserName[0],
"fromUserName" : this.data.FromUserName[0],
"createTime" : this.data.CreateTime[0],
"msgType" : this.data.MsgType[0],
"event" : this.data.Event[0],
"eventKey" : eventKey,
"appk":this.path,
}
emitter.emit("weixinEventMsg", msg);
return this;
}
// --------------------- 消息返回 -------------------------
// 返回文字信息
Weixin.prototype.sendTextMsg = function(msg) {
var time = Math.round(new Date().getTime() / 1000);
var funcFlag = msg.funcFlag ? msg.funcFlag : this.funcFlag;
var output = "" +
"<xml>" +
"<ToUserName><![CDATA[" + msg.toUserName + "]]></ToUserName>" +
"<FromUserName><![CDATA[" + msg.fromUserName + "]]></FromUserName>" +
"<CreateTime>" + time + "</CreateTime>" +
"<MsgType><![CDATA[" + msg.msgType + "]]></MsgType>" +
"<Content><![CDATA[" + msg.content + "]]></Content>" +
"<FuncFlag>" + funcFlag + "</FuncFlag>" +
"</xml>";
this.res.type('xml');
this.res.send(output);
return this;
}
// 返回音乐信息
Weixin.prototype.sendMusicMsg = function(msg) {
var time = Math.round(new Date().getTime() / 1000);
var funcFlag = msg.funcFlag ? msg.funcFlag : this.funcFlag;
var output = "" +
"<xml>" +
"<ToUserName><![CDATA[" + msg.toUserName + "]]></ToUserName>" +
"<FromUserName><![CDATA[" + msg.fromUserName + "]]></FromUserName>" +
"<CreateTime>" + time + "</CreateTime>" +
"<MsgType><![CDATA[" + msg.msgType + "]]></MsgType>" +
"<Music>" +
"<Title><![CDATA[" + msg.title + "]]></Title>" +
"<Description><![CDATA[" + msg.description + "DESCRIPTION]]></Description>" +
"<MusicUrl><![CDATA[" + msg.musicUrl + "]]></MusicUrl>" +
"<HQMusicUrl><![CDATA[" + msg.HQMusicUrl + "]]></HQMusicUrl>" +
"</Music>" +
"<FuncFlag>" + funcFlag + "</FuncFlag>" +
"</xml>";
this.res.type('xml');
this.res.send(output);
return this;
}
// 返回图文信息
Weixin.prototype.sendNewsMsg = function(msg) {
var time = Math.round(new Date().getTime() / 1000);
//
var articlesStr = "";
for (var i = 0; i < msg.articles.length; i++)
{
articlesStr += "<item>" +
"<Title><![CDATA[" + msg.articles[i].title + "]]></Title>" +
"<Description><![CDATA[" + msg.articles[i].description + "]]></Description>" +
"<PicUrl><![CDATA[" + msg.articles[i].picUrl + "]]></PicUrl>" +
"<Url><![CDATA[" + msg.articles[i].url + "]]></Url>" +
"</item>";
}
var funcFlag = msg.funcFlag ? msg.funcFlag : this.funcFlag;
var output = "" +
"<xml>" +
"<ToUserName><![CDATA[" + msg.toUserName + "]]></ToUserName>" +
"<FromUserName><![CDATA[" + msg.fromUserName + "]]></FromUserName>" +
"<CreateTime>" + time + "</CreateTime>" +
"<MsgType><![CDATA[" + msg.msgType + "]]></MsgType>" +
"<ArticleCount>" + msg.articles.length + "</ArticleCount>" +
"<Articles>" + articlesStr + "</Articles>" +
"<FuncFlag>" + funcFlag + "</FuncFlag>" +
"</xml>";
this.res.type('xml');
this.res.send(output);
return this;
}
// ------------ 主逻辑 -----------------
// 解析
Weixin.prototype.parse = function() {
if(this.data){
this.msgType = this.data.MsgType[0] ? this.data.MsgType[0] : "text";
switch(this.msgType) {
case 'text' :
this.parseTextMsg();
break;
case 'image' :
this.parseImageMsg();
break;
case 'location' :
this.parseLocationMsg();
break;
case 'link' :
this.parseLinkMsg();
break;
case 'event' :
this.parseEventMsg();
break;
}
}
}
// 发送信息
Weixin.prototype.sendMsg = function(msg) {
switch(msg.msgType) {
case 'text' :
this.sendTextMsg(msg);
break;
case 'music' :
this.sendMusicMsg(msg);
break;
case 'news' :
this.sendNewsMsg(msg);
break;
}
}
// Loop
Weixin.prototype.loop = function(req, res) {
// 保存res
this.res = res;
var self = this;
// 获取XML内容
var buf = '';
req.setEncoding('utf8');
req.on('data', function(chunk) {
buf += chunk;
});
// 内容接收完毕
req.on('end', function() {
xml2js.parseString(buf, function(err, json) {
if (err) {
err.status = 400;
} else {
req.body = json;
}
});
if(req.body){
self.data = req.body.xml;
}
self.parse();
});
}
module.exports = Weixin;
var Wx = require("./wx.event");
const system = require("../system");
var dicCache = {};
//创知厚的我想我要的配置
wxconfig = {
AppID: "wx4c91e81bbb6039cd",
Secret: "12048e66dba64f2581e02b306680b232",
Token: "bosstoken",
AccessTokenUrl: "https://api.weixin.qq.com/cgi-bin/token",
};
//智薪云的配置
wxconfig2 = {
AppID: "wxdc08c441c9fdb7a7",
Secret: "379e582e28645585a7def9c1c88de550",
Token: "bosstoken",
AccessTokenUrl: "https://api.weixin.qq.com/cgi-bin/token",
};
wxconfigDic = {
"wx4c91e81bbb6039cd": wxconfig,
"wxdc08c441c9fdb7a7": wxconfig2,
}
var getWeiXin = function (url) {
var weixin = null;
if (!dicCache[url]) {
weixin = new Wx(url);
dicCache[url] = weixin;
} else {
weixin = dicCache[url];
}
weixin.token = wxconfig.Token;
weixin.wxconfig = wxconfig;
weixin.getAccessConfig = function (appkey) {
var cfg = wxconfigDic[appkey];
return {
grant_type: "client_credential",
appid: cfg.AppID,
secret: cfg.Secret,
};
}
// 监听文本消息
weixin.textMsg(function (msg) {
console.log("textMsg received");
console.log(JSON.stringify(msg));
var resMsg = {};
switch (msg.content) {
case "文本":
// 返回文本消息
resMsg = {
fromUserName: msg.toUserName,
toUserName: msg.fromUserName,
msgType: "text",
content: "这是文本回复",
funcFlag: 0
};
break;
case "音乐":
// 返回音乐消息
resMsg = {
fromUserName: msg.toUserName,
toUserName: msg.fromUserName,
msgType: "music",
title: "音乐标题",
description: "音乐描述",
musicUrl: "音乐url",
HQMusicUrl: "高质量音乐url",
funcFlag: 0
};
break;
case "图文":
var articles = [];
articles[0] = {
title: "PHP依赖管理工具Composer入门",
description: "PHP依赖管理工具Composer入门",
picUrl: "http://weizhifeng.net/images/tech/composer.png",
url: "http://weizhifeng.net/manage-php-dependency-with-composer.html"
};
articles[1] = {
title: "八月西湖",
description: "八月西湖",
picUrl: "http://weizhifeng.net/images/poem/bayuexihu.jpg",
url: "http://weizhifeng.net/bayuexihu.html"
};
articles[2] = {
title: "「翻译」Redis协议",
description: "「翻译」Redis协议",
picUrl: "http://weizhifeng.net/images/tech/redis.png",
url: "http://weizhifeng.net/redis-protocol.html"
};
// 返回图文消息
resMsg = {
fromUserName: msg.toUserName,
toUserName: msg.fromUserName,
msgType: "news",
articles: articles,
funcFlag: 0
}
}
weixin.sendMsg(resMsg);
});
// 监听图片消息
weixin.imageMsg(function (msg) {
console.log("imageMsg received");
console.log(JSON.stringify(msg));
});
// 监听位置消息
weixin.locationMsg(function (msg) {
console.log("locationMsg received");
console.log(JSON.stringify(msg));
});
// 监听链接消息
weixin.urlMsg(function (msg) {
console.log("urlMsg received");
console.log(JSON.stringify(msg));
});
// 监听事件消息
weixin.eventMsg(function (msg) {
if (msg.event == "subscribe" || msg.event == "SCAN") {
var wxservice = system.getObject("service.wxSve");
//to do msg.toUserName--按照微信号去取得应用,按照应用获取OAUTH
// wxservice.checkAndLogin(msg.fromUserName);
if (weixin.path == "ecwx") {
var urlstr = "https://ec.gongsibao.com/h5";
if (msg.eventKey && msg.eventKey != "") {
if (msg.eventKey.indexOf("_") >= 0) {
var strid = msg.eventKey.split('_')[1];
urlstr = urlstr + "?ecid=" + strid;
} else {
var strid = msg.eventKey;
urlstr = urlstr + "?ecid=" + strid;
}
}
var articles = [];
articles[0] = {
title: "欢迎来到智薪云签约平台",
description: "点击本图文消息,开始签约。",
picUrl: "https://gsb-zc.oss-cn-beijing.aliyuncs.com//zc_476111544670096808201813111368084242271.jpg",
url: urlstr,
};
var resMsg = {
fromUserName: msg.toUserName,
toUserName: msg.fromUserName,
msgType: "news",
articles: articles,
funcFlag: 0
};
weixin.sendMsg(resMsg);
} else {
//是否启用派单
var dispatchEnabled = true;
// 通知信息
var articles = [];
// 参数
var eventKey = msg.eventKey;
var userId = 0;
if (eventKey && eventKey.indexOf("_") > -1) {
// 标眼查通知openId保存逻辑
userId = Number(eventKey.split("_")[1] || 0);
if (userId && userId > 0) {
dispatchEnabled = false;
// 标眼查动态通知
articles[0] = {
title: "欢迎使用标眼监测商标监控工具",
description: "实时提醒商标动态,及时处理商标业务",
picUrl: "",
//picUrl: "https://search.gongsibao.com/imgs/biaoyan-logo-mini.png",
url: ""
};
}
}
else {
if (eventKey) {
userId = Number(eventKey);
}
}
if (dispatchEnabled) {
// 派单通知
articles[0] = {
title: "欢迎来到创知厚德智能派单平台",
description: "点击图文消息,开始接单",
picUrl: "https://gsb-zc.oss-cn-beijing.aliyuncs.com//zc_305111544784291353201814184451353distributeneed.png",
url: "https://boss.gongsibao.com/distributeneed",
};
}
if (userId && userId > 0) {
// wxservice.更新通知id
wxservice.updateNotifyOpenId(userId, msg.fromUserName);
}
var resMsg = {
fromUserName: msg.toUserName,
toUserName: msg.fromUserName,
msgType: "news",
articles: articles,
funcFlag: 0
};
weixin.sendMsg(resMsg);
}
} else {
//发送空串回微信服务器
weixin.res.send("");
}
});
return weixin;
}
module.exports = getWeiXin;
\ No newline at end of file
// class A{
// a(params) {
// console.log(params);
// }
// b(params) {
// console.log(params);
// }
// }
// console.log(A.toString());
// var reg1 = /([a-z])*\(.*\)/g;
// var m=A.toString().match(reg1);
// console.log(m);
// var WXPay = require('wx-pay');
// var wxpay = WXPay({
// appid: 'wx6f3ebe44defe336a',
// mch_id: '1232813602',
// partner_key: 'sinotone2014sinotone2014sinotone', //微信商户平台API密钥
// //pfx: fs.readFileSync('./wxpay_cert.p12'), //微信商户平台证书
// //pfx: "sinotone2014sinotone2014sinotone"
// });
// // var out_trade_no='20160203'+Math.random().toString().substr(2, 10);
// // wxpay.createUnifiedOrder({
// // body: '充值兑换宝币',
// // out_trade_no: out_trade_no,
// // total_fee: 1,
// // spbill_create_ip: '192.168.2.210',
// // notify_url: 'http://www.gongsibao.com',
// // trade_type: 'NATIVE',
// // product_id: '1234567890'
// // }, function(err, result){
// // console.log(result);
// // //查询订单
// // //通过微信订单号查
// // wxpay.queryOrder({ out_trade_no:out_trade_no}, function(err, order){
// // console.log(order);
// // });
// //
// // });
// async function queryWxOrder(idkey){
// var p=new Promise((resv,rej)=>{
// wxpay.queryOrder({ out_trade_no:idkey}, function(err, order){
// if(err){
// return rej(err);
// }else{
// return resv(order);
// }
// });
// });
// return p;
// }
// async function testQuery(){
// try{
// var result = await queryWxOrder("d942bc2ccd784034af60c2d92079c897");
// console.log(result);
// }catch(e){
// console.log(e);
// console.log("error.................");
// }
// }
// testQuery();
// 二、框架
// 三、实战
// async function getCacheByKey(k){
// return k;
// }
// async function buildData(data){
// console.log(data);
// console.log("xxxxxxxxxxxxxxxx");
// console.log(data.length);
// var ds=[]
// for(var i=0;i<data.length;i++){
// console.log(i);
// var source={name:""};
// var count=await getCacheByKey(data[i].name);
// source.name=data[i].name;
// source.value=count;
// ds.push(source);
// }
// return ds;
// }
// async function out(){
// var data=[
// {"name":"jy"},
// {"name":"tom"}
// ];
// var ds=await buildData(data);
// console.log(ds);
// }
//
// out();
// async function ok1(){
// var p=new Promise(function(res,rej){
// setTimeout(()=>{
// return res("ok1");
// },2000);
// });
// return p;
// }
// async function ok2(){
// return "ok2";
// }
// async function ok3(){
// var k1=await ok1();
// console.log(k1);
// var k2=await ok2();
// console.log(k2);
// }
// ok3();
// const uuidv4 = require('uuid/v4');
// var u=uuidv4()
// console.log(u.replace(/\-/g,""))
// async function testAsync1(){
// return 5;
// }
//
// async function testAsync2(){
// return 5;
// }
// async function testAsync3(){
// var x= await testAsync1();
// var y= await testAsync2();
// return 5;
// }
// var x=testAsync().then(function(r){
// console.log(r);
// return 6;
// }).then(function(r){
// console.log(r);
// return 7;
// });
// x.then(function(r){
// console.log(r);
// }).catch(function(err){
//
// });
// function getArgs(func){
// //匹配函数括号里的参数
// var args=func.toString().match(/[async|function]\s.*?\(([^)]*)\)/)[1];
// //分解参数成数组
// return args.split(",").map(function (arg){
// //去空格和内联注释
// return arg.replace(/\/\*.*\*\//,"").trim();
// }).filter(function(args) {
// //确保没有undefineds
// return args;
// });
// }
// console.log(convertoss["testMethod"].toString());
// var inObj={a:"hello",b:"ok"}
// var p=convertoss["testMethod"].apply(convertoss,["hello","kkkk"]);
// var args=getArgs(convertoss["testMethod"])
// console.log(args);
//var p=convertoss["testMethod"].call(convertoss,["hello"]);
//var p=Reflect.apply(,convertoss,"hello");
// p.then(function(r){
// console.log(r);
// });
// convertoss.convert2pdf(key).then(function(result){
// console.log(result);
// }).catch(function(e){
// console.log(e);
// });
// var routes=[
// {
// path:'/',components:{
// default:componentFactory("products"),
// // shows:demo
// }
// },
// {
// path:'/products/:id/detail',components:{
// default:componentFactory("detail"),
// //shows:demo
// }
// },
// {
// path:'/platform/apps',components:{
// default:componentFactory("apps"),
// //shows:demo
// }
// },
// {
// path:'/platform/users',components:{
// default:componentFactory("users"),
// //shows:demo
// }
// },
// {
// path:'/platform/op/oplogs',components:{
// default:componentFactory("oplogs"),
// //shows:demo
// }
// },
// ]
var str="第三随风散大夫|vcode|xds的随风散大夫";
var x=str.replace(/\|vcode\|/g,"13381139519");
console.log(x);
\ No newline at end of file
# apiVersion: v1
# kind: Service
# metadata:
# name: konga
# spec:
# type: NodePort
# ports:
# - name: konga
# port: 1337
# targetPort: 1337
# protocol: TCP
# selector:
# app: konga
# ---
# apiVersion: extensions/v1beta1
# kind: Deployment
# metadata:
# name: konga
# spec:
# replicas: 1
# template:
# metadata:
# labels:
# name: konga
# app: konga
# spec:
# containers:
# - name: konga
# image: pantsel/konga:0.14.1
# env:
# - name: DB_DATABASE
# value: k8s_konga
# - name: DB_USER
# valueFrom:
# configMapKeyRef:
# name: zhichan-config
# key: DB_USER
# - name: DB_PASSWORD
# valueFrom:
# configMapKeyRef:
# name: zhichan-config
# key: DB_PWD
# - name: DB_PORT
# valueFrom:
# configMapKeyRef:
# name: zhichan-config
# key: DB_PORT
# - name: DB_ADAPTER
# value: mysql
# - name: DB_HOST
# valueFrom:
# configMapKeyRef:
# name: zhichan-config
# key: DB_HOST
# - name: NODE_ENV
# value: production
# - name: TOKEN_SECRET
# value: testtoken
# ports:
# - name: konga
# containerPort: 1337
# protocol: TCP
apiVersion: v1
kind: Service
metadata:
name: kong-dashboard
namespace: kong
spec:
type: NodePort
ports:
- name: kong-dashboard
port: 80
targetPort: 8080
protocol: TCP
selector:
app: dashboard
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: dashboard
namespace: kong
spec:
template:
metadata:
labels:
name: dashboard
app: dashboard
spec:
containers:
- name: kong-dashboard
args:
- start
- --kong-url http://kong-ingress-controller:8001
- --basic-auth admin=admin
image: pgbi/kong-dashboard:latest
ports:
- name: http
containerPort: 8080
protocol: TCP
apiVersion: v1
kind: Service
metadata:
name: kong-admin
namespace: kong
spec:
ports:
- name: kongadmin
port: 8001
protocol: TCP
targetPort: 8001
selector:
app: ingress-kong
curl -v -H "Host: webshell.com" 123.57.217.203:1880
class TestBase{
constructor(){
this.apiDoc={
group:"逻辑分组",
desc:"请对当前类进行描述",
exam:"概要示例",
methods:[]
};
this.initClassDoc();
}
initClassDoc(){
throw new Error(`
请定义当前类的API文档,重写initClassDoc方法.
在initClassDoc方法中调用如下方法:
1.descClass(groupName,classDesc,exam)增加当前类的描述和使用示例
2.descMethod(methodName,paramName,paramType,defaultValue,paramDesc)增加方法的说明
`);
}
descClass(groupName,classDesc,exam){
this.group=groupName;
this.apiDoc.desc=classDesc;
this.apiDoc.exam=exam;
}
descMethod(methodDesc,methodName,paramDesc,paramName,paramType,defaultValue,rtnTypeDesc,rtnType){
var mobj=this.apiDoc.methods.filter((m)=>{
if(m.name==methodName){
return true;
}else{
return false;
}
})[0];
var param={
pname:paramName,
ptype:paramType,
pdesc:paramDesc,
pdefaultValue:defaultValue,
};
if(mobj!=null){
mobj.params.push(param);
}else{
this.apiDoc.methods.push(
{
methodDesc:methodDesc?methodDesc:"",
name:methodName,
params:[param],
rtnTypeDesc:rtnTypeDesc,
rtnType:rtnType
}
);
}
}
}
class Test extends TestBase{
constructor(){
super();
}
initClassDoc(){
this.descClass("class desc",`
xxxxxx
xxxxx
xxxxxxxx
`);
this.descMethod("hello",{
pname:"pname1",
ptype:"int",
pdesc:"xccccc"
});
this.descMethod("hello",{
pname:"pname2",
ptype:"str",
pdesc:"xccccyyyc"
});
}
}
class Test2 extends TestBase{
constructor(){
super();
}
initClassDoc(){
this.descClass("class desc222222",`
xxxxxx
xxxxx
xxxxxxxx
`);
this.descMethod("test2hello",{
pname:"pname1",
ptype:"int",
pdesc:"xccccc"
});
this.descMethod("world",{
pname:"pname2",
ptype:"str",
pdesc:"xccccyyyc"
});
}
}
class Test3 extends TestBase{
constructor(){
super();
}
}
module.exports={cls:Test,doc:new Test().apiDoc};
var t1=new Test();
var t2=new Test2();
console.log(t1.apiDoc);
console.log(t2.apiDoc);
技术总监 职位描述
岗位职责:
负责公司基础平台的设计开发
负责公司开发团队的建设
负责制定项目技术方案,负责系统的架构设计、优化,参与核心架构部分代码编写;
负责软件开发任务的需求分析、技术方案设计、开发计划制定,指导项目团队成员的日常开发工作、解决开发中的技术问题;
职位要求
财务软件开发经验者优先
8年以上Javaphp互联网开发经验,5年以上应用架构经验。
熟悉分布式存储、搜索、异步框架、集群与负载均衡,消息中间件等技术;
有大型分布式、高并发、高负载、高可用系统架构、设计、开发和调优经验;
熟悉各种常用设计模式,能将设计模式应用到日常工作。
熟悉至少一种较为常见的主流数据库及SQL语言,有一定的sql调优经验;熟悉Linux操作系统以及常用版本管理软件操作(如:svn,git)
熟悉至少一种nosql数据库
计算机相关专业本科以上学历。
具有良好的沟通表达能力和团队协作能力。
var fs=require("fs");
var settings=require("../settings");
var glob = require("glob");
var system = require('../../base/system');
var bizcompCache={};
async function asycReadFile(path){
var p=new Promise(function(reslv,reject){
fs.readFile(path,function(err,r){
if(err){
reject(err);
}else{
reslv(r);
}
});
});
return p;
}
async function buildComponent(compname){
if(bizcompCache[compname] && settings.env=="prod"){
return bizcompCache[compname];
}else{
var htmlpath=settings.basepath+"/app/front/vues/pages/"+compname+"/"+compname+".html";
var jspath=settings.basepath+"/app/front/vues/pages/"+compname+"/"+compname+".js";
var html= await asycReadFile(htmlpath);
var tmpl=html.toString("utf-8");
var js= await asycReadFile(jspath);
var jsstr=js.toString("utf-8");
jsstr=jsstr.replace("${tmpl}",tmpl);
bizcompCache[compname]=jsstr;
return jsstr;
}
}
module.exports = function (app) {
app.get('/vue/comp/base',function(req,res){
var vuePath=settings.basepath+"/app/front/vues/base";
var baseComps=[];
var rs=glob.sync(vuePath+"/**/*.vue");
if(rs){
rs.forEach(function(r){
var comp="";
if(settings.env=="dev"){
delete require.cache[r];
comp=require(r).replace(/\n/g,"");
}else{
comp=require(r).replace(/\n/g,"");
}
baseComps.push(comp);
});
res.end(JSON.stringify(baseComps));
}
});
app.get('/vue/comp/:cname',function(req,res){
var componentName=req.params.cname;
var theme=req.headers["theme"];
var hostname=req.hostname;
buildComponent(componentName,theme,hostname).then(function(r){
res.end(escape(r.replace(/\n/g,"")));
// res.end(r);
});
});
};
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta name="keywords" content="PAAS 开放平台">
<meta name="baidu-site-verification" content="lATAxZAm8y" />
<meta name="viewport" content="width=device-width, initial-scale=0.8, maximum-scale=0.8, user-scalable=1">
<title id="idtitle"><%=app.name%></title>
<link rel="stylesheet" href="/css/ele/index_2.5.4.css">
<link rel="stylesheet" href="/css/pagecom.css">
<link rel="stylesheet" href="/css/fontawesome/css/font-awesome.min.css">
<link rel="stylesheet" href="/css/fontawesome/css/toolicon-style.css">
<link rel="stylesheet" href="/css/fontface-timely.css">
<script src="/js/vue/vue.min_2.6.10.js"></script>
<script src="/js/vue/vue-router.min.js"></script>
<script src="/js/vue/vuex.min.js"></script>
<script src="/js/ele/index_2.5.4.js"></script>
<script src="/js/vue/axios.min.js"></script>
<script>
//缓存当前域名对应的公司信息,公司、页脚、银行账号---全局变量
var appinfo = JSON.parse(unescape('<%=appinfo%>'));
console.log(appinfo);
//缓存当前的基础组件列表
var basecomp=JSON.parse(unescape('<%=basecom%>'));
//缓存当前的菜单配置
var global_rsconfig=JSON.parse(unescape('<%=rsconfig%>'));
var companyinfo= JSON.parse(unescape('<%=company%>'));
if(companyinfo.status && companyinfo.status==-1){
companyinfo=null;
}
var tocompanyinfo= JSON.parse(unescape('<%=tocompany%>'));
if(tocompanyinfo.status && tocompanyinfo.status==-1){
tocompanyinfo=null;
}
</script>
<style>
body{
margin: 0px;
padding: 0px;
font-size: 14px;
box-sizing: border-box;
height: 100%;
}
.app-main{
width:100%;
height:100%;
background:url("<%=app.bkimageUrl?app.bkimageUrl:'/imgs/pt3.jpg'%>") no-repeat;background-size: cover;
box-sizing: border-box;
}
.app-header{
display: flex;
justify-content:space-between;
color: white;
padding: 15px;
box-sizing: border-box;
cursor: pointer;
}
.app-stage{
display: flex;
width: 100%;
padding: 5px;
box-sizing: border-box;
}
.app-stage .leftnav{
background-color:green;
max-width: 250px;
min-width: 250px;
flex-grow:1;
box-sizing: border-box;
}
.app-stage .leftnav .el-card__body {
height: 85%;
}
.app-stage .rightcontent{
flex-grow:2;
margin-left: 5px;
margin-right: 15px;
box-sizing: border-box;
}
.app-stage .rightcontent >.el-card{
border-radius: 0px;
height: 100%;
box-shadow:unset;
box-sizing: border-box;
}
.app-stage .is-always-shadow{
box-shadow: unset;
}
.app-stage .leftnav > .el-card{
border-radius: 0px;
height: 100%;
box-sizing: border-box;
}
#appName{
font-size: 30px;
font-family:MicrosoftYaHei;
}
.el-button--text{
color: white
}
.activeColor{
color:deepskyblue;
}
</style>
</head>
<body>
<div id="app" v-loading="loading" class="app-main" style="visibility:hidden">
<div id="app-header" class="app-header">
<div id="appName" @click="clkapp">
<span @click=appclick><%=app.name%> </span>
<span style="font-size:16px;color:white" v-if="tocomany">
<span style="font-size:20px" class="fa fa-home"></span>
<span v-if=" currentUser && currentUser.owner.id!=1">{{currentUser.owner.name}}</span>
<span v-else>{{tocomany.name}}</span>
</span>
</div>
<div id="login">
<span v-if="currentUser">欢迎您,{{currentUser.nickName}}<el-button @click="exitclick" type="text" icon="el-icon-setting">退出</el-button></span>
</div>
</div>
<div id="app-stage" class="app-stage">
<div v-if="ismenuopen" id="clkhandle" @click="showmenu" class="el-icon-menu" style="position: relative;left:240px;margin-top:3px;cursor: pointer;"></div>
<div v-else id="clkhandle" @click="showmenu" class="el-icon-menu" style="position: relative;left:240px;margin-top:3px;cursor: pointer;"></div>
<div class="leftnav" id="leftmenuid">
<el-card id="leftnav">
<gsb-leftmenu bkcolor="white" ref="leftmenu" key="leftmenu" formatprop="formatItem" @menuselect="onMenuSelect"></gsb-leftmenu>
</el-card>
</div>
<div class="rightcontent">
<transition name="slide-fade">
<router-view>
</router-view>
</transition>
</div>
</div>
</div>
<script src="/js/vue/jquery.min.js"></script>
<script src="/js/common.js"></script>
<script src="/js/admin.js"></script>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta name="keywords" content="PAAS 开放平台">
<meta name="viewport" content="width=device-width, initial-scale=0.8, maximum-scale=0.8, user-scalable=1">
<title id="idtitle">个体宝</title>
<link rel="stylesheet" href="/css/ele/index_2.5.4.css">
<link rel="stylesheet" href="/css/pagecom.css">
<link rel="stylesheet" href="/css/fontawesome/css/font-awesome.min.css">
<link rel="stylesheet" href="/css/fontawesome/css/toolicon-style.css">
<link rel="stylesheet" href="/css/fontface-timely.css">
<script src="/js/vue/vue.min_2.6.10.js"></script>
<script src="/js/vue/vue-router.min.js"></script>
<script src="/js/vue/vuex.min.js"></script>
<script src="/js/ele/index_2.5.4.js"></script>
<script src="/js/vue/axios.min.js"></script>
<script>
//缓存当前域名对应的公司信息,公司、页脚、银行账号---全局变量
var appinfo = JSON.parse(unescape('<%=appinfo%>'));
//缓存当前的基础组件列表
var companyinfo= JSON.parse(unescape('<%=company%>'));
if(companyinfo.status && companyinfo.status==-1){
companyinfo=null;
}
var tocompanyinfo= JSON.parse(unescape('<%=tocompany%>'));
if(tocompanyinfo.status && tocompanyinfo.status==-1){
tocompanyinfo=null;
}
</script>
<style>
html {
width: 100%;
height: 100%;
}
body{
width: 100%;
height: 100%;
margin: 0px;
padding: 0px;
font-size: 14px;
}
.app-main{
width:100%;
height:100%;
/* background:url("<%='/imgs/bklogin.png'%>") no-repeat;background-size: cover; */
box-sizing: border-box;
}
.app-stage{
width: 100%;
height: 100%;
box-sizing: border-box;
}
</style>
</head>
<body>
<div id="app" v-loading="loading" class="app-main">
<div id="app-stage" class="app-stage">
<router-view></router-view>
</div>
</div>
<script src="/js/vue/jquery.min.js"></script>
<script src="/js/common.js"></script>
<script src="/js/gtb.js"></script>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta name="keywords" content="PAAS 开放平台">
<meta name="viewport" content="width=device-width, initial-scale=0.8, maximum-scale=0.8, user-scalable=1">
<title id="idtitle"><%=app.name%></title>
<link rel="stylesheet" href="/css/ele/index_2.5.4.css">
<link rel="stylesheet" href="/css/pagecom.css">
<link rel="stylesheet" href="/css/fontawesome/css/font-awesome.min.css">
<link rel="stylesheet" href="/css/fontawesome/css/toolicon-style.css">
<link rel="stylesheet" href="/css/fontface-timely.css">
<script src="/js/vue/vue.min_2.6.10.js"></script>
<script src="/js/vue/vue-router.min.js"></script>
<script src="/js/vue/vuex.min.js"></script>
<script src="/js/ele/index_2.5.4.js"></script>
<script src="/js/vue/axios.min.js"></script>
<script>
//缓存当前域名对应的公司信息,公司、页脚、银行账号---全局变量
var appinfo = JSON.parse(unescape('<%=appinfo%>'));
//缓存当前的基础组件列表
var companyinfo= JSON.parse(unescape('<%=company%>'));
if(companyinfo.status && companyinfo.status==-1){
companyinfo=null;
}
var tocompanyinfo= JSON.parse(unescape('<%=tocompany%>'));
if(tocompanyinfo.status && tocompanyinfo.status==-1){
tocompanyinfo=null;
}
</script>
<style>
body{
margin: 0px;
padding: 0px;
font-size: 14px;
}
.app-main{
width:100%;
height:100%;
background:url("<%=app.bkimageUrl?app.bkimageUrl:'/imgs/pt3.jpg'%>") no-repeat;background-size: cover;
box-sizing: border-box;
}
.app-header{
display: flex;
justify-content:space-between;
color: white;
padding: 15px;
box-sizing: border-box;
}
.app-stage{
display: flex;
width: 100%;
padding: 5px;
box-sizing: border-box;
}
.app-stage .rightcontent{
flex-grow:1;
box-sizing: border-box;
}
.app-stage .rightcontent .el-card__body {
height: 100%;
}
.app-stage .rightcontent >.el-card{
border-radius: 0px;
height: 100%;
box-shadow:unset;
box-sizing: border-box;
}
#appName{
font-size: 30px;
font-family:MicrosoftYaHei;
cursor: pointer;
}
.el-button--text{
color: white
}
.activeColor{
color:deepskyblue;
}
</style>
</head>
<body>
<div id="app" v-loading="loading" class="app-main" style="visibility:hidden">
<div id="app-header" class="app-header">
<div id="appName" >
<span @click=appclick><%=app.name%> </span>
<span style="font-size:16px;" v-if="currentCompany">
<span style="font-size:20px" class="fa fa-home"></span>
<span v-if="currentUser && currentUser.owner && currentUser.owner.id!=1">{{currentUser.owner.name}}</span>
<!-- <span v-else>{{currentCompany.name}}</span> -->
</span>
</div>
<div id="login">
<gsb-button-group v-if="!currentUser" @select="onselect" ikey="login" :btns="logins"></gsb-button-group>
<span v-if="currentUser">欢迎您,{{currentUser.nickName}}<el-button @click="exitclick" type="text" icon="el-icon-setting">退出</el-button></span>
<span style="cursor:pointer" @click="settingclick" v-if="(currentUser && currentUser.roles.indexOf('common')>=0) || (currentUser && currentUser.isSuper)"><i class="el-icon-setting"></i>后台管理</span>
</div>
</div>
<div id="app-stage" class="app-stage">
<div class="rightcontent">
<transition name="slide-fade">
<router-view>
</router-view>
</transition>
</div>
</div>
</div>
<script src="/js/vue/jquery.min.js"></script>
<script src="/js/common.js"></script>
<script src="/js/index.js"></script>
</body>
</html>
\ No newline at end of file
.autumn-main-nav-item,.autumn-search .el-input-group__append,.autumn-search-text{font-family:MicrosoftYaHei;font-weight:400}.autumn-img1,.autumn-img2,.autumn-img3,.autumn-search{text-align:center}.serviceSmall li,.serviceSmallName{list-style:none;box-sizing:border-box}.autumn-main-content,.autumn-main-top-item,.autumn-two-main-left,.autumn-two-right,.content-item-shade,.serviceSmall li,.serviceSmallName,.spring_daohang{box-sizing:border-box}.autumn{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.autumn-search{width:1200px;height:173px;margin:0 auto;line-height:173px;z-index:99}.autumn-search-text{display:inline-block;margin-right:42px;font-size:30px;color:rgba(252,86,52,1)}.autumn-search-input{width:788px;height:54px;background:rgba(255,255,255,1);border:2px solid rgba(253,98,40,1)}.autumn-search .el-input__inner{width:631px;line-height:54px;height:54px;border:none;border-radius:0}.autumn-search .el-input-group__append{width:157px;background:#FC5634;font-size:16px;color:rgba(255,255,255,1);border:none;border-radius:0}.autumn-main-top{width:100%;height:264px;padding:20px 0}.autumn-main-top-item{float:left;width:25%;height:100%;padding:10px;cursor:pointer}.autumn-main-top-item:hover{opacity:.8}.autumn-main-top-item>img{width:100%;height:100%}.autumn-main-nav{margin:25px 10px;width:100%;height:42px;border-left:1px solid rgba(229,59,24,1)}.autumn-main-nav-item{float:left;width:125px;height:40px;line-height:40px;border:1px solid rgba(229,59,24,1);border-left:none;font-size:14px;color:rgba(252,86,52,1);text-align:center;cursor:pointer}.autumn-main-content{margin:22px 0;width:100%;max-height:670px;padding:0 10px}.autumn-main-content-item{display:inline-block;width:231px;height:164px;background-color:#f4a460;position:relative;cursor:pointer}.autumn-main-content-item>img,.content-item-shade{height:100%;width:100%}.content-item-shade{position:absolute;top:0;font-size:18px;background-color:rgba(0,0,0,.6);color:#fff;padding:20px 40px;opacity:0;transition:opacity .5s;-moz-transition:opacity .5s;-webkit-transition:opacity .5s;-o-transition:opacity .5s}.content-item-shade>div{width:100%;line-height:40px;height:40px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.autumn-main-content-item:hover .content-item-shade{opacity:1}.autumn-img1{width:100%;height:693px;background:url(/imgs/autumn/bj1.png);background-size:100% 100%}.autumn-img2{width:100%;height:662px;background:url(/imgs/autumn/bj2.png);background-size:100% 100%}.autumn-img3{width:100%;height:616px;background:url(/imgs/autumn/bj3.png);background-size:100% 100%}.autumn-bj>img{margin-top:99px}.autumn-two{position:absolute;top:83px;width:100%;height:400px;z-index:999}.autumn-two-main{width:1200px;height:100%;margin:0 auto}.autumn-two-main-left{float:left;width:200px;height:100%;background:rgba(0,0,0,.5);border-radius:3px;-webkit-border-radius:3px}.autumn-two-left-item,.autumn-two-left-item-cla{width:100%;height:50px;line-height:50px;font-size:14px;cursor:pointer}.autumn-two-left-item{text-align:left;color:rgba(255,255,255,.7)}.autumn-two-left-item:last-child{text-align:center;background:#fc5634;color:#fff}.autumn-two-left-item-cla{text-align:left;background-color:#FFF;color:#FD6228}.autumn-two-left-item-span{display:block;width:60%;height:100%;margin:0 auto}.autumn-two-right{width:1000px;height:100%;overflow-y:auto;float:right;background-color:#fff;text-align:left;cursor:default}.colorPieceModel,.serviceSmallName{border-radius:8px;text-align:center;float:left}.autumn-tow-right-it,.autumn-tow-right-title{cursor:pointer;font-size:14px;font-family:PingFangSC-Regular;overflow:hidden}.autumn-tow-right-title{width:100%;padding-left:11px;line-height:36px;color:rgba(56,64,75,1);font-weight:700}.autumn-tow-right-lists{float:left;width:100%;height:100%}.autumn-tow-right-it{float:left;line-height:30px;font-weight:400;color:#666;position:relative;padding:0 11px}.autumn-tow-right-it:after{content:'';position:absolute;width:1px;height:10px;background-color:#a4a4a4;top:10px;right:0}.autumn-tow-right-it:last-child{position:static}.autumn-tow-right-it:hover{color:#FD6228}.colorPieceModel{width:220px;height:460px;color:#fff;font-size:32px;font-family:JZhongYi;overflow:hidden}.moreservice-spring-left-button,.moreservice-spring-right-button{top:45%;font-size:36px;color:rgba(210,214,218,1);z-index:9999;cursor:pointer;position:absolute}.moreservice-spring-right-button{right:0}.moreservice-spring-left-button{left:0}#ip-button:hover{color:#6592F7}#ic-button:hover{color:#A78CEE}#pa-button:hover{color:#EB9E55}.serviceSmall{float:left;width:77%;padding-left:0;margin-bottom:0}.serviceSmall li{width:32%;height:121px;padding:15px;float:left;background-color:#fff;border-radius:8px;margin-left:8px;margin-bottom:8px;transition:box-shadow .2s,margin-top .2s;-webkit-transition:box-shadow .2s,margin-top .2s}#ip li:hover{cursor:pointer;box-shadow:2px 2px 8px #6592F7;margin-top:-2px}#ic li:hover{cursor:pointer;box-shadow:2px 2px 8px #A78CEE;margin-top:-2px}#pa li:hover{cursor:pointer;box-shadow:2px 2px 8px #EB9E55;margin-top:-2px}#LX201906101755oFppND li:hover{cursor:pointer;box-shadow:2px 2px 8px #4081f7;margin-top:-2px}#LX201906111013bmwgjj li:hover{cursor:pointer;box-shadow:2px 2px 8px #ec927f;margin-top:-2px}.serviceSmall h5{color:#38404b;font-size:16px;margin:0 auto}.serviceSmall p{height:35px;color:#828282;font-size:12px;line-height:18px;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}.serviceSmall li span{color:#FF394D;font-size:16px}.serviceSmallName{padding:12px;margin-left:44px;margin-top:15px;width:130px;height:121px;color:#fff;font-size:14px}.serviceSmallImg{height:auto;margin:0 auto 5px;display:block}.spring_daohang{position:absolute;bottom:10px;left:0;width:950px;height:10px;float:left;padding-right:50px}.spring_daohang_list,.spring_daohang_list_xz{width:10px;height:10px;border-radius:50%;float:right;margin-left:15px;cursor:pointer}.spring_daohang_list{opacity:.5}.spring_daohang_list_xz{opacity:1}
\ No newline at end of file
/* * {
margin: 0;
padding: 0;
} */
.cut {
width: 400px;
height: 400px;
margin: 30px auto;
}
.c-item {
max-width: 600px;
margin: 10px auto;
margin-top: 20px;
}
.content {
margin: auto;
max-width: 1200px;
margin-bottom: 100px;
}
.test-button {
display: flex;
flex-wrap: wrap;
align-content: center;
justify-content: center;
}
.btn {
display: inline-block;
line-height: 1;
white-space: nowrap;
cursor: pointer;
background: #fff;
border: 1px solid #c0ccda;
color: #1f2d3d;
text-align: center;
box-sizing: border-box;
outline: none;
margin:20px 10px 0px 0px;
padding: 9px 15px;
font-size: 14px;
border-radius: 4px;
color: #fff;
background-color: #50bfff;
border-color: #50bfff;
transition: all .2s ease;
text-decoration: none;
user-select: none;
}
.des {
line-height: 30px;
}
code.language-html {
padding: 10px 20px;
margin: 10px 0px;
display: block;
background-color: #333;
color: #fff;
overflow-x: auto;
font-family: Consolas, Monaco, Droid, Sans, Mono, Source, Code, Pro, Menlo, Lucida, Sans, Type, Writer, Ubuntu, Mono;
border-radius: 5px;
white-space: pre;
}
.show-info {
margin-bottom: 50px;
}
.show-info h2 {
line-height: 50px;
}
/*.title, .title:hover, .title-focus, .title:visited {
color: black;
}*/
.cropper_title {
display: block;
text-decoration: none;
text-align: center;
line-height: 1.5;
margin: 20px 0px;
background-image: -webkit-linear-gradient(left,#3498db,#f47920 10%,#d71345 20%,#f7acbc 30%,#ffd400 40%,#3498db 50%,#f47920 60%,#d71345 70%,#f7acbc 80%,#ffd400 90%,#3498db);
color: transparent;
-webkit-background-clip: text;
background-size: 200% 100%;
animation: slide 5s infinite linear;
font-size: 40px;
}
.test {
height: 500px;
}
.model {
position: fixed;
z-index: 10;
width: 100vw;
height: 100vh;
overflow: auto;
top: 0;
left: 0;
background: rgba(0, 0, 0, 0.8);
}
.model-show {
display: flex;
justify-content: center;
align-items: center;
width: 100vw;
height: 100vh;
}
.model img {
display: block;
margin: auto;
max-width: 80%;
user-select: none;
background-position: 0px 0px, 10px 10px;
background-size: 20px 20px;
background-image: linear-gradient(45deg, #eee 25%, transparent 25%, transparent 75%, #eee 75%, #eee 100%),linear-gradient(45deg, #eee 25%, white 25%, white 75%, #eee 75%, #eee 100%);
}
.c-item {
display: block;
user-select: none;
}
@keyframes slide {
0% {
background-position: 0 0;
}
100% {
background-position: -100% 0;
}
}
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.
@font-face {
font-family: 'toolicon';
src: url('../fonts/toolicon.eot?247j9t');
src: url('../fonts/toolicon.eot?247j9t#iefix') format('embedded-opentype'),
url('../fonts/toolicon.ttf?247j9t') format('truetype'),
url('../fonts/toolicon.woff?247j9t') format('woff'),
url('../fonts/toolicon.svg?247j9t#toolicon') format('svg');
font-weight: normal;
font-style: normal;
}
[class^="tool-"], [class*=" tool-"] {
/* use !important to prevent issues with browser extensions that change fonts */
font-family: 'toolicon' !important;
speak: none;
font-style: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
line-height: 1;
/* Better Font Rendering =========== */
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.tool-reset:before {
content: "\e911";
}
.tool-look1:before {
content: "\e912";
}
.tool-upload:before {
content: "\e913";
}
.tool-Order1:before {
content: "\e90d";
}
.tool-add:before {
content: "\e90e";
}
.tool-copy1:before {
content: "\e90f";
}
.tool-order1:before {
content: "\e910";
}
.tool-ID-card:before {
content: "\e906";
}
.tool-scanning:before {
content: "\e907";
}
.tool-scanning1:before {
content: "\e908";
}
.tool-bg_icon_Transformation:before {
content: "\e909";
}
.tool-search:before {
content: "\e90a";
}
.tool-query:before {
content: "\e90b";
}
.tool-summary:before {
content: "\e90c";
}
.tool-cash:before {
content: "\e900";
}
.tool-invoice:before {
content: "\e901";
}
.tool-trademark-1:before {
content: "\e902";
}
.tool-eglass-data:before {
content: "\e903";
}
.tool-order:before {
content: "\e904";
}
.tool-paper-report:before {
content: "\e905";
}
This source diff could not be displayed because it is too large. You can view the blob instead.
@font-face {
font-family: 'iconfont'; /* project id 895180 */
src: url('//at.alicdn.com/t/font_895180_1yuim2ryomg.eot');
src: url('//at.alicdn.com/t/font_895180_1yuim2ryomg.eot?#iefix') format('embedded-opentype'),
url('//at.alicdn.com/t/font_895180_1yuim2ryomg.woff2') format('woff2'),
url('//at.alicdn.com/t/font_895180_1yuim2ryomg.woff') format('woff'),
url('//at.alicdn.com/t/font_895180_1yuim2ryomg.ttf') format('truetype'),
url('//at.alicdn.com/t/font_895180_1yuim2ryomg.svg#iconfont') format('svg');
}
.iconfont {
font-family: "iconfont" !important;
font-size: 16px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-webkit-text-stroke-width: 0.2px;
-moz-osx-font-smoothing: grayscale;
}
div, ul, li {
margin: 0;
padding: 0;
}
ul, li {
list-style: none outside none;
}
/* layer begin */
.ios-select-widget-box.olay {
position: fixed;
z-index: 500;
top: 0;
left: 0;
width: 100%;
height: 100%;
opacity: 1;
background: rgba(0, 0, 0, 0.75);
}
.ios-select-widget-box.olay > div {
position: fixed;
z-index: 1000;
width: 100%;
height: 100%;
background-color: #f2f2f2;
bottom: 0;
left: 0;
visibility: visible;
}
.ios-select-widget-box header.iosselect-header {
height: 44px;
line-height: 44px;
background-color: #eee;
width: 100%;
z-index: 9999;
text-align: center;
}
.ios-select-widget-box header.iosselect-header a {
font-size: 16px;
color: #e94643;
text-decoration: none;
}
.ios-select-widget-box header.iosselect-header a.close {
float: left;
padding-left: 15px;
height: 44px;
line-height: 44px;
}
.ios-select-widget-box header.iosselect-header a.sure {
float: right;
padding-right: 15px;
height: 44px;
line-height: 44px;
}
.ios-select-widget-box {
padding-top: 44px;
}
.ios-select-widget-box .one-level-contain,
.ios-select-widget-box .two-level-contain,
.ios-select-widget-box .three-level-contain,
.ios-select-widget-box .four-level-contain,
.ios-select-widget-box .five-level-contain {
height: 100%;
overflow: hidden;
}
.ios-select-widget-box .iosselect-box {
overflow: hidden;
}
.ios-select-widget-box .iosselect-box > div {
display: block;
float: left;
}
.ios-select-widget-box ul {
background-color: #fff;
}
.ios-select-widget-box ul li {
font-size: 13px;
height: 35px;
line-height: 35px;
background-color: #fff;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
text-align: center;
color: #111;
opacity: .3;
}
.ios-select-widget-box ul li.at {
font-size: 16px;
opacity: 1;
}
.ios-select-widget-box ul li.side1 {
font-size: 15px;
opacity: .7;
}
.ios-select-widget-box ul li.side2 {
font-size: 14px;
opacity: .5;
}
.ios-select-widget-box.one-level-box .one-level-contain {
width: 100%;
}
.ios-select-widget-box.one-level-box .two-level-contain,
.ios-select-widget-box.one-level-box .three-level-contain,
.ios-select-widget-box.one-level-box .four-level-contain,
.ios-select-widget-box.one-level-box .five-level-contain,
.ios-select-widget-box.one-level-box .six-level-contain {
width: 0;
}
.ios-select-widget-box.two-level-box .one-level-contain,
.ios-select-widget-box.two-level-box .two-level-contain {
width: 50%;
}
.ios-select-widget-box.two-level-box .three-level-contain,
.ios-select-widget-box.two-level-box .four-level-contain,
.ios-select-widget-box.two-level-box .five-level-contain,
.ios-select-widget-box.two-level-box .six-level-contain {
width: 0;
}
.ios-select-widget-box.three-level-box .one-level-contain,
.ios-select-widget-box.three-level-box .two-level-contain {
width: 30%;
}
.ios-select-widget-box.three-level-box .three-level-contain {
width: 40%;
}
.ios-select-widget-box.three-level-box .four-level-contain
.ios-select-widget-box.three-level-box .five-level-contain,
.ios-select-widget-box.three-level-box .six-level-contain {
width: 0%;
}
.ios-select-widget-box.four-level-box .one-level-contain,
.ios-select-widget-box.four-level-box .two-level-contain,
.ios-select-widget-box.four-level-box .three-level-contain,
.ios-select-widget-box.four-level-box .four-level-contain {
width: 25%;
}
.ios-select-widget-box.four-level-box .five-level-contain,
.ios-select-widget-box.four-level-box .six-level-contain {
width: 0%;
}
.ios-select-widget-box.five-level-box .one-level-contain,
.ios-select-widget-box.five-level-box .two-level-contain,
.ios-select-widget-box.five-level-box .three-level-contain,
.ios-select-widget-box.five-level-box .four-level-contain,
.ios-select-widget-box.five-level-box .five-level-contain {
width: 20%;
}
.ios-select-widget-box.five-level-box .six-level-contain {
width: 0%;
}
.ios-select-widget-box.six-level-box .one-level-contain,
.ios-select-widget-box.six-level-box .two-level-contain,
.ios-select-widget-box.six-level-box .three-level-contain,
.ios-select-widget-box.six-level-box .four-level-contain,
.ios-select-widget-box.six-level-box .five-level-contain {
width: 16%;
}
.ios-select-widget-box.six-level-box .six-level-contain {
width: 20%;
}
.ios-select-widget-box .cover-area1 {
width: 100%;
border: none;
border-top: 1px solid #d9d9d9;
position: absolute;
top: 149px;
margin: 0;
height: 0;
}
.ios-select-widget-box .cover-area2 {
width: 100%;
border: none;
border-top: 1px solid #d9d9d9;
position: absolute;
top: 183px;
margin: 0;
height: 0;
}
.ios-select-widget-box #iosSelectTitle {
margin: 0;
padding: 0;
display: inline-block;
font-size: 16px;
font-weight: normal;
color: #333;
}
.ios-select-body-class {
overflow: hidden;
}
.ios-select-body-class body {
touch-action: none;
}
.ios-select-widget-box.olay > div > .ios-select-loading-box {
width: 100%;
height: 100%;
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
background-color: rgba(0,0,0,.5);
display: none;
}
.ios-select-widget-box.olay > div > .ios-select-loading-box > .ios-select-loading {
width: 50px;
height: 50px;
position: absolute;
left: 50%;
top: 50%;
margin-top: -25px;
margin-left: -25px;
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyFpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDE0IDc5LjE1MTQ4MSwgMjAxMy8wMy8xMy0xMjowOToxNSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChXaW5kb3dzKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDo1OEMxMEI3NDI3MEIxMUU2ODVGMzhFNjYyMDIyOUFCMCIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDo1OEMxMEI3NTI3MEIxMUU2ODVGMzhFNjYyMDIyOUFCMCI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjU4QzEwQjcyMjcwQjExRTY4NUYzOEU2NjIwMjI5QUIwIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjU4QzEwQjczMjcwQjExRTY4NUYzOEU2NjIwMjI5QUIwIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+GeWqMwAAA+BJREFUeNrMmVlsTGEUx+9cXZQiLZWKklhbQSSlSMUWSxAiJGJ5aSQehOiDF7yI4EFILW99I3iRSJGUPkiILSKp2OuJVtHWkrRVapn2jv+R/ycnn5l27rQz10l+mWlyl/+c833nO+c0FIlEnATMBbPAIn5OBuPAENAKToC74BtoB59AG/D9spBPgaPBdrAFjJH7Fa66TkRuNe8gP8Bb8Ap8j/eFaXFelwv286WZfKG2WL9SX5cFCuntBvAc/OoPD64HJ8EI5Q3tmW7whl4pAl/AUfAEDKZnQ1HuFXGPQGOiAsW7x8A26wUhirgMLnGtfe3hGcO5NApARpRnSchrY0UhlkAJxxmw0npYBzgOKinSj6WDCfRyphWFJnAPdMUjUH71WbDKElcDykGL0zcbCEroVf389+CW7Uk3ygNk/azghYIHDoCN/SDO4W6+A55aAiUrzImWz7StA2WWuF2gIpEc1ovVgQeWyELm06gCc8ARJU44DM45yTPZII8tkXO5DP4RuI8iPYqr4YmQbJN8+E4JlA1abAuUBbtZeU526O4khDWW3QdhK9TZWmAZd6/x3inw0UmdSZJ/pgSKlilGoMvTwoiTw/20k3p7yTyovRgScTNAvgrvFSbkVJuE+LU6GiXEefJHqfKefF5zgrMGVRnJZ4HEerryXjdzU1DWbB2BI10mRuPBej+1WhKsi8vLeDDXZRllwtvoBG8davNmS4gHUZyTQIWSrM1iQpyZptafo4QGabp9+JNmOijMY9MTtGWpEHe5PDHMGsz/DwQOUwI7XVYUZheP1ZVEAJbOFsGswTYR+EKF2NWVRABWwHPYeLDFZWKOKJFLAhRYpMQJjS7rsWYlcjlTT6pNOr5pahfL5m12KaparUPpZTcEILCEjjGniCy9iMk3F9hImzCXcZqQKhOnLFShjbBX/psQP4Aq5UUpdfZEGXEkKzGvZf4zu/exOdV0T1LJCZTx4gK2msm2Uq494z1pS29Ea5ra2RPrrm4HpwvJsplgtTW/kXq0M1ZffF2F2uMNe+nJUD+HVWaLm8AAtXNrOXTqcfQh2fwQmKdST4TTgAp6ui+WTWFTrUpedu15Fs29Do/kuDsIZlsiW7njryZQ2MrAaD5Yqko88+w6zoPCfsdv5VwjnnXayA67zYmUdGM/e0i+E7nWivnDPUWEz6iyPedngLkY7ARDrQeb72GOz5roVY/eylMHvxflXjkpLoKHfZ2wmhJIkvcylUi9BAnTa9U9DD59CzQm/csaZv0cn0JbOeK4ye/xbfcE/w0hYZvElnU8GEXBGRQjeewzi5B6rtP6RGY9vwUYACMHTam1T1ebAAAAAElFTkSuQmCC) no-repeat 0 0;
background-size: contain;
-webkit-animation: loading-keyframe 1s infinite linear;
animation: loading-keyframe 1s infinite linear;
}
.fadeInUp .layer{
-webkit-animation: fadeInUp .5s;
animation: fadeInUp .5s;
}
.fadeOutDown .layer{
-webkit-animation: fadeOutDown .5s!important;
animation: fadeOutDown .5s!important;
}
@-webkit-keyframes loading-keyframe {
from {
-webkit-transform: rotate(0deg);
}
to {
-webkit-transform: rotate(360deg);
}
}
@keyframes loading-keyframe {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
@-webkit-keyframes fadeInUp {
from {
opacity: 0;
-webkit-transform: translate3d(0,100%,0);
}
to {
opacity: 1;
-webkit-transform: none;
}
}
@keyframes fadeInUp {
from {
opacity: 0;
transform: translate3d(0,100%,0);
}
to {
opacity: 1;
transform: none;
}
}
@-webkit-keyframes fadeOutDown {
from {
opacity: 1;
}
to {
opacity: 0;
-webkit-transform: translate3d(0, 100%, 0);
}
}
@keyframes fadeOutDown {
from {
opacity: 1;
}
to {
opacity: 0;
transform: translate3d(0, 100%, 0);
}
}
var tmpl=`
<el-button v-if="!isLogin" :type="type" ><a :href="opath" style=" text-decoration:none; "><slot>OAUTH授权登录</slot></a></el-button>
`
module.exports=
`{
template:'${tmpl}',
props:['type'],
data:function(){
return {
isLogin:false,
opath:"",
};
},
mounted:function(){
this.$nextTick(()=>{
this.checkLogin();
});
},
created:function(){
},
methods:{
checkLogin(){
var self=this;
this.$root.getReq("/web/userCtl/checkLogin",{}).then(function(d){
/*检查之前先缓存请求字符串*/
var q=self.$router.history.current.query;
if(q && q.from){
localStorage.setItem("query",JSON.stringify(q));
}
console.log("qqqqqqqqqqqqqqqqqqqqqqqqqqqqq");
console.log(q);
console.log(localStorage);
if(d && d.status==0){
self.$store.state.currentUser=d.data;
self.isLogin=true;
var qtmp=localStorage.getItem("query");
if(qtmp!=""){
qtmp=JSON.parse(qtmp);
}else{
qtmp=null;
}
self.$emit("logined",qtmp);
}else{
self.$store.state.currentUser=null;
self.isLogin=false;
}
}).then(()=>{
if(!self.isLogin){
self.fetchOAuthPath();
}
});
},
fetchOAuthPath(){
var self =this;
this.$root.postReq("/web/wxCtl/fetchOAuthPath",{}).then(function(d){
if(d && d.status==0){
self.opath=d.data;
console.log("11111111111111111111111111111111111111111111");
console.log(self.opath);
}
});
},
},
vname:"gsb-wxoauth"
}`
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