Quellcode durchsuchen

Merge branch 'master' of http://192.168.1.41:3000/maixinrong/Calculation

TonyKang vor 5 Jahren
Ursprung
Commit
d543a19a13
3 geänderte Dateien mit 54 neuen und 2 gelöschten Zeilen
  1. 4 1
      app/middleware/api2other_check.js
  2. 2 1
      app/view/layout/layout.ejs
  3. 48 0
      sql/update.sql

+ 4 - 1
app/middleware/api2other_check.js

@@ -23,7 +23,7 @@ module.exports = options => {
             if (!code || !sign || !time) {
                 throw '参数有误';
             }
-            if (parseFloat(time + 86400 * 1000) < new Date().getTime()) {
+            if ((parseFloat(time) + 86400 * 1000) < new Date().getTime()) {
                 throw '时间参数已过期';
             }
             const data = yield this.service.project.getProjectByCode(code.toString().trim());
@@ -33,6 +33,9 @@ module.exports = options => {
             if (data.custom === 0) {
                 throw '无法通过接口登录本系统';
             }
+            if (data.custom === 1 && data.can_api === 0) {
+                throw '接口已关闭,无法使用';
+            }
             const encryptSign = crypto.createHash('md5').update(data.code + data.secret + time.toString()).digest('hex').toString();
             if (encryptSign !== sign) {
                 throw '参数验证失败';

+ 2 - 1
app/view/layout/layout.ejs

@@ -21,7 +21,8 @@
     <% } %>
 </head>
 
-<body oncontextmenu="return false;"> <!--屏蔽input鼠标右键-->
+<!--<body oncontextmenu="return false;"> &lt;!&ndash;屏蔽input鼠标右键&ndash;&gt;-->
+<body> <!--屏蔽input鼠标右键-->
 <div>
 
 </div>

+ 48 - 0
sql/update.sql

@@ -224,3 +224,51 @@ update zh_role_rpt_rel set sid = 2161 where id = 297;
 update zh_role_rpt_rel set sid = 2177 where id = 293;
 update zh_role_rpt_rel set sid = 2186 where id = 296;
 update zh_role_rpt_rel set sid = 2187 where id = 288;
+
+
+-- ----------------------------
+-- Table structure for zh_maintain
+-- ----------------------------
+CREATE TABLE `zh_maintain` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `maintain_time` varchar(15) COLLATE utf8_unicode_ci NOT NULL COMMENT '维护时间',
+  `duration` tinyint(4) NOT NULL DEFAULT '2' COMMENT '维护时长',
+  `msg` varchar(255) COLLATE utf8_unicode_ci NOT NULL COMMENT '维护内容',
+  `status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '维护状态,0:未设置,1:未开始,2:进行中',
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='系统维护信息表';
+
+
+INSERT INTO `zh_maintain` (`id`, `maintain_time`, `duration`, `msg`, `status`) VALUES
+(1, '', 2, '', 0);
+
+-- ----------------------------
+-- zh_project add column 是否定制项目
+-- ----------------------------
+ALTER TABLE `zh_project`
+ADD COLUMN `custom` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否是定制项目' AFTER `dealpay_json`;
+
+-- ----------------------------
+-- zh_project add column 定制项目接口是否可用
+-- ----------------------------
+ALTER TABLE `zh_project`
+ADD COLUMN `can_api` tinyint(1) NOT NULL DEFAULT '1' COMMENT '定制项目接口是否可用';
+
+-- ----------------------------
+-- zh_project add column 定制项目私钥
+-- ----------------------------
+ALTER TABLE `zh_project`
+ADD COLUMN `secret` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL COMMENT '定制项目私钥';
+
+-- ----------------------------
+-- zh_project_account add column 是否已绑定定制项目
+-- ----------------------------
+ALTER TABLE `zh_project_account`
+ADD COLUMN `bind` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否已绑定定制项目' AFTER `sms_type`;
+
+-- ----------------------------
+-- 权限控制表,新增部分权限
+-- ----------------------------
+INSERT INTO `calculation`.`zh_permission` (`id`, `name`, `controller`, `action`, `pid`, `icon_class`, `create_time`, `isshow`) VALUES ('67', '系统维护', 'maintain', '', '11', '', NULL, '1');
+INSERT INTO `calculation`.`zh_permission` (`id`, `name`, `controller`, `action`, `pid`, `icon_class`, `create_time`, `isshow`) VALUES ('68', '第三方接口', 'project', 'api2other', '38', 'api2other', NULL, '1');
+INSERT INTO `calculation`.`zh_permission` (`id`, `name`, `controller`, `action`, `pid`, `icon_class`, `create_time`, `isshow`) VALUES ('69', '第三方接口设置', 'project', 'api2otherSave', '38', '', NULL, '1');