Commit 14cc0b09 by 宋毅

tj

parent 92e884f6
......@@ -6,6 +6,7 @@ var glob = require("glob");
class DbFactory{
constructor(){
const dbConfig=settings.database();
const dbConfighb=settings.databasehb();
this.db=new Sequelize(dbConfig.dbname,
dbConfig.user,
dbConfig.password,
......@@ -18,6 +19,8 @@ class DbFactory{
async initModels(){
var self=this;
var modelpath=path.normalize(path.join(__dirname, '../..'))+"/models/";
console.log("modelpath=====================================================");
console.log(modelpath);
var models=glob.sync(modelpath+"/**/*.js");
console.log(models.length);
models.forEach(function(m){
......@@ -74,6 +77,12 @@ class DbFactory{
}
return this.db;
}
getConhb(){
var that=this;
if(settings.env=="dev"){
}
return this.dbhb;
}
}
module.exports=DbFactory;
// const dbf=new DbFactory();
......
var childproc = require('child_process');
const util = require('util');
const exec = util.promisify(require('child_process').exec);
const uuidv4 = require('uuid/v4');
class ExecClient {
constructor() {
this.cmdPostPattern = "curl -k -H 'Content-type: application/json' -d '{data}' {url}";
this.cmdGetPattern = "curl -G -X GET '{url}'";
this.cmdPostTK = "curl -k -H 'Content-type: application/json' -H 'token:{tk}' -H 'request-id:{requestId}' -d '{data}' {url}";
}
getUUID() {
var uuid = uuidv4();
var u = uuid.replace(/\-/g, "");
return u;
}
async execPostTK(subData, url, token) {
let cmd = this.FetchPostTK(subData, url, token);
var result = await this.exec(cmd, {
maxBuffer: 1024 * 1024 * 15
});
var rtn = result.stdout;
if (rtn) {
return JSON.parse(rtn);
} else {
return null;
}
}
FetchPostTK(subData, url, token) {
var data = JSON.stringify(subData);
var requestId = this.getUUID();
var cmd = this.cmdPostTK.replace(/\{data\}/g,
data).replace(/\{url\}/g, url).replace(/\{tk\}/g, token).replace(/\{requestId\}/g, requestId);
return cmd;
}
async exec(cmd) {
//await后面表达式返回的promise对象,是then的语法糖,await返回then函数的返回值
//异常需要try/catch自己捕获或外部catch捕获
const {stdout, stderr} = await exec(cmd);
return {stdout, stderr};
const { stdout, stderr } = await exec(cmd);
return { stdout, stderr };
}
async exec2(cmd) {
return exec(cmd, {encoding: "base64"});
return exec(cmd, { encoding: "base64" });
}
FetchPostCmd(subData, url) {
......@@ -66,8 +90,8 @@ class ExecClient {
var options = {
timeout: timeOut,
};
const {stdout, stderr} = await exec(cmd, options);
return {stdout, stderr};
const { stdout, stderr } = await exec(cmd, options);
return { stdout, stderr };
}
}
......
var url = require("url");
var System = require("../../base/system");
var metaCtl=System.getObject("web.common.metaCtl");
var userCtl=System.getObject("web.auth.userCtl");
var metaCtl = System.getObject("web.common.metaCtl");
var tmqueryCtl = System.getObject("web.trademark.tmqueryCtl");
module.exports = function (app) {
app.get("/auth",async function(req,res){
await userCtl.authByCode(req);
res.redirect("/");
app.get("/1688/proxy", async function (req, res) {
var params = {
actionProcess: "1688",
requrl: "/action/tmOrder/springBoard",
actionType: "getChannelOrderInfo",
actionBody: req.query
};
if (params.actionBody.sign) {
params.sign = params.actionBody.sign;
delete params.actionBody["sign"];
}
var result = await tmqueryCtl.doPost(params, null, req);
if (result.status != 0) {
res.end(JSON.stringify(result));
return;
}
var skipUrl = result.skipUrl + "?itemCode=" + result.itemCode + "&channelUser=" + JSON.stringify(result.data.channelUser) + "&channelOrder=" + JSON.stringify(result.data.channelOrder) + "&channelParams=" + result.channelParams;
res.redirect(skipUrl);
});
app.get("/",async function(req,res){
app.get("/", async function (req, res) {
console.log(req.hostname);
var appinfo=await metaCtl.getAppInfo(req);
if(!appinfo){
res.render("index",{appinfo:null,app:null});
}else{
res.render("index",appinfo);
var appinfo = await metaCtl.getAppInfo(req);
if (!appinfo) {
res.render("index", { appinfo: null, app: null });
} else {
res.render("index", appinfo);
}
});
app.get("/admin",async function(req,res){
var appinfo=await metaCtl.getAppInfo(req);
res.render("admin",appinfo);
app.get("/admin", async function (req, res) {
var appinfo = await metaCtl.getAppInfo(req);
res.render("admin", appinfo);
});
app.get('/web/:gname/:qname/:method', function (req, res) {
var classPath = req.params["qname"];
var methodName = req.params["method"];
var gname=req.params["gname"];
classPath=gname+"."+classPath;
var methodName = req.params["method"];
var gname = req.params["gname"];
classPath = gname + "." + classPath;
var params = [];
params.push(methodName);
params.push(methodName);
params.push(req.body);
params.push(req.query);
params.push(req);
params.push(req.query);
params.push(req);
var p = null;
var invokeObj = System.getObject("web." + classPath);
if (invokeObj["doexec"]) {
......@@ -42,19 +58,19 @@ module.exports = function (app) {
});
app.post('/web/:gname/:qname/:method', function (req, res) {
var classPath = req.params["qname"];
var methodName = req.params["method"];
var gname=req.params["gname"];
var params = [];
classPath=gname+"."+classPath;
var methodName = req.params["method"];
var gname = req.params["gname"];
var params = [];
classPath = gname + "." + classPath;
var tClientIp = System.get_client_ip(req);
req.body.clientIp = tClientIp;
req.body.agent= req.headers["user-agent"];
req.body.classname=classPath;
req.body.agent = req.headers["user-agent"];
req.body.classname = classPath;
params.push(methodName);
params.push(req.query);
params.push(req.body);
params.push(req);
params.push(req.query);
params.push(req);
var p = null;
var invokeObj = System.getObject("web." + classPath);
if (invokeObj["doexec"]) {
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -74,7 +74,7 @@ axios.get("/web/common/metaCtl/getRouteConfig").then(d => {
});
router.beforeEach((to, from, next) => {
console.log(from,to,'~~~~~~~~~~~~~~~~~~~~~~');
console.log(from, to, '~~~~~~~~~~~~~~~~~~~~~~');
next();
});
Vue.use(window['vue-cropper']);
......@@ -85,13 +85,12 @@ axios.get("/web/common/metaCtl/getRouteConfig").then(d => {
data: function () {
return {
// 请求地址
host: `http://zcchannel.apps.com:3003`,
host: ``,
// 请求头携带参数
globelHeader: {},
// 通用接口参数
commonParams: {
"actionProcess": "jd",
"actionType": " subTmOrder ",
"actionProcess": "",
"sign": "2FviZ9PGws8Pt1fBhq0t90mjUvI",
"actionBody": {},
"actionType": "",
......@@ -156,7 +155,8 @@ axios.get("/web/common/metaCtl/getRouteConfig").then(d => {
themename: "",
showWxrm: false,
showPhoneNum: false,
rsData: []
rsData: [],
channelPath: ""
};
},
created() {
......@@ -181,17 +181,29 @@ axios.get("/web/common/metaCtl/getRouteConfig").then(d => {
this.checkLogin();
},
methods: {
// 返回当前接入渠道标识
getChannelPath() {
var from = this.$route.path;
var path = from.match(/\/(\S*)\//)[1];
this.$root.channelPath = path;
return path;
},
// 处理参数方法
copyParams(actionBody, actionType, url) {
let data = this.commonParams;
copyParams(actionBody, actionType, url, isUser = "no") {
var data = this.commonParams;
data.actionProcess = this.$root.getChannelPath()
data.actionType = actionType;
data.actionBody = actionBody || {};
data.requrl = this.host + url;
console.log(data, data.requrl,"1111111111111");
var newObj = Object.assign(data, {});
console.log(newObj, "xxxxxxxxxxxxxxxxxxx");
data.isUser = isUser;
let currentDate = Math.floor(new Date().getTime() / 1000);
data.actionBody.timestamp = currentDate;
var newObj = JSON.parse(JSON.stringify(data));
return newObj;
},
handleOpen(key, keyPath) {
console.log(key, keyPath);
},
......
......@@ -49,7 +49,8 @@
}
.jdindentdetail {
padding: 0 30px 30px;
padding: 30px 30px 30px;
background: #F9F9F9;
}
......@@ -348,14 +349,15 @@
text-align: center;
}
.jdindentdetail-main-official-img .license-uploader .el-upload {
.jdindentdetail-main-official-img .license-uploader {
border: 1px solid #d9d9d9;
cursor: pointer;
position: relative;
overflow: hidden;
margin-bottom: 3px;
}
.jdindentdetail-main-official-img .license-uploader .el-upload:hover {
.jdindentdetail-main-official-img .license-uploader:hover {
border-color: #409EFF;
}
......@@ -471,7 +473,6 @@
.jdindentdetail-diag .el-dialog__header {
text-align: center;
border-bottom: 1px solid #E8E8E8;
padding: 0;
font-size: 24px;
......
......@@ -106,7 +106,7 @@
}
.jdindentlist-inquire-form .el-input__inner {
width: 200px;
width: 175px;
height: 36px;
background: rgba(255, 255, 255, 1);
border-radius: 4px;
......@@ -122,7 +122,7 @@
}
.jdindentlist-list .el-table th>.cell {
text-align: center;
text-align: left;
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
......@@ -133,4 +133,15 @@
width: 100%;
text-align: center;
}
.jdindentlist-list .el-table .el-table_1_column_11{
padding-right: 21px;
}
.jdindentlist-null{
width: 34.57%;
height: 333px;
margin: 10.37% auto 0;
}
.jdindentlist-null>div:nth-child(1) img{
width: 100%;
height: 100%;
}
\ No newline at end of file
.jdregschemesubmit-footer {
text-align: center;
margin-top: 15px;
}
.jdregschemesubmit-footer-box button {
width: 208px;
height: 40px;
background: rgba(255, 255, 255, 1);
color: #0F8EE9;
border-radius: 0;
border: 1px solid rgba(15, 142, 233, 1);
}
.jdregschemesubmit-footer-box button:nth-child(2) {
background: rgba(15, 142, 233, 1);
}
.jdregschemesubmit-footer-box+div {
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: rgba(130, 130, 130, 1);
margin-top: 15px;
}
..jdregscheme-nav {
height: 70px;
box-sizing: border-box;
width: 100%;
margin: 0 auto;
width:261px;
height:22px;
font-size:16px;
font-weight:400;
padding: 10px 0;
;}
.jdregscheme-footer-main>div>div{
text-align: center;
}
.jdregscheme_border{
width:100%;
height:2px;
}
.jdregscheme_border,.dialog-footer,.el-dialog__title,.jdregscheme-footer-main>div>div{
display: block;
}
.dialog-footer{
width: 100%;
}
{
template: '${tmpl}',
data: function() {
var validateAddr = (rule, value, callback) => {
var x = /(([])|([][])|([][][][][][][])|([][][])|([][][])|([][][])|([][][])|([][][])|([广][西])|([][])|([][])|([西][])|([][][][][][])|([][][][][][][][])|([广][西][][][][][])|([][][][][][][])|([西][][][][]))/g.test(value);
if (!x) {
callback(new Error('请核对地址,必须写所在省份名称!'));
} else {
callback();
}
};
var mobileValidator = (rule, value, callback) => {
var x = /((\d{11})|^((\d{7,8})|(\d{4}|\d{3})-(\d{7,8})|(\d{4}|\d{3})-(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1})|(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1}))$)/g.test(value);
if (!x) {
callback(new Error('联系电话格式错误!'));
} else {
callback();
}
};
var emailValidator = (rule, value, callback) => {
var x = /^([a-zA-Z0-9._-])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-])+/.test(value);
if (!x) {
callback(new Error('电子邮箱格式错误!'));
} else {
callback();
}
};
var colorizedtm = (rule, value, callback) => {
if ((this.form.tmFormType == "7" || this.form.tmFormType == "6") && value == "") {
callback(new Error('请上传彩色商标图样'));
} else {
callback();
}
};
var validateIdCard = (rule, value, callback) => {
if (this.form.type == "person") {
if (value == "") {
callback(new Error('请输入身份证号码'));
} else {
var x = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test(value);
if (!x) {
callback(new Error('身份证格式错误'));
} else {
callback();
}
}
} else {
callback();
}
};
var validateSFZ = (rule, value, callback) => {
if (this.apply.customerType == "person" && value == "") {
callback(new Error('身份证明不能为空'));
} else {
callback();
}
};
var code = (rule, value, callback) => {
if (this.apply.customerType == "ent" && !this.apply.code) {
callback(new Error('请输入信用代码'));
} else {
callback();
}
};
return {
ldms: [],
form: {
tmFormType: 3,
name: "",
picUrl: "",
colorizedPicUrl: "",
selecttype: "自主选择",
totalPublicExpense: 0,
totalTaxes: 0,
totalSum: 0,
totalDiscounts: 0,
totalServiceCharge: 0,
totalProfitSum: 0,
remark: "",
sveItemRateConfig: "",
},
rules: {
name: [
{ required: true, message: '请输入商标名称' }
],
picUrl: [
{ required: true, message: '请上传商标图样' }
],
colorizedPicUrl: [
{ validator: colorizedtm, trigger: 'blur' }
],
tmFormType: [
{ required: true, message: '请选择商标类型' }
],
},
tm_form_type: { "1": "立体", "3": "文字图标", "4": "图形商标", "5": "图形及文字商标", "6": "颜色", "7": "彩色" },
nclOne: [],
apply: {
customerType: "ent",
name: "",
code: "",
identityCardNo: "",
applyAddr: "",
applyArea: "",
zipCode: "",
contacts: "",
mobile: "",
email: "",
tel: "",
fax: "",
businessLicensePic: "",
identityCardPic: "",
sealAuthorizeStuff: "",
descUrl: "",
notes: "",
centerDialogVisible: false
},
isRead: false,
nclOne: []
}
},
mounted: function() {
},
created: function() {
},
methods: {
submitForm(done){
this.apply.centerDialogVisible = true
},
AgreedForm(){
this.$router.push({ path: "/1688/jdindentdetail"});
}
},
vname: "gsb-jdregscheme"
}
<div>
asdad
</div>
\ No newline at end of file
{
template: '${tmpl}',
data: function() {
return {
ldms: [],
}
},
mounted: function() {
this.$root.getChannelPath()
},
created: function() {
},
methods: {
},
vname: "gsb-proxy"
}
......@@ -29,7 +29,7 @@
height: 34px !important;
line-height: 34px !important;
}
#selftmreg
#selftmreg .el-step__head.is-success {
color: #409EFF;
border-color: #409EFF;
......@@ -410,6 +410,7 @@
.upload-dialog {
width: 100%;
height: 100%;
text-align: center;
padding: 17px 0px;
position: absolute;
top: 0px;
......@@ -488,6 +489,7 @@
font-size: 16px;
margin: 20px 0px;
float: left;
text-align: center;
}
.pointsRule span {
......@@ -506,7 +508,7 @@
}
.pointsRule ul li {
width: 24%;
width: 32%;
display: list-item;
text-align: center;
float: left;
......
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