Commit 704b48ab authored by 何娜's avatar 何娜

测试回调

parent 954d0877
Pipeline #27714 passed with stage
in 1 minute 58 seconds
'use strict';
const Controller = require('egg').Controller;
// 渲染页面
class IndexController extends Controller {
constructor(ctx) {
super(ctx);
this.paramsRule = {
phone: {
type: 'string',
format: /^1\d{10}$/,
message: 'phone格式错误',
required: true,
},
orderId: {
type: 'string',
format: /^\w{8}(-\w{4}){3}-\w{12}$/,
message: 'orderId格式错误',
required: true,
},
appkey: {
type: 'string',
message: 'appkey格式错误',
required: true,
},
};
}
async index() {
const { ctx, app, service } = this;
try {
ctx.validate(this.paramsRule, ctx.query);
} catch (e) {
return ctx.render('Err', { message: '参数错误' });
}
const { appkey, orderId, phone, redirect } = ctx.query;
await service.schedules.appKeylist();
if (!ctx.app.appKeylists.get(appkey)) {
return ctx.render('Err', { message: '不存在appkey' });
}
const phoneInfo = await service.task.phoneArea(phone);
if (phoneInfo.province === '香港') {
phoneInfo.province = '广东';
}
await service.task.configs();
const phoneHtml = await service.index.getPhoneHtml(ctx.app.provMap.get(phoneInfo.province.replace(/省/, '')), phoneInfo, phone);
const data = ctx.app.cityMap.get(phoneInfo.province.replace(/省/, '') + phoneInfo.operator.substr(-2, 2));
if (data.state === 1) {
const InputVal = {
name: '',
ID: '',
password: '',
};
const formHtml = await service.index.getCityHtml(data.queryStepParam[0].loginParam, phoneInfo.operator, InputVal);
// ctx.cookie('orderId', orderId);
// ctx.cookie('appKey', appkey);
await app.redis.set(phone, JSON.stringify({ city: phoneInfo.province, operator: phoneInfo.operator }), 'EX', '300');
return ctx.render('mobileV2', {
title: '运营商认证',
phoneHtml,
formHtml,
phone,
protocol: '《信息授权查询委托书》',
State: 'init',
OrderNum: orderId,
TaskId: '',
redirectUrl: redirect,
appKey: appkey,
scriptId: Number(data.id),
});
} else {
return ctx.render('Err', { message: '暂不支持该运营商' });
}
}
async logs(){
const { ctx } = this;
ctx.success('0');
}
}
module.exports = IndexController;
......@@ -62,68 +62,6 @@ class OrderController extends Controller {
};
}
async create() {
const { ctx, service } = this;
// ctx.validate(this.createRule);
let { appKey, userId, notifyUrl, backUrl, orderId, phone, netMark } = ctx.request.body;
// const appKeyInfo = await service.partner.fetchInfo(appKey);
// if (!(appKeyInfo && appKeyInfo.valid === true && appKeyInfo.enableYys === true)) {
// return ctx.fail('未开通此服务');
// }
if (netMark !== 1) {
netMark = 0;
}
// const areaInfo = await service.task.phoneArea(phone);
const object = {
orderId,
userId: userId || '',
notifyUrl: notifyUrl || (ctx.app.notifyMap && ctx.app.notifyMap.get(appKey) && ctx.app.notifyMap.get(appKey).notifyUrl) || '',
backUrl: backUrl || '',
appKey,
status: 'init',
// phone: phone || '',
// city: areaInfo.province,
// operator: areaInfo.operator,
netMark,
};
if (orderId) {
await service.order.update(object);
} else {
object.orderId = ctx.helper.getUuid();
await service.order.create(object);
}
ctx.success({ orderId: object.orderId });
}
async partnerShow() {
const { ctx, service } = this;
try {
ctx.validate(this.showRule);
let { appKey, orderId, orderSn } = ctx.request.body.params;
orderId = orderId || orderSn;
await service.signature.signatureCheck(ctx.request.body);
const appKeyInfo = await service.partner.fetchInfo(appKey);
if (!(appKeyInfo && appKeyInfo.valid === true && appKeyInfo.enableHfData === true)) {
return ctx.fail('未开通此服务');
}
const data = await service.order.getOneByOrderId({ orderId, status: 'success' });
if (data) {
const result = await service.storage.read(orderId, appKey);
ctx.body = {
code: 0,
data: result,
};
return;
}
ctx.body = {
code: -1,
msg: '无此订单号',
};
} catch (err) {
ctx.logger.error('partnerShow', JSON.stringify(err));
ctx.error(err);
}
}
async fetchOrderId() {
const { ctx, service } = this;
......
'use strict';
const Controller = require('egg').Controller;
class PartnerController extends Controller {
// constructor(ctx) {
// super(ctx);
// }
async show() {
const { ctx, service } = this;
const { appKey } = ctx.params;
const ret = await service.partner.fetchTheme(appKey);
if (ret && ret.appKey === appKey) {
ctx.success(ret);
return;
}
ctx.fail('尚未配置主题');
}
async fetchAgreements() {
const { ctx, service } = this;
const { id } = ctx.params;
const ret = await service.partner.fetchAgreements(id);
if (ret && String(ret.id) === id) {
ctx.success(ret);
return;
}
ctx.fail('未获取到协议');
}
}
module.exports = PartnerController;
'use strict';
const Controller = require('egg').Controller;
class ScriptController extends Controller {
constructor(ctx) {
super(ctx);
this.hubsRule = {
phone: {
type: 'string',
format: /^(((13[0-9]{1})|(14[0-9]{1})|(15[4-9]{1})|(16[0-9]{1})|(17[0-9]{1})|(18[0-9]{1})|(19[0-9]{1}))+\d{8})$/,
message: 'phone格式错误',
required: true,
},
};
}
async fetchScripts() {
const { ctx, service } = this;
const { appKey } = ctx.query;
let limitScriptsList = false;
if (appKey) {
const ret = await service.partner.fetchInfo(appKey);
if (ret) {
limitScriptsList = ret.hfExcludeScripts;
}
}
let data = await service.scripts.fetchScripts();
if (limitScriptsList) {
data = data.filter(item => {
return !(limitScriptsList.includes(item.id));
});
}
ctx.success(data);
}
async fetchOneScripts() {
const { ctx, service } = this;
let { scriptId } = ctx.params;
if (scriptId === 'auto') {
const ret = await service.scripts.fetchScriptIdByIp();
scriptId = ret.scriptId;
}
const data = await service.scripts.fetchOneScripts(scriptId);
ctx.success(data);
}
async fetchParamsInfo() {
const { ctx, service } = this;
const { refresh = false } = ctx.query;
const data = await service.scripts.fetchParams(refresh);
ctx.success(data);
}
async fetchHelpInfo() {
const { ctx, service } = this;
const { scriptId } = ctx.params;
const data = await service.scripts.fetchHelp(scriptId);
ctx.success(data);
}
async fetchQueryButtonInfo() {
const { ctx, service } = this;
const { scriptId } = ctx.params;
const data = await service.scripts.fetchQueryButton(scriptId);
ctx.success(data);
}
async fetchNoticeInfo() {
const { ctx, service } = this;
const { scriptId } = ctx.params;
const data = await service.scripts.fetchNotice(scriptId);
ctx.success(data);
}
async fetchHubSeripts() {
const { ctx, service } = this;
ctx.validate(this.hubsRule, ctx.params);
const { phone } = ctx.params;
const areaInfo = await service.task.phoneArea(phone);
const cityMap = await service.scripts.fetchScripts();
let hubId = '';
cityMap.map(data => {
if (data.hub_name === areaInfo.province) {
hubId = data.hub_id;
}
});
let data = await service.scripts.fetchHubSeripts(hubId);
let result = '';
data = data.filter(item => {
if (item.name === (areaInfo.province + areaInfo.operator)) {
result = item;
return false;
}
return true;
});
if (result) {
data.unshift(result);
}
ctx.success(data);
}
}
module.exports = ScriptController;
This diff is collapsed.
......@@ -16,12 +16,6 @@ class TokenController extends Controller {
},
};
}
async create() {
const { ctx, service } = this;
ctx.validate(this.createRule);
const token = await service.signature.createToken(ctx.request.body);
ctx.success({ data: token });
}
async partnerCreate() {
const { ctx, service } = this;
......
......@@ -4,12 +4,9 @@
module.exports = {
success(data = false) {
const method = this.request.method.toLowerCase();
if (method === 'get') {
if (method === 'get' || method === 'post') {
this.status = 200;
this.body = data || {};
} else if (method === 'post') {
this.status = 201;
this.body = data || {};
} else if (method === 'put' || method === 'delete') {
this.status = data ? 200 : 204;
this.body = data ? data : '';
......
......@@ -2,6 +2,7 @@
const crypto = require('crypto');
const uuid = require('uuid').v1;
const iconv = require('iconv-lite');
// const crypto = require('md5-node');
function process(data) {
const keys = Object.keys(data);
......@@ -18,6 +19,13 @@ module.exports.getUuid = function() {
return uuid();
};
// module.exports.md5 = function() {
// let md5 = crypto.createHash('md5'); //实例化
// md5.update(Buffer.from(str), 'utf8'); //Buffer处理后进行md5加密
// const md5Pass = md5.digest('hex'); //将加密后的字符串赋值给相应的变量
// return md5Pass;
// };
module.exports.decode = function(data) {
return iconv.decode(data, 'gb2312');
};
......
'use strict';
module.exports = app => {
const { DataTypes } = app.Sequelize;
const nodeLimit = app.model.define('nodeLimit', {
id: {
type: DataTypes.INTEGER,
allowNull: false,
autoIncrement: true,
primaryKey: true,
field: 'id',
},
appKey: {
type: DataTypes.STRING(255),
allowNull: false,
defaultValue: '',
field: 'appKey',
},
type: {
type: DataTypes.STRING(255),
allowNull: true,
defaultValue: '',
field: 'type',
},
currentCount: {
type: DataTypes.STRING(255),
allowNull: true,
defaultValue: '',
field: 'currentCount',
},
limitCount: {
type: DataTypes.STRING(255),
allowNull: true,
defaultValue: '',
field: 'limitCount',
},
customerUrl: {
type: DataTypes.STRING(255),
allowNull: true,
defaultValue: '',
field: 'customerUrl',
},
createTime: {
type: DataTypes.DATE,
allowNull: true,
defaultValue: app.Sequelize.literal('CURRENT_TIMESTAMP'),
field: 'createTime',
},
updateTime: {
type: DataTypes.DATE,
allowNull: true,
defaultValue: app.Sequelize.literal('CURRENT_TIMESTAMP'),
field: 'updateTime',
},
text: {
type: DataTypes.STRING(255),
allowNull: true,
defaultValue: '',
field: 'text',
},
text2: {
type: DataTypes.STRING(255),
allowNull: true,
defaultValue: '',
field: 'text2',
},
},
{
tableName: 'node_limit',
timestamps: false,
});
return nodeLimit;
};
......@@ -14,17 +14,12 @@ module.exports = app => {
orderId: {
type: DataTypes.STRING(50),
allowNull: false,
field: 'orderId',
field: 'order_sn',
},
taskId: {
type: DataTypes.STRING(50),
allowNull: true,
field: 'taskId',
},
userId: {
type: DataTypes.STRING(500),
allowNull: true,
field: 'userId',
field: 'task_id',
},
phone: {
type: DataTypes.STRING(11),
......@@ -36,42 +31,21 @@ module.exports = app => {
allowNull: true,
field: 'city',
},
cityId: {
type: DataTypes.STRING(10),
allowNull: true,
field: 'cityId',
},
operator: {
type: DataTypes.STRING(10),
allowNull: true,
field: 'operator',
},
appKey: {
appkey: {
type: DataTypes.STRING(50),
allowNull: false,
field: 'appKey',
},
notifyUrl: {
type: DataTypes.STRING(500),
allowNull: true,
field: 'notifyUrl',
},
backUrl: {
type: DataTypes.STRING(500),
allowNull: true,
field: 'backUrl',
field: 'app_key',
},
status: {
type: DataTypes.STRING(20),
allowNull: true,
field: 'status',
},
netMark: {
type: DataTypes.INTEGER,
allowNull: true,
defaultValue: 0,
field: 'netMark',
},
note: {
type: DataTypes.STRING(8000),
allowNull: true,
......@@ -91,31 +65,50 @@ module.exports = app => {
this.setDataValue('note', JSON.stringify(val));
},
},
params: {
type: DataTypes.STRING(8000),
allowNull: true,
field: 'params',
get() {
const note = this.getDataValue('params');
if (note) {
try {
return JSON.parse(note);
} catch (error) {
return {};
}
}
return {};
},
set(val) {
this.setDataValue('params', JSON.stringify(val));
},
},
created_at: {
type: DataTypes.DATE,
allowNull: false,
defaultValue: app.Sequelize.literal('CURRENT_TIMESTAMP'),
field: 'createDate',
field: 'create_time',
},
updated_at: {
type: DataTypes.DATE,
allowNull: false,
defaultValue: app.Sequelize.literal('CURRENT_TIMESTAMP'),
field: 'updateDate',
field: 'update_time',
},
text1: {
msg: {
type: DataTypes.STRING(255),
allowNull: true,
field: 'text1',
field: 'msg',
},
notice: {
type: DataTypes.STRING(2),
remark: {
type: DataTypes.STRING(255),
allowNull: true,
field: 'notice',
field: 'remark',
},
},
{
tableName: 'yys_status',
tableName: 'thxd_status',
});
return taskStatus;
......
a,
img,
button,
input,
textarea,
div,
*:focus {
-webkit-tap-highlight-color: transparent;
tap-highlight-color: transparent;
}
:not(input) {
-webkit-touch-callout: none;
}
* {
font-family: Arial, Helvetica, sans-serif;
}
html {
font-size: 10px;
background-color: #f5f5f5;
}
body {
margin: 0;
-webkit-overflow-scrolling: touch;
}
button.btn,
a.btn {
font-size: 18px;
height: 44px;
line-height: 44px;
border-radius: 2px;
text-align: center;
box-sizing: border-box;
display: block;
border: none;
text-decoration: none;
transition: all 0.1s ease-in-out;
-moz-transition: all 0.1s ease-in-out;
-webkit-transition: all 0.1s ease-in-out;
outline: none;
padding: 0;
width: 100%;
}
button.btn:disabled,
a.btn:disabled {
background-color: #c4c4c4;
border: 0;
color: #fff;
}
button.btn-blue,
a.btn-blue {
background-color: #439df8;
color: #fff;
}
button.btn-blue:active,
a.btn-blue:active,
button.btn-blue:focus,
a.btn-blue:focus,
button.btn-blue:visited,
a.btn-blue:visited {
background-color: #0091cb;
}
button.btn-white,
a.btn-white {
background-color: #fff;
color: #333;
border: 1px solid #e5e5e5;
}
button.btn-white:active,
a.btn-white:active,
button.btn-white:focus,
a.btn-white:focus {
background-color: #ededed;
}
@-webkit-keyframes rotate {
from {
-webkit-transform: rotate(0deg);
}
to {
-webkit-transform: rotate(-360deg);
}
}
.cirque-box-loader {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
.cirque-box-loader::before {
display: block;
background-color: rgba(0, 0, 0, 0.4);
content: '';
width: 9rem;
height: 9rem;
position: absolute;
top: 50%;
left: 50%;
margin: -4.5rem 0 0 -4.5rem;
border-radius: 10px;
}
.cirque-box-loader::after {
display: block;
content: '';
width: 4.2rem;
height: 4.2rem;
position: absolute;
top: 50%;
left: 50%;
margin: -2.1rem 0 0 -2.1rem;
background-image: url(//r.51gjj.com/images/common/img_white_cirque_loader.png);
background-repeat: no-repeat;
background-size: 4.2rem;
background-position: 50%;
-webkit-animation-name: rotate;
-webkit-animation-duration: 1s;
-webkit-animation-iteration-count: infinite;
-webkit-animation-timing-function: linear;
}
.search-bar {
padding: 8px 12px;
margin: 0;
background-color: transparent;
}
.search-bar input {
display: block;
height: 34px;
width: 100%;
border-radius: 17px;
background-color: rgba(51, 51, 51, 0.12);
border: none;
outline: none;
padding: 0 32px;
font-size: 14px;
box-sizing: border-box;
background-image: url(//r.51gjj.com/images/common/ico_search.png);
background-size: 18px;
background-repeat: no-repeat;
background-position: 10px center;
}
.foldable-list-wrapper li {
list-style-type: none;
}
.foldable-list-wrapper ul {
margin: 0;
padding: 0;
}
.foldable-list-wrapper ul + ul {
margin-top: 1px;
}
.foldable-list-wrapper li + li {
margin-top: 1px;
}
.foldable-list-wrapper h4 {
padding: 4px 12px 10px;
margin: 0;
font-size: 13px;
font-weight: normal;
color: #a6a6a6;
}
.foldable-list-wrapper h5 {
padding: 12px 18px 12px 12px;
background-color: white;
font-size: 15px;
font-weight: normal;
color: #333;
background-image: url(//r.51gjj.com/images/common/ico_arrow_down_gray.png);
background-repeat: no-repeat;
background-size: 12px;
background-position: right 45%;
background-origin: content-box;
margin: 0;
}
.foldable-list-wrapper h5 + ul {
display: none;
}
.foldable-list-wrapper h5.open {
background-position: right 55%;
background-image: url(//r.51gjj.com/images/common/ico_arrow_up_gray.png);
}
.foldable-list-wrapper h5.open + ul {
display: block;
}
.foldable-list-wrapper ul ul li {
padding: 12px 8px;
background-color: transparent;
font-size: 13px;
color: #333;
}
.foldable-list-wrapper ul ul li + li {
border-top: 1px solid #e7e7e7;
}
.list-wrapper ul {
margin: 0;
padding: 0;
}
.list-wrapper li {
padding: 12px;
background-color: white;
font-size: 15px;
color: #333;
list-style-type: none;
}
.list-wrapper li + li {
margin-top: 1px;
}
.list-wrapper ul:empty + * {
display: block;
}
.list-wrapper span {
font-size: 12px;
display: none;
color: #fc8c28;
padding: 0 10px;
line-height: 20px;
}
.list-wrapper span::before {
content: '未找到相关“';
}
.list-wrapper span::after {
content: '”';
}
.dialog-content .progress-top-loader {
position: absolute;
}
@media screen and (min-width: 640px) {
html {
background-color: #fff
}
body {
width: 640px;
background-color: #ededed;
margin: 0 auto;
box-shadow: 0 0 6px rgba(0, 0, 0, .1)
}
}
.agr {
line-height: 18px
}
.agr a, .agr span {
vertical-align: top;
color: #a6a6a6;
font-size: 1.3rem
}
.agr .fp {
text-decoration: none;
color: #439df8;
float: right
}
.input-box .content select + label {
color: #a6a6a6
}
section.note-field p {
padding: 0;
color: #a6a6a6;
font-size: 12px;
line-height: 120%;
}
section.note-field p:first-child {
margin-top: 0rem
}
section.note-field p a {
font-size: inherit;
color: #439df8;
text-decoration: none;
padding: 0 3px
}
section.second-prompt p {
margin-top: .6rem;
font-size: 14px
}
section.second-prompt p:first-child {
font-size: 16px;
color: #f44336;
font-weight: 700
}
.user-fields-dashboard > .ico-text-dashboard {
display: none;
margin-top: 10px
}
.user-field-dashboard {
padding-top: 1px
}
.user-fields-dashboard.loading select {
display: none
}
.user-fields-dashboard.loading > .ico-text-dashboard {
display: block
}
.user-fields-dashboard.loading .user-field-dashboard {
display: none
}
.user-fields-dashboard.loading ~ section:not(.note-field) {
display: none
}
.user-fields-dashboard.loader select {
display: none
}
.user-fields-dashboard.loader > .canvas-dashboard {
display: block
}
.user-fields-dashboard.loader .user-field-dashboard {
display: none
}
.user-fields-dashboard.loader ~ section:not(.note-field) {
display: none
}
.pannel {
margin-top: 10px;
padding-bottom: 32px;
background-color: #fff;
box-shadow: 0 0 2px rgba(0, 0, 0, .04)
}
.pannel .wrapper {
padding: 35px 0 1px
}
.pannel .wrapper .icon {
width: 72px;
height: 72px;
display: block;
margin: 0 auto;
background-image: url(../images/icon_rzsb2.png);
background-size: 100%
}
.pannel .wrapper .title {
display: block;
color: #14b25a;
font-size: 18px;
text-align: center;
margin-top: 20px
}
.pannel .wrapper p {
margin: 0;
color: #a6a6a6;
font-size: 14px;
padding: 16px 12px 0;
line-height: 20px;
text-align: center;
word-break: break-all
}
.pannel .wrapper p .red {
color: #ea6363
}
.pannel .wrapper.failed .icon {
background-image: url(../images/icon_rzsb2.png)
}
.pannel .wrapper .failed .title {
color: #fc8c28
}
.dialog .dialog-wrapper .dialog-content p .hl {
color: #f69
}
.dialog .dialog-wrapper .dialog-content .ps {
margin-left: 4px;
color: #a6a6a6;
font-size: 12px;
vertical-align: baseline
}
.dialog .dialog-wrapper .dialog-content .ps::before {
content: '('
}
.dialog .dialog-wrapper .dialog-content .ps::after {
content: ')'
}
.lamp-wrapper {
background-color: #fff5d9;
border: 1px solid #fc3;
border-radius: 4px;
padding: 6px 6px 6px 30px;
color: #555;
line-height: 18px;
background-image: url(//r.51gjj.com/images/carrier/ico_lamp.png);
background-size: 18px;
background-repeat: no-repeat;
background-position: 6px 6px
}
.lamp-wrapper a {
padding: 0 4px;
color: #439df8
}
pre {
white-space: pre-wrap;
white-space: -moz-pre-wrap;
white-space: -pre-wrap;
white-space: -o-pre-wrap;
word-wrap: break-word;
font-size: 1.3rem;
color: #666;
line-height: 160%;
margin: 1.2rem;
padding: 0
}
a.small-button {
border: #439df8 solid 1px;
border-radius: 22px;
width: 220px;
height: 44px;
color: #439df8;
text-align: center;
margin: 30px auto 12px;
display: block;
text-decoration: none;
font-size: 18px;
line-height: 44px
}
a.small-button + .small-button {
margin-top: 0
}
a.small-button.gray {
color: #a6a6a6;
border-color: #a6a6a6
}
.canvas-dashboard {
margin-top: 10px;
background-color: #fff;
padding: 20px 0 30px;
display: none
}
.canvas-dashboard.pause .loader {
background-image: url(//r.51gjj.com/images/common/ico_expr_lovely.png);
background-size: 80%;
background-position: center;
background-repeat: no-repeat
}
.canvas-dashboard.pause .loader .content {
display: none
}
.canvas-dashboard .label {
font-size: 15px;
text-align: center;
margin: 0 0 20px;
color: #439df8
}
.canvas-dashboard .loader {
width: 160px;
height: 160px;
line-height: 160px;
margin: 0 auto;
position: relative
}
.canvas-dashboard .loader canvas {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%
}
.canvas-dashboard .loader .content {
line-height: normal;
display: inline-block;
position: absolute;
top: 50%;
transform: translateY(-50%);
vertical-align: middle;
text-align: center;
width: 100%;
opacity: 1;
transition: opacity .2s;
-moz-transition: opacity .2s;
-webkit-transition: opacity .2s;
-o-transition: opacity .2s
}
.canvas-dashboard .loader .content.in {
opacity: 0
}
.canvas-dashboard .loader .content .message {
color: #c6c6c6;
font-size: 11px;
padding: 0 20px
}
.canvas-dashboard .loader .content .message:only-child {
font-size: 15px
}
.canvas-dashboard .loader .content .sec {
color: #439df8;
font-size: 64px;
line-height: 85%;
margin-top: 5px;
margin-left: 10px
}
.canvas-dashboard .loader .content .sec::after {
content: '″';
font-size: 26px;
vertical-align: text-top
}
.agr a {
color: #439df8;
}
.css-loader-dash {
margin-top: 10px;
background-color: #fff;
padding: 5px 0 30px;
display: none;
height: 170px;
}
.css-loader {
margin: 0 auto;
/*background-color : #fff;*/
height: 170px;
width: 170px;
position: relative;
z-index: 501;
}
.css-loader #load {
/*margin-top:60px;*/
color: #c6c6c6;
font-family: calibri;
text-align: center;
/* position : absolute;
top:50%;
left:50%;*/
/*transform: translate(-50%,-50%);*/
font-size: 15px;
/*display: inline-block;*/
}
#test {
height: 7px;
width: 7px;
position: absolute;
background-color: #fff;
border-radius: 50%;
top: 16px;
left: 16px;
background-color: #439DF8;
}
#rond {
height: 150px;
width: 150px;
border: 7px solid #f6f6f6;
border-radius: 50%;
position: absolute;
top: 20px;
left: 0px;
animation: rond 2s infinite;
-webkit-animation: rond 2s infinite;
}
@keyframes rond {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
@-webkit-keyframes rond {
0% {
-webkit-transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(360deg);
}
}
.css-shadow {
position: fixed;
width: 100%;
height: 100%;
top: 0;
left: 0;
background-color: #fff;
display: none;
z-index: 500;
opacity: 0.5;
}
.input-box .content .clearVal {
cursor: pointer;
display: block;
font-size: 18px;
height: 20px;
line-height: 20px;
position: absolute;
right: 30px;
text-align: center;
margin-top: 10px;
width: 20px;
z-index: 2;
background-position: -172px -27px;
background-image: url(../images/close.png);
background-repeat: no-repeat;
}
This diff is collapsed.
.progress-top-loader {
position: fixed;
top: 0;
left: 0;
height: 3px;
background-color: #7FFF00;
box-shadow: 0 2px 2px rgba(127, 225, 0, 0.2);
width: 0%;
opacity: 0;
transition: opacity .2s;
z-index: 100;
}
.progress-top-loader.out {
opacity: 1;
}
.prompt {
display: block;
width: 190px;
min-height: 46px;
line-height: 46px;
text-align: center;
box-sizing: border-box;
padding: 12px;
background-color: rgba(0, 0, 0, 0.6);
color: white;
font-size: 16px;
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
border-radius: 10px;
z-index: 12;
}
.prompt * {
line-height: 22px;
display: inline-block;
width: 100%;
word-break: break-all;
vertical-align: middle;
}
.toast {
position: fixed;
top: 40px;
max-width: 80%;
border-radius: 10px;
text-align: center;
color: white;
background-color: rgba(0, 0, 0, 0.75);
font-size: 0;
display: inline-block;
left: 50%;
-webkit-transform: translateX(-50%);
-moz-transform: translateX(-50%);
-ms-transform: translateX(-50%);
transform: translateX(-50%);
z-index: 100;
}
.toast > * {
display: inline-block;
vertical-align: middle;
}
.toast span {
font-size: 14px;
padding: 10px 10px;
display: block;
height: auto;
word-wrap: break-word;
}
.ui-overlay {
background-color: rgba(0, 0, 0, 0.4);
display: block;
width: 100%;
position: fixed;
top: 0;
bottom: 0;
display: none;
-webkit-transition: opacity 0.2s ease-in;
-moz-transition: opacity 0.2s ease-in;
-o-transition: opacity 0.2s ease-in;
transition: opacity 0.2s ease-in;
z-index: 10;
opacity: 0;
}
.ui-overlay.show {
display: block;
}
.ui-overlay.out {
opacity: 1;
}
@-webkit-keyframes rotate {
from {
-webkit-transform: rotate(0deg);
}
to {
-webkit-transform: rotate(-360deg);
}
}
.loading-anim {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 10;
}
.loading-anim::before {
display: block;
background-color: rgba(0, 0, 0, 0.4);
content: '';
width: 9rem;
height: 9rem;
position: absolute;
top: 50%;
left: 50%;
margin: -4.5rem 0 0 -4.5rem;
border-radius: 10px;
}
.loading-anim::after {
display: block;
content: '';
width: 4.2rem;
height: 4.2rem;
position: absolute;
top: 50%;
left: 50%;
margin: -2.1rem 0 0 -2.1rem;
/*background-image: url(../images/img_loading_white.png);*/
background-repeat: no-repeat;
background-size: 4.2rem;
background-position: 50%;
-webkit-animation-name: rotate;
-webkit-animation-duration: 1s;
-webkit-animation-iteration-count: infinite;
-webkit-animation-timing-function: linear;
}
.dialog {
position: fixed;
left: 22px;
right: 22px;
top: 50%;
display: none;
z-index: 11;
background-color: white;
border-radius: 3px;
-webkit-transform: scale(0.7) translateY(-71.4%);
-moz-transform: scale(0.7) translateY(-71.4%);
-ms-transform: scale(0.7) translateY(-71.4%);
transform: scale(0.7) translateY(-71.4%);
opacity: 0;
overflow: hidden;
-webkit-transition: all 0.2s;
-moz-transition: all 0.2s;
transition: all 0.2s;
box-shadow: -3px 3px 6px 4px rgba(0, 0, 0, 0.15);
}
.dialog.out {
-webkit-transform: scale(1) translateY(-50%);
-moz-transform: scale(1) translateY(-50%);
-ms-transform: scale(1) translateY(-50%);
transform: scale(1) translateY(-50%);
opacity: 1;
}
.dialog.show {
display: block;
}
.dialog .dialog-title {
height: 44px;
color: #888;
text-align: center;
font-size: 16px;
line-height: 44px;
border-bottom: 1px solid #efefef;
}
.dialog .dialog-wrapper {
background-color: transparent;
}
.dialog .dialog-wrapper .dialog-content {
padding: 10px;
color: #333;
line-height: 140%;
font-size: 13px;
box-sizing: border-box;
min-height: 32px;
max-height: 166px;
overflow-y: auto;
}
.dialog .dialog-wrapper .dialog-content h1 {
font-size: 16px;
color: #333333;
text-align: center;
line-height: 16px;
margin: 8px 0;
font-weight: normal;
}
.dialog .dialog-wrapper .dialog-content p {
font-size: 14px;
margin: 0;
color: #555;
line-height: 160%;
}
.dialog .dialog-wrapper .dialog-content p a {
color: #439df8;
padding: 0 2px;
text-decoration: underline;
}
.dialog .dialog-wrapper .dialog-content p a[href^=http] {
text-decoration: underline;
word-break: break-all;
padding: 0 4px;
}
.dialog .dialog-wrapper .dialog-content p + p {
margin-top: 15px;
}
.dialog .dialog-wrapper .dialog-button-container {
font-size: 0;
width: 100%;
height: 44px;
line-height: 44px;
margin: 10px 0 22px 0;
text-align: center;
}
.dialog .dialog-wrapper .dialog-button {
height: 100%;
color: #FFFFFF;
font-size: 16px;
text-align: center;
cursor: pointer;
display: inline-block;
position: relative;
padding: 0;
border: none;
outline: none;
width: 100%;
background-color: #5578EA;
box-sizing: border-box;
border: 1px solid #F0F2F5;
border-radius: 3px;
margin: 0px 3% 0 0;
line-height:25px;
}
.dialog .dialog-wrapper .dialog-button:disabled,
.dialog .dialog-wrapper .dialog-button.disabled {
background-color: #f0f0f0 !important;
color: #a6a6a6 !important;
}
.dialog .dialog-wrapper .dialog-button.d-2 {
width: 44%;
}
.dialog .dialog-wrapper .dialog-button.d-3 {
width: 33.33%;
}
.dialog .dialog-wrapper .dialog-button.cancel {
color: #a6a6a6;
background-color: #fff;
}
.dialog .dialog-wrapper .dialog-button.confirm {
border-top: none;
color: #fff;
background-color: #439df8;
}
.dialog .dialog-wrapper .dialog-button.confirm:disabled {
background-color: #c4c4c4;
border: 0;
color: #fff;
}
.dialog .dialog-wrapper .dialog-button.back {
color:#999999;
background:#F0F2F5;
margin-left:3%;
}
This diff is collapsed.
'use strict';
window.onerror = function(errorMessage, scriptURI, lineNumber, columnNumber, errorObj) {
const enabled_log_back = console.enabled_server_log;
console.enabled_server_log = true;
console.log(arguments);
console.enabled_server_log = enabled_log_back;
};
function getURLParams(url) {
const urlParts = url.split('?');
const result = {};
if (urlParts[1]) {
const params = urlParts[1].split('&');
for (let i = 0; i < params.length; ++i) {
const item = params[i].split('=');
const key = decodeURIComponent(item[0]);
const uri_encoded = item[1].replace(/%([^\da-fA-f].)/, '%25$1');
const val = decodeURIComponent(uri_encoded);
result[key] = val;
}
}
return result;
}
function serializeParams(data) {
let serializedParams = '';
for (const pro in data) {
serializedParams += (serializedParams.length ? '&' : '') + pro + '=' + encodeURIComponent(data[pro]);
}
return serializedParams;
}
function getParams(data, key, default_value) {
if (data != undefined) {
return key in data ? data[key] : default_value;
}
return default_value;
}
function isFunction(fn) {
return typeof fn === 'function';
}
function defineReactive(obj, key, val, before_change, after_change, flags) {
let blocking = false,
setter,
getter;
flags = flags || 0; // 第1位 值一样的情况下是否触发
if (val instanceof Object && isFunction(val.set) && isFunction(val.get)) {
setter = val.set;
getter = val.get;
} else {
getter = function() { return val; };
setter = function(newVal) { val = newVal; };
}
Object.defineProperty(obj, key, {
enumerable: true,
configurable: true,
get: function reactiveGetter() {
return getter.call(obj);
},
set: function reactiveSetter(newVal) {
if (blocking) {
return;
}
blocking = true;
do {
if (val === newVal && !(flags & 1)) {
break;
}
if (isFunction(before_change) && before_change.call(obj, val, newVal) === true) {
break;
}
const originVal = val;
try {
setter.call(obj, newVal);
isFunction(after_change) && after_change.call(obj, originVal, val);
} catch (e) {
blocking = false;
throw e;
}
} while (false);
blocking = false;
},
});
}
function loadScript(url, fn, error) {
const script = document.createElement('script');
script.type = 'text/javascript';
if (script.readyState) {
script.onreadystatechange = function() {
if (script.readyState == 'loaded' || script.readyState == 'complete') {
script.onreadystatechange = null;
isFunction(fn) && fn();
}
};
} else {
script.onload = function() {
isFunction(fn) && fn();
};
script.onerror = function() {
isFunction(error) && error();
};
}
script.src = url;
document.body.appendChild(script);
}
function doAjax(args) {
let request = new XMLHttpRequest(),
url = getParams(args, 'url', ''),
data = getParams(args, 'data', {}),
contentType = getParams(args, 'contentType', 'application/x-www-form-urlencoded'),
type = getParams(args, 'type', 'get');
request.onreadystatechange = function() {
console.log(args, '【doAjax】request=====', JSON.stringify(request))
if (request.readyState == 4) {
if (request.status == 200) {
let dataType = null;
if ('dataType' in args) {
dataType = args.dataType;
} else {
if (/\bContent\-Type\s*:\s* ([^\n;]+)(?=\n|;)/i.test(request.getAllResponseHeaders())) {
const contentType = RegExp.$1;
if (/\bjson\b/i.test(contentType)) {
dataType = 'json';
} else {
dataType = 'text';
}
}
}
let data = null;
if (/^json$/i.test(dataType)) {
data = JSON.parse(request.responseText);
} else {
data = request.responseText;
}
try {
if (typeof args.success === 'function') {
args.success(data);
}
} catch (e) {
}
} else {
if (typeof args.error === 'function') {
args.error(request.status);
}
}
}
};
request.onloadstart = function() {
if (typeof args.loadstart === 'function') {
args.loadstart();
}
};
request.onprogress = function(event) {
if (typeof args.progress === 'function') {
args.progress(event);
}
};
request.timeout = getParams(args, 'timeout', 0);
if (/^post$/gi.test(type)) {
request.open('POST', url, true);
request.setRequestHeader('Content-Type', contentType);
if (contentType == 'application/x-www-form-urlencoded') {
var content = typeof data === 'string' ? data : serializeParams(data);
request.send(content);
} else if (contentType == 'application/json') {
var content = typeof data === 'string' ? data : JSON.stringify(data);
request.send(content);
}
} else {
url += (url.indexOf('?') >= 0 ? '&' : '?') + serializeParams(data);
request.open('GET', url, true);
request.send();
}
}
function doJsonAjax(url, data, success, failed, loadstart, progress) {
doAjax({
url,
type: 'post',
data,
contentType: 'application/json',
success,
error: failed,
loadstart,
progress,
});
}
function extendMethod(class_name, method_set) {
for (const method_name in method_set) {
class_name.prototype[method_name] = method_set[method_name];
}
}
function EventListener() {
}
extendMethod(EventListener, {
on(event, func) {
if (typeof event === 'string' && typeof func === 'function') {
const list = this['on' + event + 'list'];
if (list instanceof Array) {
for (let i = 0; i < list.length; i++) {
if (list[i] === func) {
return this;
}
}
list.push(func);
} else {
this['on' + event + 'list'] = [func];
}
}
return this;
},
off(event, func) {
const list = this['on' + event + 'list'];
if (list instanceof Array) {
if (!func) {
list.length && list.splice(0, list.length);
} else {
for (let i = 0; i < list.length; i++) {
if (list[i] === func) {
list.splice(i, 1);
break;
}
}
}
}
return this;
},
trigger(event) {
let result = false,
list = this['on' + event + 'list'];
if (list instanceof Array) {
for (let i = 0; i < list.length; i++) {
const func = list[i];
if (typeof func !== 'function') {
continue;
}
const args = Array.prototype.slice.call(arguments, 0);
args.shift();
result = result || func.apply(this, args);
}
}
return result;
},
});
function __() {
this.timer = 0;
this.queue = [];
this.complete = null;
}
__.prototype.then = function(cb, delay) {
this.queue.push({ callback: cb, delay });
return this;
};
__.prototype.end = function(cb) {
this.complete = cb;
return this;
};
__.prototype.abort = function() {
if (this.timer) {
clearTimeout(this.timer);
this.timer = 0;
}
return this;
};
__.prototype.commit = function() {
const self = this;
if (this.queue.length && !this.timer) {
const top = this.queue.shift();
if (typeof top.callback === 'function') {
if (typeof top.delay !== 'number' || top.delay <= 0) {
top.callback.apply(self);
this.commit();
} else {
this.timer = setTimeout(function() {
top.callback.apply(self);
self.timer = 0;
self.commit();
}, top.delay);
}
} else {
self.commit();
}
} else if (!this.queue.length && !this.timer) {
if (typeof this.complete === 'function') {
this.complete.apply(this);
this.complete = null;
}
}
return this;
};
function then(cb, delay) {
return (new __()).then(cb, delay);
}
$(function() {
document.body.addEventListener('touchstart', function() {});
});
window.console = (function() {
const log = console.log;
let message_queue = new Array();
function _() {
this._init();
}
_.prototype = console;
console._init = function() {
this.enabled_server_log = false;
this.enabled_window_log = false;
};
console.log = function(msg) {
log.call(this, msg);
this._server_log(msg);
this._window_log(msg);
};
console._server_log = function(msg) {
if (!this.enabled_server_log) {
return;
}
if (msg instanceof Object) {
msg = JSON.stringify(msg);
} else {
msg = '' + msg;
}
message_queue.push({ time: +new Date(), message: msg });
this._check_queue();
};
console._window_log = function(msg) {
};
console._check_queue = function() {
if (this._server_flag) {
return;
}
if (message_queue.length > 0) {
// 消息队列队首元素
this._server_flag = true;
setTimeout(function() {
const data = message_queue;
message_queue = [];
doJsonAjax(constant.project_root + 'log', data, function() {
message_queue.shift();
this._server_flag = false;
this._check_queue();
}.bind(this));
}.bind(this), 20);
}
};
return new _();
})();
This diff is collapsed.
'use strict';
function Scheduler(option) {
option = option || {};
this.timeout = option.timeout || 60 * 2 * 1000;
this.duration = option.duration || 2000;
this.abort = false;
this.doing = false;
}
Scheduler.prototype._get_delay = function() {
let delay = typeof this.duration === 'function' ? this.duration(this.start_time) : this.duration;
delay = +delay;
return delay <= 0 && (delay = 2000), delay;
};
Scheduler.prototype.update = function() {
const delay = this._get_delay() - (+new Date() - this.last_time);
if (this.abort || this.doing) {
return;
}
this.doing = true;
setTimeout(function() {
if (this.abort) {
return;
}
this.last_time = +new Date();
this.doing = false;
this.callback();
}.bind(this), delay);
};
Scheduler.prototype.begin = function(callback, success, failed) {
this.start_time = +new Date();
this.last_time = this.start_time;
this.callback = callback;
this.success = success;
this.failed = failed;
this.abort = false;
this.callback();
this.timeout_timer = setTimeout(function() {
this.abort = true;
if (typeof this.failed === 'function') {
this.failed({ code: 1, TIMEOUT: 1, CANCEL: 2, UNKNOWN_ERROR: 3 });
}
delete this.timeout_timer;
}.bind(this), this.timeout);
return this;
};
Scheduler.prototype.cancel = function() {
this.abort = true;
if (this.timeout_timer) {
clearTimeout(this.timeout_timer);
delete this.timeout_timer;
}
if (typeof this.failed === 'function') {
this.failed({ code: 2, TIMEOUT: 1, CANCEL: 2, UNKNOWN_ERROR: 3 });
}
return this;
};
Scheduler.prototype.end = function() {
this.abort = true;
if (this.timeout_timer) {
clearTimeout(this.timeout_timer);
delete this.timeout_timer;
}
if (typeof this.success === 'function') {
this.success.apply(this, arguments);
}
return this;
};
This diff is collapsed.
$.extend($.fn, {
valMap() {
const data = {};
for (let i = 0; i < this.length; i++) {
let ele = $(this[i]),
name = ele.attr('name'),
val = ele.val();
if (ele.is('[type=hidden]') || ele.is('select')) {
// 自动转换
if (/^\s*([1-9]\d*|0)\s*$/.test(val)) {
val = +val;
} else if (val == 'true') {
val = true;
} else if (val == 'false') {
val = false;
}
} else if (ele.is('[type=number]')) {
val = +val;
}
if (name) {
name = name.replace(/^\s*|\s*$/gi, '');
if (/^([^\[]+)(?:\s*\[\s*([^\]]+)\s*\])+$/.test(name)) {
let keys = [name.substr(0, name.indexOf('[')).replace(/^\s*|\s*$/gi, '')];
keys = keys.concat(name.substr(keys[0].length).replace(/^\s*\[|\]\s*$/gi, '').split(/\]\s*\[/));
let node = data;
while (keys.length) {
const key = keys.shift();
if (keys.length == 0) {
node[key] = val;
} else {
if (typeof node[key] !== 'object') {
node = node[key] = {};
} else {
node = node[key];
}
}
}
} else {
data[name] = val;
}
}
}
return data;
},
inputValidate(config) {
for (let i = 0; i < this.length; i++) {
let ele = $(this[i]),
name = ele.attr('name').replace(/^\s*|\s*$/gi, ''),
val = ele.val();
if (!!name && !!config[name]) {
let rules = config[name];
if (!rules instanceof Array) {
rules = [rules];
}
for (let j = 0; j < rules.length; j++) {
const rule = rules[j];
if (rule.match) {
if (rule.match == 'phone') {
if (!/^1\d{10}$/.test(val)) {
ele.trigger('inputerror', rule.error);
return true;
}
} else if (rule.match == 'IDCard') {
if (!/^\d{14}(\d{3})?[\dXx]$/.test(val)) {
ele.trigger('inputerror', rule.error);
return true;
}
}
} else if (rule.pattern) {
const regexp = new RegExp(rule.pattern);
if (!regexp.test(val)) {
ele.trigger('inputerror', rule.error);
return true;
}
}
}
}
}
return false;
},
submitFields(selector) {
if (typeof selector === 'string') {
selector = $(selector);
} else if (!selector) {
selector = new $();
}
const callback = (function(selector, target) {
return function() {
const fields = selector.filter(function() { return $(this).is('.required,[required],[type=checkbox].required-checked'); });
for (let i = 0; i < fields.length; i++) {
const r = $(fields[i]);
if ('|text|password|'.indexOf(('|' + r.attr('type') + '|').toLowerCase()) >= 0 && !r.is(':visible')) {
continue;
}
if (r.hasClass('required') || r.is('[required]')) {
if (/^\s*$/.test(r.val())) {
target.attr('disabled', 'disabled');
return;
}
}
if (r.hasClass('required-checked') && r.is('[type=checkbox]')) {
if (!r.is(':checked')) {
target.attr('disabled', 'disabled');
return;
}
}
}
target.removeAttr('disabled');
};
})(selector, this);
this.trigger('uninstall').off('uninstall');
selector.length && this.on('uninstall', function() {
selector.off('input change', callback);
}) && selector
.on('input change', callback)
.eq(0).trigger('input');
return this;
},
lock(cd) {
let self = $(this),
text = self.html(),
i = cd;
self.data('origin-text', '免费获取');
const call = function() {
if (i > 0) {
self.html(i + '秒后重试');
self.attr('disabled', 'disabled');
} else {
self.html(self.data('origin-text'));
self.removeAttr('disabled');
self.data('timer', 0);
clearInterval(timer);
self.trigger('clickready');
}
i--;
};
var timer = setInterval(call, 1000);
self.data('timer', timer);
call();
const id = self.data('id');
if (window.localStorage && id) {
let cache = window.localStorage.lock_cd;
if (cache) {
cache = JSON.parse(cache);
} else {
cache = {};
}
cache[id] = Math.round(new Date().getTime() / 1000) + cd;
window.localStorage.lock_cd = JSON.stringify(cache);
}
},
unlock() {
const self = $(this);
self.html(self.data('origin-text'));
self.removeAttr('disabled');
const timer = self.data('timer');
timer && clearInterval(timer);
const id = self.data('id');
if (window.localStorage) {
let cache = window.localStorage.lock_cd;
if (cache) {
cache = JSON.parse(cache);
} else {
cache = {};
}
delete cache[id];
window.localStorage.lock_cd = JSON.stringify(cache);
}
},
restoreLock() {
const self = $(this);
if (window.localStorage) {
let cache = window.localStorage.lock_cd;
if (cache) {
cache = JSON.parse(cache);
}
const now = Math.round(new Date().getTime() / 1000);
for (const id in cache) {
const cdt = cache[id];
if (cdt - now > 0) {
(self.data('id') == id ? self : self.find('[data-id=' + id + ']')).lock(cdt - now);
}
}
}
},
lockCD() {
const self = $(this);
const lock_id = self.data('id');
try {
if (window.localStorage && lock_id) {
let cache = window.localStorage.lock_cd;
if (cache) {
cache = JSON.parse(cache);
}
const now = Math.round(new Date().getTime() / 1000);
if (lock_id in cache) {
const cdt = cache[lock_id];
if (cdt - now > 0) {
return cdt - now;
}
}
}
} catch (e) {
}
return 0;
},
});
$(function() {
$(document).restoreLock();
$('script[type*=json]').each(function() {
let self = $(this),
id = self.attr('id');
if (id) {
try {
window[id] = JSON.parse(self.html());
} catch (e) {
window[id] = undefined;
}
}
});
});
This diff is collapsed.
......@@ -7,12 +7,14 @@ module.exports = app => {
const { router, controller } = app;
const yysRouter = router.namespace(app.config.projectRootPath);
yysRouter.get('/index', controller.index.index);// H5页面
yysRouter.get('/scripts', controller.task.configs); // 获取所有脚本配置信息
yysRouter.post('/tasks', controller.task.create); // 创建任务
yysRouter.get('/tasks/:taskId', controller.task.show); // 获取任务状态
yysRouter.post('/tasks/:taskId/submit', controller.task.submit); // 提交任务参数
yysRouter.post('/tasks/:taskId/capture', controller.task.fetchCapture); // 获取验证码
yysRouter.post('/submit', controller.task.submit); // 提交任务参数
yysRouter.post('/capture', controller.task.fetchCapture); // 获取验证码
yysRouter.post('/callback', controller.task.handleCallback); // 处理回调结果,不对外
......@@ -21,29 +23,9 @@ module.exports = app => {
// yysRouter.get('/scripts', controller.script.fetchScripts); // 获取所有脚本信息
// yysRouter.get('/scripts/:phone');// 手机号获取脚本信息
yysRouter.get('/scripts/:scriptId', controller.script.fetchOneScripts); // 获取单一脚本信息
yysRouter.get('/help/:scriptId', controller.script.fetchHelpInfo); // 获取帮助信息
yysRouter.get('/notice/:scriptId', controller.script.fetchNoticeInfo);// 获取提示信息
yysRouter.get('/query_button/:scriptId', controller.script.fetchQueryButtonInfo); // 获取查询按钮信息
yysRouter.get('/params', controller.script.fetchParamsInfo); // 获取登录参数字典
yysRouter.post('/tokens', controller.token.create); // 创建token
yysRouter.post('/orders', controller.order.create); // 创建订单号
yysRouter.get('/hubs/:phone/scripts', controller.script.fetchHubSeripts);// 根据phone 获取脚本数据(数组)
yysRouter.get('/theme/:appKey', controller.partner.show);// 根据appkey查询合作方主题
yysRouter.get('/agreements/:id', controller.partner.fetchAgreements);// 查询协议
yysRouter.post('/getToken', controller.token.partnerCreate);// 合作方创建token
yysRouter.post('/getOrderSn', controller.order.fetchOrderId);// 合作方获取订单号
yysRouter.post('/getThxdData', controller.order.partnerShow);// 合作方获取订单数据
yysRouter.post('/getThxdReport', controller.order.partnerShow);// 合作方获取订单报告
// yysRouter.get('/orderData/:appKey/:orderId', controller.order.orderShow);// 获取展示页面数据
// yysRouter.get('/scripts/:scriptId', controller.script.fetchOneScripts); // 获取单一脚本信息
};
// yysRouter.get('/help/:scriptId', controller.script.fetchHelpInfo); // 获取帮助信息
// yysRouter.get('/notice/:scriptId', controller.script.fetchNoticeInfo);// 获取提示信息
// yysRouter.get('/query_button/:scriptId', controller.script.fetchQueryButtonInfo);
}
'use strict';
module.exports = {
schedule: {
interval: '30m', // 30分钟间隔
type: 'all', // 所有woker
immediate: true,
},
async task(ctx) {
try {
ctx.service.schedules.appKeylist();
} catch (e) {
ctx.logger.error('【schedule/appkeyList】catch error:', JSON.stringify(e));
}
},
};
'use strict';
const Service = require('egg').Service;
class IndexService extends Service {
constructor(ctx) {
super(ctx);
const { config } = this;
}
_request(url, opts) {
const { ctx, baseURL } = this;
url = `${baseURL}${url}`;
opts = {
charset: 'utf-8',
timeout: [30000, 30000],
dataType: 'json',
...opts,
};
return ctx.curl(url, opts);
}
async getPhoneHtml(cityInfos, operator, phone) {
let loginHtml = `
<div class="input-box">
<label>手机号</label>
<div class="content">
<div class="input">
<input name="args[phone]" type="text" class="input-option required" value="${phone}" disabled/>
</div>
<div>
<select name="cid">
`;
cityInfos.map(item => {
if (operator.operator.indexOf(item.substr(-2, 2)) > -1) {
loginHtml += `<option value="${item}" selected="selected" >${item}</option>`;
} else {
loginHtml += `<option value="${item}">${item}</option>`;
}
});
loginHtml += `</select>
<label>${operator.province}${operator.operator}</label>
</div>
</div>
</div>`;
return loginHtml;
}
async getCityHtml(cityInfos, operator, InputVal) {
const paramMap = {
name: '姓名',
ID: '身份证',
password: '服务密码',
phoneCode: '验证码',
};
let formHtml = `<script type="text/template" id="carrier_dialog_template">
<div class="input-box">
<label>验证码</label>
<div class="content">
<div class="input">
<input name="args[code]" type="text" placeholder="请输入短信验证码" class="input-option required" data-label="验证码"/>
</div>
</div>
<button class="action phone-code-action" data-cd="60" data-id="operator-phone-code">免费获取</button>
</div>
</script>`;
cityInfos.map(param => {
if (param.name === 'name' || param.name === 'ID') {
formHtml += `
<div class="input-box">
<label>${paramMap[param.name]}</label>
<div class="content">
<div class="input">
<input name="args[${param.name}]" type="text" placeholder="请输入${paramMap[param.name]}" class="param input-option required " data-label="${paramMap[param.name]}" value="${InputVal[param.name]}"/>
</div>
</div>
</div>`;
}
if (param.name === 'phoneCode') {
formHtml += `
<div class="input-box">
<label>${paramMap[param.name]}</label>
<div class="content">
<div class="input">
<input name="args[${param.name}]" placeholder="请输入${paramMap[param.name]}" class="param input-option required " data-label="${paramMap[param.name]}"/>
</div>
</div>
<button class="action phone-code-action" data-cd="65" data-id="operator-phone-code">免费获取</button>
</div>`;
}
if (param.name === 'password') {
formHtml += `
<div class="input-box">
<label>${paramMap[param.name]}</label>
<div class="content">
<div class="input">
<input name="args[${param.name}]" type="password" placeholder="请输入${paramMap[param.name]}" class=" param input-option required " data-label="${paramMap[param.name]}" value="${InputVal[param.name]}"/>
</div>
</div>
</div>`;
}
});
formHtml += '<i id="carrier-config" data-auth="true" data-code0="true" data-code1="true"></i>';
return formHtml;
}
async getSMSHTML() {
return `<div class="input-box">
<label>验证码</label>
<div class="content">
<div class="input">
<input name="args[phoneCode]" type="text" placeholder="请输入短信验证码" class="input-option required" data-label="验证码"/>
</div>
</div>
<button class="action phone-code-action" data-cd="70" data-id="operator-phone-code">免费获取</button>
</div>`;
}
}
module.exports = IndexService;
......@@ -27,14 +27,17 @@ class OrderService extends Service {
/*
@desc 更新task
*/
async update(params) {
async update(data, where) {
const { ctx } = this;
const order = await ctx.model.TaskStatus.findAll({
where: { orderId: params.orderId },
order: [['createDate', 'DESC']],
where,
});
if (order.length === 0) {
ctx.throw(400, { message: 'no order' });
ctx.throw(400, { message: 'no orderId' });
return;
}
if (order.length > 1) {
ctx.throw(400, { message: 'error orderId or taskId' });
return;
}
for (const item of order) {
......@@ -43,12 +46,7 @@ class OrderService extends Service {
return;
}
}
const { appKey, taskId, notifyUrl, backUrl, userId, phone, operator, city } = order[0];
if (taskId) {
await ctx.model.TaskStatus.create({ appKey, status: 'init', notifyUrl, backUrl, userId, phone, operator, city, ...params });
} else {
await order[0].update(params);
}
await order[0].update(data);
return order[0];
}
}
......
......@@ -9,117 +9,6 @@ class PartnerService extends Service {
this.partnerAPI = partnerAPI;
}
async fetchTheme(appKey) {
const { ctx, partnerAPI: { fetchTheme, host, redisThemePrefix } } = this;
if (appKey) {
const data = await this.app.redis.get(redisThemePrefix + appKey);
if (data) {
try {
return JSON.parse(data);
} catch (err) {
ctx.logger.error('【Scripts】fetchParams', redisThemePrefix + appKey, 'result:', data, err);
await this.app.redis.del(redisThemePrefix + appKey);
}
}
}
const ret = await ctx.curl(`${host + fetchTheme}`, {
charset: 'utf-8',
timeout: [30000, 30000],
dataType: 'json',
method: 'GET',
data: {
appKey,
subject: 'hf',
},
});
ctx.logger.info(`【Partner】 fetchTheme ${host + fetchTheme}/${appKey}`, ret.data);
if (ret.status === 200 && ret.data && ret.data.length > 0 && ret.data[0].appKey === appKey) {
await this.app.redis.set(redisThemePrefix + appKey, JSON.stringify(ret.data[0]), 'EX', 300);
}
return ret.data[0];
}
async fetchInfo(appKey) {
const { ctx, partnerAPI: { fetchInfo, host, redisInfoPrefix } } = this;
if (appKey) {
const data = await this.app.redis.get(redisInfoPrefix + appKey);
if (data) {
try {
return JSON.parse(data);
} catch (err) {
ctx.logger.error('【Scripts】fetchInfo', redisInfoPrefix + appKey, 'result:', data, err);
await this.app.redis.del(redisInfoPrefix + appKey);
}
}
}
const ret = await ctx.curl(`${host + fetchInfo}`, {
charset: 'utf-8',
timeout: [30000, 30000],
dataType: 'json',
method: 'GET',
data: {
appKey,
},
});
ctx.logger.info(`【Partner】 fetchTheme ${host + fetchInfo}?appKey=${appKey}`, ret.data);
if (ret.status === 200 && ret.data && ret.data.length > 0 && ret.data[0].appKey === appKey) {
await this.app.redis.set(redisInfoPrefix + appKey, JSON.stringify(ret.data[0]), 'EX', 300);
}
return ret.data[0];
}
async fetchScripts(appKey) {
const { ctx, partnerAPI: { fetchScripts, host, redisScriptsPrefix } } = this;
if (appKey) {
const data = await this.app.redis.get(redisScriptsPrefix + appKey);
if (data) {
try {
return JSON.parse(data);
} catch (err) {
ctx.logger.error('【Partner】 fetchScripts', redisScriptsPrefix + appKey, 'result:', JSON.stringify(data), err);
await this.app.redis.del(redisScriptsPrefix + appKey);
}
}
}
const url = `${host + fetchScripts}/${appKey}`;
const ret = await ctx.curl(url, {
charset: 'utf-8',
timeout: [30000, 30000],
dataType: 'json',
method: 'GET',
});
ctx.logger.info(`【Partner】 fetchTheme ${url}`, JSON.stringify(ret.data));
if (ret.status === 200 && ret.data && ret.data.id === appKey) {
await this.app.redis.set(redisScriptsPrefix + appKey, JSON.stringify(ret.data), 'EX', 300);
}
return ret.data;
}
async fetchAgreements(id) {
const { ctx, partnerAPI: { fetchAgreements, host, redisAgreementsPrefix } } = this;
const data = await this.app.redis.get(redisAgreementsPrefix + id);
if (data) {
try {
return JSON.parse(data);
} catch (err) {
ctx.logger.error('【Partner】 fetchAgreements', redisAgreementsPrefix + id, 'result:', JSON.stringify(data), err);
await this.app.redis.del(redisAgreementsPrefix + id);
}
}
const url = `${host + fetchAgreements}/${id}`;
const ret = await ctx.curl(url, {
charset: 'utf-8',
timeout: [30000, 30000],
dataType: 'json',
method: 'GET',
});
ctx.logger.info(`【Partner】 fetchAgreements ${url}`, JSON.stringify(ret.data));
if (ret.status === 200 && ret.data && ret.data.id === id) {
await this.app.redis.set(redisAgreementsPrefix + id, JSON.stringify(ret.data), 'EX', 300);
}
return ret.data;
}
async notice(order, state, Num = 0) {
const { ctx, service } = this;
const { orderId, notifyUrl, userId } = order;
......
'use strict';
const Service = require('egg').Service;
class ScheduleService extends Service {
async appKeylist() {
const { ctx } = this;
const appKeylists = new Map();
const ret = await ctx.model.NodeLimit.findAll({
attributes: ['appKey', 'text2', 'currentCount', 'limitCount', 'customerUrl'],
where: { type: 'thxd' },
});
if (ret.length > 0) {
ret.map(customer => {
appKeylists.set(customer.appKey, {
text2: customer.text2,
customerUrl: customer.customerUrl,
});
});
ctx.app.appKeylists = appKeylists;
}
}
}
module.exports = ScheduleService;
'use strict';
const Service = require('egg').Service;
class ScriptsService extends Service {
constructor(ctx) {
super(ctx);
const { config } = this;
const { scriptsAPI } = config;
this.scriptsAPI = scriptsAPI;
this.baseURL = scriptsAPI.host;
this.fetchScriptsUrl = scriptsAPI.fetchScriptsUrl;
this.fetchOneScriptUrl = scriptsAPI.fetchOneScriptUrl;
this.fetchParamsInfoUrl = scriptsAPI.fetchParamsInfoUrl;
this.fetchHelpUrl = scriptsAPI.fetchHelpUrl;
this.redisScriptsKey = scriptsAPI.redisScriptsKey;
this.redisParamsKey = scriptsAPI.redisParamsKey;
this.redisScriptListKey = scriptsAPI.redisScriptListKey;
this.cityListUrl = scriptsAPI.cityListUrl;
}
async fetchScripts() {
const { baseURL, fetchScriptsUrl, redisScriptsKey, ctx } = this;
const data = await this.app.redis.get(redisScriptsKey);
if (data) {
try {
return JSON.parse(data);
} catch (err) {
ctx.logger.error('【Scripts】fetchScriptsFromRedis', 'result:', data, err);
await this.app.redis.del(redisScriptsKey);
}
}
const result = await ctx.curl(baseURL + fetchScriptsUrl, {
charset: 'utf-8',
timeout: [30000, 30000],
dataType: 'json',
contentType: 'json',
});
ctx.logger.info(`【Scripts】fetchScripts,${baseURL + fetchScriptsUrl}`, 'result:', JSON.stringify(result.data));
if (result.data && result.data.length > 0) {
await this.app.redis.set(redisScriptsKey, JSON.stringify(result.data), 'EX', 300);
}
return result.data;
}
async fetchOneScripts(scriptId) {
const { baseURL, fetchOneScriptUrl, redisScriptListKey, ctx } = this;
const data = await this.app.redis.get(redisScriptListKey + scriptId);
if (data) {
try {
return JSON.parse(data);
} catch (err) {
ctx.logger.error('【Scripts】fetchOneScriptsFromRedis', 'result:', data, err);
await this.app.redis.del(redisScriptListKey + scriptId);
}
}
const result = await ctx.curl(baseURL + fetchOneScriptUrl + '/' + scriptId, {
charset: 'utf-8',
timeout: [30000, 30000],
dataType: 'json',
contentType: 'json',
});
if (result.data && (String(result.data.id) === scriptId)) {
await this.app.redis.set(redisScriptListKey + scriptId, JSON.stringify(result.data), 'EX', 60);
}
return result.data;
}
async fetchParams(refresh = false) {
const { baseURL, fetchParamsInfoUrl, redisParamsKey, ctx } = this;
if (!refresh) {
const data = await this.app.redis.get(redisParamsKey);
if (data) {
try {
return JSON.parse(data);
} catch (err) {
ctx.logger.error('【Scripts】fetchParams', 'result:', data, err);
await this.app.redis.del(redisParamsKey);
}
}
}
const result = await ctx.curl(baseURL + fetchParamsInfoUrl, {
charset: 'utf-8',
timeout: [30000, 30000],
dataType: 'json',
contentType: 'json',
});
ctx.logger.info(`【Scripts】fetchParams,${baseURL + fetchParamsInfoUrl}`, 'result:', JSON.stringify(result.data));
if (result.data && result.data.length > 0) {
await this.app.redis.set(redisParamsKey, JSON.stringify(result.data), 'EX', 300);
}
return result.data;
}
async fetchHelp(scriptId) {
const { baseURL, scriptsAPI: { fetchHelpUrl }, ctx } = this;
const result = await ctx.curl(baseURL + fetchHelpUrl + '/' + scriptId, {
charset: 'utf-8',
timeout: [30000, 30000],
dataType: 'json',
contentType: 'json',
});
return result.data;
}
async fetchQueryButton(scriptId) {
const { baseURL, scriptsAPI: { fetchQueryButtonUrl }, ctx } = this;
const result = await ctx.curl(baseURL + fetchQueryButtonUrl + '/' + scriptId, {
charset: 'utf-8',
timeout: [30000, 30000],
dataType: 'json',
contentType: 'json',
});
return result.data;
}
async fetchNotice(scriptId) {
const { baseURL, scriptsAPI: { fetchNoticeUrl }, ctx } = this;
const result = await ctx.curl(baseURL + fetchNoticeUrl + '/' + scriptId, {
charset: 'utf-8',
timeout: [30000, 30000],
dataType: 'json',
contentType: 'json',
});
return result.data;
}
async fetchHubSeripts(hubId) {
const { baseURL, scriptsAPI: { fetchHubSeriptsUrl }, ctx } = this;
if (!hubId) {
ctx.throw(400, '手机号码区域验证失败');
}
const result = await ctx.curl(baseURL + fetchHubSeriptsUrl + '/' + hubId + '/scripts', {
charset: 'utf-8',
timeout: [30000, 30000],
dataType: 'json',
contentType: 'json',
});
return result.data;
}
async fetchScriptByCityName(name) {
const { baseURL, scriptsAPI: { fetchScriptByCityNameUrl }, ctx } = this;
const result = await ctx.curl(baseURL + fetchScriptByCityNameUrl + '?name=' + encodeURIComponent(name) + '&type=query', {
charset: 'utf-8',
timeout: [30000, 30000],
dataType: 'json',
contentType: 'json',
});
ctx.logger.info(`fetchScriptByCityName,${baseURL + fetchScriptByCityNameUrl + '?name=' + name}`, 'result:', JSON.stringify(result.data));
if (result.status === 200) {
return result.data;
}
ctx.throw(400, '手机号码区域验证失败');
}
async fetchScriptName(scriptId) {
try {
const city = await this.fetchOneScripts(scriptId);
return city.name || '未知';
} catch (err) {
return '未知';
}
}
// eslint-disable-next-line no-empty-function
async getCityList(params) {
try {
const { cityListUrl, ctx } = this;
const result = await ctx.curl(cityListUrl, {
charset: 'utf-8',
timeout: [30000, 30000],
dataType: 'json',
contentType: 'json',
method: 'POST',
data: params,
});
return result.data;
} catch (err) {
this.ctx.logger.error(err);
return { code: -1, msg: '系统错误,请稍后重试' };
}
}
}
module.exports = ScriptsService;
......@@ -43,8 +43,23 @@ class TaskService extends Service {
method: 'get',
contentType: 'json',
});
ctx.logger.info(`【Task】config ${configUrl} params`, JSON.stringify(result.data));
ctx.logger.info(`【Task】config ${configUrl}`);
this._checkSuccess(result);
const cityMap = new Map();
const provMap = new Map();
result.data.data.map(prov => {
prov.citys.map(city => {
cityMap.set(city.name + city.operatorTypeName, city);
if (!provMap.has(city.name)) {
provMap.set(city.name, []);
}
if (city.state === 1) {
provMap.get(city.name).push(city.name + city.operatorTypeName);
}
});
});
ctx.app.cityMap = cityMap;
ctx.app.provMap = provMap;
return result.data.data;
}
......@@ -60,7 +75,7 @@ class TaskService extends Service {
},
contentType: 'json',
});
ctx.logger.info(`【Task】create ${createTaskUrl} cityId: ${JSON.stringify(data)} result:`, JSON.stringify(result.data.code));
ctx.logger.info(`【Task】create ${createTaskUrl} cityId: ${JSON.stringify(data)} result:`, JSON.stringify(result.data));
this._checkSuccess(result);
return result.data.data;
}
......@@ -95,7 +110,7 @@ class TaskService extends Service {
});
ctx.logger.info(`【Task】submit ${submitTaskUrl} params`, JSON.stringify(data), JSON.stringify(result.data));
this._checkSuccess(result);
return result;
return result.data;
}
async fetchTask(data) {
......
<html>
<head>
{{>head2}}
</head>
<body>
<section>
<div class="pannel">
<div class="wrapper ">
<div class="failed">
<div class="icon"></div>
<span class="title">{{message}}</span>
</div>
</div>
</div>
</section>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
{{>head2}}
<script type='text/javascript'>
var _vds = _vds || [];
window._vds = _vds;
(function(){
_vds.push(['setAccountId', 'ba26b3e0fa61a0aa']);
(function() {
var vds = document.createElement('script');
vds.type='text/javascript';
vds.async = true;
vds.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'dn-growing.qbox.me/vds.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(vds, s);
})();
})();
</script>
<script type="text/javascript" src="../public/js/query.js"></script>
<script id="constant" type="text/json">
{"project_root":"\/yysh5\/","script_root":"\/yysh5\/","debug":false,"developer":true,"user_id":"1000000000","hasclick":false,"orderState":"{{State}}","orderNum":"{{OrderNum}}","taskId":"{{TaskId}}","redirectUrl":"{{{redirectUrl}}}","phone":"{{{phone}}}","appKey":"{{{appKey}}}","scriptId":"{{{scriptId}}}"}
</script>
<style>.footer {
text-align: center;
color: #a6a6a6;
width: 100%;
}
.footer::before {
padding: 10px 0 0;
content: "保护信息安全,杜绝隐私泄露";
font-size: 1.08333333rem;
display: block;
line-height: 120%;
}
.footer::after {
padding: 4px 0 10px;
content: "";
font-size: 0.83333333rem;
display: block;
line-height: 120%;
}
.footer.float {
position: fixed;
bottom: 0;
}</style>
</head>
<body>
<div class="container">
<!--<section style="position: fixed; height: 100%; width: 100% ;z-index: 1000 ;background-color: #fff">-->
<!--<div class="pannel">-->
<!--<div class="wrapper ">-->
<!--<div class="failed">-->
<!--<div class="icon"></div>-->
<!--<span class="title">系统维护中</span>-->
<!--<p>预计 2017-07-09 19:50:00 恢复</p>-->
<!--</div>-->
<!--</div>-->
<!--</div>-->
<!--</section>-->
<section class="user-fields-dashboard">
{{{phoneHtml}}}
<section id="form" class="user-field-dashboard">
{{{formHtml}}}
<input class="static-element" type="hidden" name="job_sid" value="0" version='1' />
<input class="static-element" type="hidden" name="task_id" value="0" version='2' />
</section>
<section class="ico-text-dashboard expr-lovely cirque-loader loading" id="loading-dashboard">
<div class="loader"></div>
<div class="ico"></div>
<div class="highlight"></div>
<div class="description"></div>
</section>
<div class="css-shadow"></div>
<section class="css-loader-dash">
<div class="css-loader">
<div id="rond">
<div id="test"></div>
</div>
<div id="load">
<p>查询中,请稍后</p>
</div>
</div>
</section>
<section class="canvas-dashboard">
<p class="label"></p>
<div class="loader">
<canvas></canvas>
</div>
</section>
</section>
<section class="agr wrapper checkbox-wrapper">
<div ><div class="checkbox" >
<input type="checkbox" class="input-option required-checked" autocomplete="off" id="check" data-msg="须勾选 同意《运营商授权协议》">
<label for="check"></label>
</div>
<span>同意</span><a>{{{protocol}}}</a></div>
<div ><div class="checkbox" >
<input type="checkbox" class="input-option " autocomplete="off" id="remPwd" name="remPwd" value="1">
<!--<label for="remPwd"></label>-->
<!--</div>-->
<!--<span>记住密码</span></div>-->
</section>
<section class="wrapper">
<button disabled id="submit" class="btn btn-blue">&nbsp;&nbsp;&nbsp;&nbsp;</button>
</section>
<section class="wrapper note-field">
<!--<p><span style="color:red">注意:我们将于2017年8月4日21:00-21:30进行系统升级,由此给您带来不便,敬请谅解。</span></p>-->
<p>温馨提示:</p>
<p>1.请授权本人实名认证的手机号。(使用满3个月)</p>
<p>2.登录成功后将收到运营商通知短信,无需回复。</p>
<p>3.根据运营商网络情况不同,授权服务需要1-3分钟时间才能完成,请耐心等待。 如果您发现等待时间过长,可以选择非网络高峰期的时间重新授权。</p>
<p>4.如账户名与密码不匹配,建议您先到运营商官网查询能否正常登录,如登录失败,请联系运营商客服;如登录成功,请提供截图,及时与我方客服联系。</p>
<!--<p>5.授权不成功可拨打客服电话-->
<!--<a href="tel:4008635151" class="kefu">4008635151</a>-->
<!--</p>-->
</section>
<script type="text/template" id="template_ctcc">
<p>方式一:您可发送短信“MMCZ”至10001重置服务密码。<a href='sms:10001?body=MMCZ'>点击发送</a></p>
<p>方式二:进入中国电信网上营业厅登录界面,点击“忘记密码”,进行密码重置。点击前往<a href="http://login.189.cn">http://login.189.cn</a></p>
<p>方式三:您可拨打<a href="tel:10001">10001</a>,按语音提示操作,或转人工客服;</p>
</script>
<script type="text/template" id="template_ctcc_0">
<p>方式一:您可发送短信 MMXG#原密码#新密码”到10001重置服务密码。<a href='sms:10001?body=MMXG#原密码#新密码'>点击发送</a></p>
<p>方式二:进入中国电信网上营业厅登录界面,点击“忘记密码”,进行密码重置。点击前往<a href="http://login.189.cn">http://login.189.cn</a></p>
<p>方式三:您可拨打<a href="tel:10001">10001</a>,按语音提示操作,或转人工客服;</p>
</script>
<script type="text/template" id="template_cmcc">
<p>方式一:您可拨打<a href="tel:10086">10086</a>,按语音提示操作,或转人工客服;</p>
<p>方式二:登录中国移动网上营业厅,点击“我的移动” >> “忘记密码” (重置密码/找回密码),进行密码重置。点击前往<a href="http://www.10086.cn">http://www.10086.cn</a></p>
</script>
<script type="text/template" id="template_cmcc_0">
<p>方式一:您可发送短信“#{bodyHtml}”至10086重置服务密码#{ps}<a href='sms:10086?body=#{body}'>点击发送</a></p>
<p>方式二:登录中国移动网上营业厅,点击“我的移动” >> “忘记密码” (重置密码/找回密码),进行密码重置。点击前往<a href="http://www.10086.cn">http://www.10086.cn</a></p>
<p>方式三:您可拨打<a href="tel:10086">10086</a>,按语音提示操作,或转人工客服;</p>
</script>
<script type="text/template" id="template_cmcc_1">
<p>方式一:您可发送短信“#{bodyHtml}”,按短信提示继续#{ps}<a href='sms:10086?body=#{body}'>点击发送</a></p>
<p>方式二:登录中国移动网上营业厅,点击“我的移动” >> “忘记密码” (重置密码/找回密码),进行密码重置。点击前往<a href="http://www.10086.cn">http://www.10086.cn</a></p>
<p>方式三:您可拨打<a href="tel:10086">10086</a>,按语音提示操作,或转人工客服;</p>
</script>
<script type="text/template" id="template_cmcc_2">
<p>方式一:全球通个人客户可发送短信“#{bodyHtml}”至10086重置服务密码#{ps}<a href='sms:10086?body=#{body}'>点击发送</a></p>
<p>方式二:登录中国移动网上营业厅,点击“我的移动” >> “忘记密码” (重置密码/找回密码),进行密码重置。点击前往<a href="http://www.10086.cn">http://www.10086.cn</a></p>
<p>方式三:您可拨打<a href="tel:10086">10086</a>,按语音提示操作,或转人工客服;</p>
</script>
<script type="text/template" id="template_cucc">
<p>方式一:发送短信“MMCZ#<span class="hl">6位新密码</span>#<span class="hl">证件号后6位</span>”至10010重置服务密码<span class="ps">红色部分需手动填写</span>。<a href="sms:10010?body=MMCZ%236%E4%BD%8D%E6%96%B0%E5%AF%86%E7%A0%81">点击发送</a></p>
<p>方式二:进入中国联通网上营业厅登录界面,点击“忘记密码”,进行密码重置。点击前往<a href="http://uac.10010.com">http://uac.10010.com</a></p>
<p>方式三:您可拨打<a href="tel:10010">10010</a>,按语音提示操作,或转人工客服;</p>
</script>
</div>
<div class="footer"></div>
<script type="text/javascript">
var container = $(".container");
container.length && $(".footer").length && (function(){
var rejustFooter = function(){
var windowHeight = document.documentElement.clientHeight;
var container = $(".container");
var footer = $(".footer");
container.length && footer.length && (function(){
var footerHeight = footer[0].offsetHeight + (+$(".container>*:eq(0)").css("margin-top").replace("px",''));
container.css({'min-height':Math.floor(windowHeight-footerHeight)+'px'});
})();
}
window.onresize = rejustFooter;
rejustFooter();
})();
</script>
</body>
</html>
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="pragma" content="no-cache" />
<meta name="format-detection" content="telephone=no" />
<meta name="viewport"
content="width=device-width, initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<title>运营商授权</title>
</head>
<body>
<style type="text/css">
body {
margin: 0;
}
h1 {
padding: 26px 22px 14px 22px;
color: #333;
font-size: 20px;
text-align: center;
font-weight: bold;
margin: 0;
}
h2 {
padding: 18px 20px 5px 22px;
color: #333;
font-size: 14px;
margin: 0;
/* text-align: center; */
}
p {
whitewhite-space: pre-wrap;
whitewhite-space: -moz-pre-wrap;
whitewhite-space: -pre-wrap;
whitewhite-space: -o-pre-wrap;
word-wrap: break-word;
font-size: 13px;
color: #707A8D;
margin: 0 22px 0 22px;
padding: 0;
line-height: 18px;
/* text-indent: 25px; */
}
p .bold {
font-weight: bold;
}
a {
color: #439df8;
text-decoration: none;
}
.underline {
width: 72px;
height: 7px;
background: #707A8D;
margin-left: 22px;
position: relative;
top: -10px;
opacity: 0.3;
}
</style>
<section class="protocal">
<div style="background: rgba(240,242,245,0.5);padding-bottom:23px">
<h1>欢迎使用运营商信息查询服务</h1>
<p>您在注册我们APP后,基于包括查询您本人的运营商数据及数据分析,申请使用我们的运营商查询服务。
<br>我们需要您授权我们获取您的以下权限和信息:
</p>
<div>
<h2>运营商账户</h2>
<div class="underline"></div>
</div>
<p>手机号、服务密码注册信息(根据所在城市不同,可能包含姓名,身份证号等)
</p>
<div>
<h2>运营商信息</h2>
<div class="underline"></div>
</div>
<p>包含但不限于基本信息、套餐详情、通话详单信息等</p>
</div>
<p style="margin-top: 18px">
在您点击“同意”按钮等操作后,即表示您已同意授权我们基于<a href="https://p.jianbing.com/ssr-view/agreement/"
target="_parent">《用户注册协议》</a>并按照本<a
href="https://p.jianbing.com/ssr-view/agreement/yinsi"
target="_parent">《隐私政策》</a>的约定查询、收集、更新、管理、编辑、存储、解析您的个人信息。
<br>更多专项授权信息请查看完整版<a href="https://p.jianbing.com/ssr-view/agreement/yys_analysis" target="_parent">《信息查询授权委托书》</a>
</p>
</section>
</body>
</html>
\ No newline at end of file
<meta charset="utf-8"/>
<meta http-equiv="pragma" content="no-cache"/>
<meta name="format-detection" content="telephone=no"/>
<meta name="viewport"
content="width=device-width, initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
<meta name="apple-mobile-web-app-capable" content="yes"/>
<title>运营商授权</title>
<link rel="stylesheet" href="../public/css/common.css"/>
<link rel="stylesheet" href="../public/css/style.css"/>
<link rel="stylesheet" href="../public/css/zepto.ui.css"/>
<link rel="stylesheet" href="../public/css/style(1).css"/>
<script type="text/javascript" src="../public/js/zepto.js"></script>
<script type="text/javascript" src="../public/js/common.js"></script>
<script type="text/javascript" src="../public/js/scheduler.js"></script>
<script type="text/javascript" src="../public/js/zepto.plugin.js"></script>
<script type="text/javascript" src="../public/js/zepto.ui.js"></script>
<script type="text/javascript" src="../public/js/console.js"></script>
<script type="text/javascript" src="../public/js/canvas.js"></script>
!DOCTYPE html>
<html>
<head>
{{>head2}}
<script type='text/javascript'>
var _vds = _vds || [];
window._vds = _vds;
(function(){
_vds.push(['setAccountId', 'ba26b3e0fa61a0aa']);
(function() {
var vds = document.createElement('script');
vds.type='text/javascript';
vds.async = true;
vds.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'dn-growing.qbox.me/vds.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(vds, s);
})();
})();
</script>
<script type="text/javascript" src="/td/shujumoheQuery.js"></script>
<script id="constant" type="text/json">
{"project_root":"\/td\/query\/","script_root":"\/td\/query\/carrier\/","debug":false,"developer":true,"user_id":"1000000000","hasclick":false,"orderState":"{{State}}","orderNum":"{{OrderNum}}","taskId":"{{TaskId}}","redirectUrl":"{{{redirectUrl}}}"}
</script>
<style>.footer {
text-align: center;
color: #a6a6a6;
width: 100%;
}
.footer::before {
padding: 10px 0 0;
content: "保护信息安全,杜绝隐私泄露";
font-size: 1.08333333rem;
display: block;
line-height: 120%;
}
.footer::after {
padding: 4px 0 10px;
/*content: "©本服务由51公积金管家提供";*/
font-size: 0.83333333rem;
display: block;
line-height: 120%;
}
.footer.float {
position: fixed;
bottom: 0;
}</style>
</head>
<body>
{{!--<section style="position: fixed; height: 100%; width: 100% ;z-index: 1000 ;background-color: #fff">
<div class="pannel">
<div class="wrapper ">
<div class="failed">
<div class="icon"></div>
<span class="title">系统维护中</span>
<p>预计 2017-07-08 14:40:00 恢复</p>
</div>
</div>
</div>
</section>--}}
<div class="container">
<section class="user-fields-dashboard">
{{{phoneHtml}}}
<section id="form" class="user-field-dashboard">
{{{formHtml}}}
<input class="static-element" type="hidden" name="job_sid" value="0" version='1' />
<input class="static-element" type="hidden" name="task_id" value="0" version='2' />
</section>
<section class="ico-text-dashboard expr-lovely cirque-loader loading" id="loading-dashboard">
<div class="loader"></div>
<div class="ico"></div>
<div class="highlight"></div>
<div class="description"></div>
</section>
<section class="canvas-dashboard">
<p class="label"></p>
<div class="loader">
<canvas></canvas>
</div>
</section>
</section>
<section class="agr wrapper checkbox-wrapper">
<div ><div class="checkbox" >
<input type="checkbox" checked="checked" class="input-option " autocomplete="off" id="remPwd" name="remPwd" value="1">
<!--<label for="remPwd"></label>-->
<!--</div>-->
<!--<span>记住密码</span></div>-->
<div ><div class="checkbox" >
<input type="checkbox" checked="checked" class="input-option required-checked" autocomplete="off" id="check" data-msg="须勾选 同意《运营商授权协议》">
<label for="check"></label>
</div>
<span>同意</span><a>《运营商授权协议》</a></div>
</section>
<section class="wrapper">
<button disabled id="submit" class="btn btn-blue">&nbsp;&nbsp;&nbsp;&nbsp;</button>
</section>
<section class="wrapper note-field">
<!--<p><span style="color:red">注意:我们将于2017年8月4日21:00-21:30进行系统升级,由此给您带来不便,敬请谅解。</span></p>-->
<p>温馨提示:</p>
<p>1.请授权本人实名认证的手机号。(使用满3个月)</p>
<p>2.登录成功后将收到运营商通知短信,无需回复。</p>
<p>3.根据运营商网络情况不同,授权服务需要1-3分钟时间才能完成,请耐心等待。 如果您发现等待时间过长,可以选择非网络高峰期的时间重新授权。</p>
<p>4.如账户名与密码不匹配,建议您先到运营商官网查询能否正常登录,如登录失败,请联系运营商客服;如登录成功,请提供截图,及时与我方客服联系。</p>
<!--<p>5.授权不成功可拨打客服电话<a href="tel:4008635151" class="kefu">4008635151</a></p>-->
</section>
<script type="text/template" id="template_ctcc">
<p>方式一:您可发送短信“MMCZ”至10001重置服务密码。<a href='sms:10001?body=MMCZ'>点击发送</a></p>
<p>方式二:进入中国电信网上营业厅登录界面,点击“忘记密码”,进行密码重置。点击前往<a href="http://login.189.cn">http://login.189.cn</a></p>
<p>方式三:您可拨打<a href="tel:10001">10001</a>,按语音提示操作,或转人工客服;</p>
</script>
<script type="text/template" id="template_ctcc_0">
<p>方式一:您可发送短信 MMXG#原密码#新密码”到10001重置服务密码。<a href='sms:10001?body=MMXG#原密码#新密码'>点击发送</a></p>
<p>方式二:进入中国电信网上营业厅登录界面,点击“忘记密码”,进行密码重置。点击前往<a href="http://login.189.cn">http://login.189.cn</a></p>
<p>方式三:您可拨打<a href="tel:10001">10001</a>,按语音提示操作,或转人工客服;</p>
</script>
<script type="text/template" id="template_cmcc">
<p>方式一:您可拨打<a href="tel:10086">10086</a>,按语音提示操作,或转人工客服;</p>
<p>方式二:登录中国移动网上营业厅,点击“我的移动” >> “忘记密码” (重置密码/找回密码),进行密码重置。点击前往<a href="http://www.10086.cn">http://www.10086.cn</a></p>
</script>
<script type="text/template" id="template_cmcc_0">
<p>方式一:您可发送短信“#{bodyHtml}”至10086重置服务密码#{ps}<a href='sms:10086?body=#{body}'>点击发送</a></p>
<p>方式二:登录中国移动网上营业厅,点击“我的移动” >> “忘记密码” (重置密码/找回密码),进行密码重置。点击前往<a href="http://www.10086.cn">http://www.10086.cn</a></p>
<p>方式三:您可拨打<a href="tel:10086">10086</a>,按语音提示操作,或转人工客服;</p>
</script>
<script type="text/template" id="template_cmcc_1">
<p>方式一:您可发送短信“#{bodyHtml}”,按短信提示继续#{ps}<a href='sms:10086?body=#{body}'>点击发送</a></p>
<p>方式二:登录中国移动网上营业厅,点击“我的移动” >> “忘记密码” (重置密码/找回密码),进行密码重置。点击前往<a href="http://www.10086.cn">http://www.10086.cn</a></p>
<p>方式三:您可拨打<a href="tel:10086">10086</a>,按语音提示操作,或转人工客服;</p>
</script>
<script type="text/template" id="template_cmcc_2">
<p>方式一:全球通个人客户可发送短信“#{bodyHtml}”至10086重置服务密码#{ps}<a href='sms:10086?body=#{body}'>点击发送</a></p>
<p>方式二:登录中国移动网上营业厅,点击“我的移动” >> “忘记密码” (重置密码/找回密码),进行密码重置。点击前往<a href="http://www.10086.cn">http://www.10086.cn</a></p>
<p>方式三:您可拨打<a href="tel:10086">10086</a>,按语音提示操作,或转人工客服;</p>
</script>
<script type="text/template" id="template_cucc">
<p>方式一:发送短信“MMCZ#<span class="hl">6位新密码</span>#<span class="hl">证件号后6位</span>”至10010重置服务密码<span class="ps">红色部分需手动填写</span>。<a href="sms:10010?body=MMCZ%236%E4%BD%8D%E6%96%B0%E5%AF%86%E7%A0%81">点击发送</a></p>
<p>方式二:进入中国联通网上营业厅登录界面,点击“忘记密码”,进行密码重置。点击前往<a href="http://uac.10010.com">http://uac.10010.com</a></p>
<p>方式三:您可拨打<a href="tel:10010">10010</a>,按语音提示操作,或转人工客服;</p>
</script>
</div>
<div class="footer"></div>
<script type="text/javascript">
var container = $(".container");
container.length && $(".footer").length && (function(){
var rejustFooter = function(){
var windowHeight = document.documentElement.clientHeight;
var container = $(".container");
var footer = $(".footer");
container.length && footer.length && (function(){
var footerHeight = footer[0].offsetHeight + (+$(".container>*:eq(0)").css("margin-top").replace("px",''));
container.css({'min-height':Math.floor(windowHeight-footerHeight)+'px'});
})();
}
window.onresize = rejustFooter;
rejustFooter();
})();
</script>
</body>
</html>
......@@ -28,5 +28,13 @@ module.exports = appInfo => {
credentials: true,
};
config.view = {
defaultViewEngine: 'handlebars',
defaultExtension: '.hbs',
mapping: {
'.hbs': 'handlebars',
},
};
return config;
};
......@@ -30,34 +30,6 @@ module.exports = () => {
configUrl: '/configs',
};
config.partnerAPI = {
host: 'https://uat-nginx.jianbing.com/zeus-api/v1',
fetchTheme: '/chaos/theme',
fetchScripts: '/chaos/partners/scripts',
fetchAgreements: '/chaos/agreements',
redisThemePrefix: 'URANUS.YYS.PARNTERS.THEME',
redisScriptsPrefix: 'URANUS.YYS.PARNTERS.SCRIPTS',
redisAgreementsPrefix: 'URANUS.YYS.PARNTERS.Agreements',
fetchInfo: '/chaos/partner',
redisInfoPrefix: 'URANUS.YYS.PARNTERS.Info',
redisappKeyLimitPrefix: 'URANUS.YYS.PARNTERS.Limit',
};
config.scriptsAPI = {
host: 'https://uat-nginx.jianbing.com/zeus-api/v1',
fetchScriptsUrl: '/chaos/yys/two_dimension_array/queries',
fetchOneScriptUrl: '/chaos/yys/two_dimension_array/info',
fetchParamsInfoUrl: '/chaos/yys/login_param_map',
fetchQueryButtonUrl: '/chaos/yys/query_button',
fetchHelpUrl: '/chaos/yys/help',
fetchNoticeUrl: '/chaos/yys/notice',
fetchHubSeriptsUrl: '/chaos/yys/hubs',
fetchScriptByCityNameUrl: '/chaos/yys/city_scripts',
redisScriptsKey: 'URANUS.YYS.SCRIPTS',
redisParamsKey: 'URANUS.YYS.PARAMS',
redisScriptListKey: 'URANUS.YYS.SCRIPTLIST',
};
config.phoneAreaAPI = {
bdhost: 'http://mobsec-dianhua.baidu.com/dianhua_api/open/location?tel=',
alhost: 'https://tcc.taobao.com/cc/json/mobile_tel_segment.htm?tel=',
......@@ -103,14 +75,13 @@ module.exports = () => {
baseDir: 'model',
dialect: 'mysql',
host: 'rm-bp1272001633qc0x9o.mysql.rds.aliyuncs.com',
database: 'data_service_uat',
database: 'nodetest',
username: 'hexin',
password: 'gYUHszn9#q',
port: 3306,
}],
};
config.callbackUrl = 'https://uat-nginx.jianbing.com/yysh5/callback';
config.dataCallbackUrl = 'https://uat-nginx.jianbing.com/yysh5/dataCallback';
config.newdataCallbackUrl = 'https://uat-nginx.jianbing.com/yysh5/newdataCallback';
......
......@@ -32,3 +32,8 @@ exports.validate = {
enable: true,
package: 'egg-validate',
};
exports.handlebars = {
enable: true,
package: 'egg-view-handlebars',
};
......@@ -12,10 +12,12 @@
"egg-scripts": "^2.5.0",
"egg-sequelize": "^4.2.0",
"egg-validate": "^2.0.2",
"iconv-lite": "^0.4.24",
"egg-view-handlebars": "^2.0.1",
"md5-node": "^1.0.1",
"mysql2": "^1.6.4",
"node-cache": "^4.2.0",
"node-uuid": "^1.4.8"
"node-uuid": "^1.4.8",
"uuid": "^8.3.0"
},
"devDependencies": {
"autod": "^3.0.1",
......@@ -31,9 +33,9 @@
"node": ">=8.9.0"
},
"scripts": {
"start": "egg-scripts start --daemon --title=egg-server-yys_h5_server",
"stop": "egg-scripts stop --title=egg-server-yys_h5_server",
"docker": "eggctl start --title=egg-server-yys_h5_serverr",
"start": "egg-scripts start --daemon --title=egg-server-gjj_h5_server",
"stop": "egg-scripts stop --title=egg-server-gjj_h5_server",
"docker": "eggctl start --title=egg-server-gjj_h5_serverr",
"dev": "egg-bin dev",
"debug": "egg-bin debug",
"test": "npm run lint -- --fix && npm run test-local",
......@@ -50,6 +52,6 @@
"type": "git",
"url": ""
},
"author": "jd",
"author": "",
"license": "MIT"
}
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