save
This commit is contained in:
Vendored
+14
-64
@@ -119,10 +119,10 @@ class ActiveEpc {
|
||||
|
||||
__check(v, re, msg, reject) {
|
||||
if (!re.test(v)) {
|
||||
return {
|
||||
reject && reject({
|
||||
msg,
|
||||
code: "C0"
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -137,23 +137,9 @@ class ActiveEpc {
|
||||
})
|
||||
}
|
||||
|
||||
var e = _this.__check(uid, /\d{1,2}/g, "用户编号填写错误!")
|
||||
if ( e ) {
|
||||
reject && reject(e);
|
||||
return
|
||||
}
|
||||
|
||||
e = _this.__check(utype, /\d{1}/g, "用户类型填写错误!");
|
||||
if ( e ) {
|
||||
reject && reject(e);
|
||||
return
|
||||
}
|
||||
|
||||
e = _this.__check(pwd, /\d{6}/g, "密码填写错误!");
|
||||
if ( e ) {
|
||||
reject && reject(e);
|
||||
return
|
||||
}
|
||||
_this.__check(uid, /\d{1,2}/g, "用户编号填写错误!", reject);
|
||||
_this.__check(utype, /\d{1}/g, "用户类型填写错误!", reject);
|
||||
_this.__check(pwd, /\d{6}/g, "密码填写错误!", reject);
|
||||
|
||||
_this.__send("login", {
|
||||
uid, utype, pwd
|
||||
@@ -213,11 +199,7 @@ class ActiveEpc {
|
||||
var _this = this;
|
||||
return new Promise(function (resolve, reject) {
|
||||
|
||||
var e = _this.__check(minutes, /\d{1,2}/g, "时间填写错误!");
|
||||
if ( e ) {
|
||||
reject && reject(e);
|
||||
return
|
||||
}
|
||||
_this.__check(minutes, /\d{1,2}/g, "时间填写错误!", reject);
|
||||
|
||||
var v = parseInt(minutes, 10);
|
||||
if( v > 20 || v < 2 ) {
|
||||
@@ -257,21 +239,9 @@ class ActiveEpc {
|
||||
})
|
||||
}
|
||||
|
||||
var e = _this.__check(uid, /\d{1,2}/g, "用户编号填写错误!");
|
||||
if ( e ) {
|
||||
reject && reject(e);
|
||||
return
|
||||
}
|
||||
e = _this.__check(utype, /\d{1}/g, "用户类型填写错误!");
|
||||
if ( e ) {
|
||||
reject && reject(e);
|
||||
return
|
||||
}
|
||||
e = _this.__check(pwd, /\d{6}/g, "密码填写错误!");
|
||||
if ( e ) {
|
||||
reject && reject(e);
|
||||
return
|
||||
}
|
||||
_this.__check(uid, /\d{1,2}/g, "用户编号填写错误!", reject);
|
||||
_this.__check(utype, /\d{1}/g, "用户类型填写错误!", reject);
|
||||
_this.__check(pwd, /\d{6}/g, "密码填写错误!", reject);
|
||||
|
||||
_this.__send("modifyPassword", {
|
||||
uid, utype, pwd
|
||||
@@ -299,31 +269,11 @@ class ActiveEpc {
|
||||
|
||||
|
||||
|
||||
var e = _this.__check(accu, /\d{1,32}/g, "收方账户填写错误!");
|
||||
if ( e ) {
|
||||
reject && reject(e);
|
||||
return
|
||||
}
|
||||
e = _this.__check(ticketType, /\d{1}/g, "票据类型填写错误!");
|
||||
if ( e ) {
|
||||
reject && reject(e);
|
||||
return
|
||||
}
|
||||
e = _this.__check(ticketNo, /\d{1,8}/g, "票据编号填写错误!");
|
||||
if ( e ) {
|
||||
reject && reject(e);
|
||||
return
|
||||
}
|
||||
e = _this.__check(date, /^(?:(?:1[6-9]|[2-9][0-9])[0-9]{2}([-/.]?)(?:(?:0?[1-9]|1[0-2])\1(?:0?[1-9]|1[0-9]|2[0-8])|(?:0?[13-9]|1[0-2])\1(?:29|30)|(?:0?[13578]|1[02])\1(?:31))|(?:(?:1[6-9]|[2-9][0-9])(?:0[48]|[2468][048]|[13579][26])|(?:16|[2468][048]|[3579][26])00)([-/.]?)0?2\2(?:29))$/g, "时间填写错误!", reject);
|
||||
if ( e ) {
|
||||
reject && reject(e);
|
||||
return
|
||||
}
|
||||
e = _this.__check(banlance, /\d{1,16}/g, "金额填写错误!");
|
||||
if ( e ) {
|
||||
reject && reject(e);
|
||||
return
|
||||
}
|
||||
_this.__check(accu, /\d{1,32}/g, "收方账户填写错误!", reject);
|
||||
_this.__check(ticketType, /\d{1}/g, "票据类型填写错误!", reject);
|
||||
_this.__check(ticketNo, /\d{1,8}/g, "票据编号填写错误!", reject);
|
||||
_this.__check(date, /^(?:(?:1[6-9]|[2-9][0-9])[0-9]{2}([-/.]?)(?:(?:0?[1-9]|1[0-2])\1(?:0?[1-9]|1[0-9]|2[0-8])|(?:0?[13-9]|1[0-2])\1(?:29|30)|(?:0?[13578]|1[02])\1(?:31))|(?:(?:1[6-9]|[2-9][0-9])(?:0[48]|[2468][048]|[13579][26])|(?:16|[2468][048]|[3579][26])00)([-/.]?)0?2\2(?:29))$/g, "时间填写错误!", reject);
|
||||
_this.__check(banlance, /\d{1,16}/g, "金额填写错误!", reject);
|
||||
if ( '4' == ticketType || '5' == ticketType ) {
|
||||
if ( undefined === accr || "" === accr ) {
|
||||
reject({
|
||||
|
||||
+5
-11
@@ -5,17 +5,11 @@
|
||||
<title>无线支付密码器 js 接口示例</title>
|
||||
<style>
|
||||
body {
|
||||
width: 100%;
|
||||
width: 430px;
|
||||
overflow-x: hidden;
|
||||
color: sienna;
|
||||
margin-top: 50px;
|
||||
}
|
||||
|
||||
.wrap{
|
||||
display:flex;
|
||||
display: -webkit-flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.step {
|
||||
margin: 1rem;
|
||||
@@ -64,11 +58,11 @@
|
||||
</style>
|
||||
<link href="layx.min.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body class="wrap">
|
||||
<div style="width: 430px">
|
||||
<body>
|
||||
|
||||
<div id="title-warning" style="width: 100%; color:#f3b223; font-size: 2rem ;text-align: center"><span>您的浏览器不支持! </span></div>
|
||||
|
||||
<div style="text-align: center"><h2>功能测试<small>(<a target="_blank" href="./active_cpe_setup.exe">active 驱动下载</a>)</small></h2></div>
|
||||
<div style="text-align: center"><h2>功能测试</h2></div>
|
||||
|
||||
<div class="step">
|
||||
<h3>基本功能</h3>
|
||||
@@ -149,7 +143,7 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- 仅此示例程序需要依赖 jquery -->
|
||||
<script src="jquery.min.js"></script>
|
||||
|
||||
Reference in New Issue
Block a user