From 2eec1e983ca5ab7f139993bb6b10bdd932bbfb1c Mon Sep 17 00:00:00 2001
From: Singularity0909 <904854724@qq.com>
Date: Thu, 4 Feb 2021 21:41:17 +0800
Subject: [PATCH] format all
---
.all-contributorsrc | 9 +
ClickToRun.cmd | 3 -
ConfigureOnce.ps1 | 41 -
README.md | 80 +-
des.py | 68 +-
js/des.js | 1049 -----------------
json/model.json | 609 +++++-----
json/new_model.json | 316 ++++-
model.py | 65 +-
requirements.txt | 2 +-
sduhealth.py | 61 +-
...61\345\244\247\346\211\223\345\215\241.py" | 36 +-
12 files changed, 736 insertions(+), 1603 deletions(-)
delete mode 100644 ClickToRun.cmd
delete mode 100644 ConfigureOnce.ps1
delete mode 100644 js/des.js
diff --git a/.all-contributorsrc b/.all-contributorsrc
index 18d54d4..feb091f 100644
--- a/.all-contributorsrc
+++ b/.all-contributorsrc
@@ -41,6 +41,15 @@
"contributions": [
"code"
]
+ },
+ {
+ "login": "superzhaoyang",
+ "name": "superzhaoyang",
+ "avatar_url": "https://avatars.githubusercontent.com/u/49988452?v=4",
+ "profile": "http://www.superzhaoyang.top",
+ "contributions": [
+ "code"
+ ]
}
],
"contributorsPerLine": 7,
diff --git a/ClickToRun.cmd b/ClickToRun.cmd
deleted file mode 100644
index a625a78..0000000
--- a/ClickToRun.cmd
+++ /dev/null
@@ -1,3 +0,0 @@
-@echo off
-python sduhealth.py
-pause>nul
\ No newline at end of file
diff --git a/ConfigureOnce.ps1 b/ConfigureOnce.ps1
deleted file mode 100644
index c7180b8..0000000
--- a/ConfigureOnce.ps1
+++ /dev/null
@@ -1,41 +0,0 @@
-function Initialize {
- Get-Content -Path 'configexample.yml' -Encoding UTF8 | Out-String | Set-Variable 'config'
- Write-Host '[INFO] ' Cyan;
- Write-Host '请输入需要自动打卡的信息化门户账号:'
- Read-Host | Set-Variable id
- Write-Host '[INFO] ' Cyan;
- Write-Host '请输入密码:'
- Read-Host -AsSecureString | Set-Variable pass
-
- $pass = [System.Net.NetworkCredential]::new('', $pass).Password # this looks stupid :(
-
- $config -creplace '\{STUID\}', $id -creplace '\{PSWD\}', $pass | `
- Out-File -FilePath 'config.yml' -Encoding UTF8
-}
-
-####
-# Start from here:
-####
-
-Write-Host '检查Python环境...' -ForegroundColor White
-Invoke-Expression 'python -V' | Set-Variable v
-if (-not ($v -match '3\.\w\.\w')) {
- Write-Error "未正确配置Python环境。"
- try {
- Write-Host "[INFO] 正在尝试安装python环境"
- Invoke-WebRequest -Uri 'http://npm.taobao.org/mirrors/python/3.7.8/python-3.7.8-amd64.exe' -OutFile 'python-installer.exe'
- .\python-installer.exe /quiet InstallAllUsers=1 PrependPath=1 Include_test=0
- }
- catch { Write-Host $error[0]; break }
-}
-
-Invoke-Expression 'pip -V' | Set-Variable pv
-if ($pv -match '^pip\s\w{2}\.\w\.\w') {
- iex 'pip install -i https://pypi.tuna.tsinghua.edu.cn/simple -r requirements.txt'
-}
-else {
- @(iex 'cmd /U/C where python')[0].ToString().Replace('python.exe', 'Scripts') | set ppath
- iex "$ppath\pip.exe install -i https://pypi.tuna.tsinghua.edu.cn/simple -r requirements.txt"
-}
-
-Initialize # this performs the function defined most above.
\ No newline at end of file
diff --git a/README.md b/README.md
index 9ee92c6..4765757 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
# SDUHealth
-[![All Contributors](https://img.shields.io/badge/all_contributors-4-orange.svg?style=flat-square)](#contributors-)
+[![All Contributors](https://img.shields.io/badge/all_contributors-5-orange.svg?style=flat-square)](#contributors-)
山东大学学生每日健康状况填报自动打卡。
@@ -13,83 +13,6 @@
**[Python3](https://www.python.org)**
-推荐使用 GitHub Actions 的运行方式,可以方便的实现每日自动打卡。
-
-注意需要你使用本程序打卡前一天手动打过卡,且当天没有打过卡,之后每天就可以都只使用自动打卡了。
-
-### Github Actions 运行
-
-首先复制 configexample.yml 文件里面的所有内容,然后在本地进行编辑,根据文件的指示填入账号和密码,之后可以去 [yaml检测](https://www.bejson.com/validators/yaml_editor/) 检测一下文件的正确性,支持多账户,当然前提是你知道别人的密码。
-
-之后 fork 本仓库到自己的 GitHub 账号,之后打开仓库的 Settings,在仓库设置界面在打开 Secrets 选项:
-
-![Github Repo Secrets Settings](https://cdn.jsdelivr.net/gh/viewv/Pico@master/uPic/Screen%20Shot%202021-01-19%20at%2019.06.10.png)
-
-之后新建一个 secret,Name 为 CONFIG,Value 就是你编辑的包含你的学号密码的 yaml 文件内容全部复制进去即可:
-
-![New Github Repo Secret](https://cdn.jsdelivr.net/gh/viewv/Pico@master/uPic/Screen%20Shot%202021-01-19%20at%2019.08.02.png)
-
-保存即可,之后转到仓库的 Actions 选项卡:
-
-![Enable Github Actions workflow](https://cdn.jsdelivr.net/gh/viewv/Pico@master/uPic/Screen%20Shot%202021-01-19%20at%2019.09.06.png)
-
-Enable 本仓库已经配置好的 GitHub Actions workflow,之后点击 checkin 打开配置选项:
-
-![Enable checkin workflow](https://cdn.jsdelivr.net/gh/viewv/Pico@master/uPic/Screen%20Shot%202021-01-21%20at%2015.11.44.png)
-
- Enable workflow,之后得到下面的界面:
-
-![Checkin workflow page](https://cdn.jsdelivr.net/gh/viewv/Pico@master/uPic/Screen%20Shot%202021-01-21%20at%2015.12.33.png)
-
-你现在可以选择 Run workflow 手动触发运行,本仓库也配置了每天的自动运行,你可以打开 GitHub Actions 的运行结果提示,这样就可以简单的实现每天的打卡任务。
-
-> ⚠️ 注意
->
-> 最近我们发现 GitHub Actions workflow 有延时问题, 有可能您的实际运行时间与设置的不同。
->
-> 又由于 GitHub 可能的设计问题,您有可能需要先手动运行一次打卡 workflow 才可以激活定时运行。
-
-
-关于 repo_sync.yml 的使用说明
-
-这个文件创建了一个定时自动同步源仓库内所有代码的 Github Actions workflow。
-
-> ⚠️ 注意
->
-> 该 workflow 执行后会自动覆盖原仓库内的所有代码,并更新为源仓库的代码,所有自定义的修改将不会得到保留(一般来说,也没什么需要自定义的,实在是需要自定义,可以手动执行该 workflow 之后,将其设置为 disable )。
-
-在 fork 了代码之后,首先需要去申请一个 GitHub Personal Access Token,该 Token 让此 workflow 拥有了更改指定仓库代码的权限。具体操作如下:
-
-先选择账户 Settings
-
-![Github account Settings](https://cdn.jsdelivr.net/gh/nekomiao123/pic/img/image-20210121121329851.png)
-
-然后选择 Developer Settings
-
-![Github Developer Settings](https://cdn.jsdelivr.net/gh/nekomiao123/pic/img/image-20210121121525838.png)
-
-之后再选择 Personal access tokens 点击里面的 Generate new token
-
-![Generate new token](https://cdn.jsdelivr.net/gh/nekomiao123/pic/img/image-20210121121640260.png)
-
-之后先随便取个好记的名字,然后勾选前两项
-
-![New personal access token](https://cdn.jsdelivr.net/gh/nekomiao123/pic/img/image-20210121121747207.png)
-
-最后点击下面的 Generate token 即可,这样就能获得一串类似这样的字符,赶紧复制下来,它只会显示这一次
-
-![Personal token info](https://cdn.jsdelivr.net/gh/nekomiao123/pic/img/image-20210121121953685.png)
-
-然后去新建一个 secret(跟上面建立 secret 的流程一样)
-
-Name 是 PAT
-
-Value 是刚才你复制的这一串字符
-
-
-
-到这里,该 Github Actions workflow 就可以使用了,可以实现每日自动打卡,如果你也开启了 repo_sync workflow 那么也将定时自动同步本仓库以保持代码更新。
-
### 本地运行
在本地安装好环境后,下载或者 clone 本仓库后,到项目文件夹下运行如下命令安装 Python 所需依赖:
@@ -130,6 +53,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
menma 💻 |
2U 💻 |
Ryuujo Zhang 💻 |
+ superzhaoyang 💻 |
diff --git a/des.py b/des.py
index 4c396e9..8008658 100644
--- a/des.py
+++ b/des.py
@@ -97,6 +97,7 @@
PAD_NORMAL = 1
PAD_PKCS5 = 2
+
# PAD_PKCS5: is a method that will unambiguously remove all padding
# characters after decryption, when originally encrypted with
# this padding mode.
@@ -219,7 +220,7 @@ def _unpadData(self, data, pad, padmode):
pad = self.getPadding()
if pad:
data = data[:-self.block_size] + \
- data[-self.block_size:].rstrip(pad)
+ data[-self.block_size:].rstrip(pad)
elif padmode == PAD_PKCS5:
if _pythonMajorVersion < 3:
@@ -248,6 +249,7 @@ def _guardAgainstUnicode(self, data):
"pyDes can only work with encoded strings, not Unicode.")
return data
+
#############################################################################
# DES #
#############################################################################
@@ -299,10 +301,10 @@ class des(_baseDes):
# permuted choice key (table 2)
__pc2 = [
- 13, 16, 10, 23, 0, 4,
- 2, 27, 14, 5, 20, 9,
- 22, 18, 11, 3, 25, 7,
- 15, 6, 26, 19, 12, 1,
+ 13, 16, 10, 23, 0, 4,
+ 2, 27, 14, 5, 20, 9,
+ 22, 18, 11, 3, 25, 7,
+ 15, 6, 26, 19, 12, 1,
40, 51, 30, 36, 46, 54,
29, 39, 50, 44, 32, 47,
43, 48, 38, 55, 33, 52,
@@ -310,11 +312,11 @@ class des(_baseDes):
]
# initial permutation IP
- __ip = [57, 49, 41, 33, 25, 17, 9, 1,
+ __ip = [57, 49, 41, 33, 25, 17, 9, 1,
59, 51, 43, 35, 27, 19, 11, 3,
61, 53, 45, 37, 29, 21, 13, 5,
63, 55, 47, 39, 31, 23, 15, 7,
- 56, 48, 40, 32, 24, 16, 8, 0,
+ 56, 48, 40, 32, 24, 16, 8, 0,
58, 50, 42, 34, 26, 18, 10, 2,
60, 52, 44, 36, 28, 20, 12, 4,
62, 54, 46, 38, 30, 22, 14, 6
@@ -322,14 +324,14 @@ class des(_baseDes):
# Expansion table for turning 32 bit blocks into 48 bits
__expansion_table = [
- 31, 0, 1, 2, 3, 4,
- 3, 4, 5, 6, 7, 8,
- 7, 8, 9, 10, 11, 12,
+ 31, 0, 1, 2, 3, 4,
+ 3, 4, 5, 6, 7, 8,
+ 7, 8, 9, 10, 11, 12,
11, 12, 13, 14, 15, 16,
15, 16, 17, 18, 19, 20,
19, 20, 21, 22, 23, 24,
23, 24, 25, 26, 27, 28,
- 27, 28, 29, 30, 31, 0
+ 27, 28, 29, 30, 31, 0
]
# The (in)famous S-boxes
@@ -395,14 +397,14 @@ class des(_baseDes):
# final permutation IP^-1
__fp = [
- 39, 7, 47, 15, 55, 23, 63, 31,
- 38, 6, 46, 14, 54, 22, 62, 30,
- 37, 5, 45, 13, 53, 21, 61, 29,
- 36, 4, 44, 12, 52, 20, 60, 28,
- 35, 3, 43, 11, 51, 19, 59, 27,
- 34, 2, 42, 10, 50, 18, 58, 26,
- 33, 1, 41, 9, 49, 17, 57, 25,
- 32, 0, 40, 8, 48, 16, 56, 24
+ 39, 7, 47, 15, 55, 23, 63, 31,
+ 38, 6, 46, 14, 54, 22, 62, 30,
+ 37, 5, 45, 13, 53, 21, 61, 29,
+ 36, 4, 44, 12, 52, 20, 60, 28,
+ 35, 3, 43, 11, 51, 19, 59, 27,
+ 34, 2, 42, 10, 50, 18, 58, 26,
+ 33, 1, 41, 9, 49, 17, 57, 25,
+ 32, 0, 40, 8, 48, 16, 56, 24
]
# Type of crypting being done
@@ -528,8 +530,8 @@ def __des_crypt(self, block, crypt_type):
B = [self.R[:6], self.R[6:12], self.R[12:18], self.R[18:24],
self.R[24:30], self.R[30:36], self.R[36:42], self.R[42:]]
# Optimization: Replaced below commented code with above
- #j = 0
- #B = []
+ # j = 0
+ # B = []
# while j < len(self.R):
# self.R[j] = self.R[j] ^ self.Kn[iteration][j]
# j += 1
@@ -563,7 +565,7 @@ def __des_crypt(self, block, crypt_type):
# Xor with L[i - 1]
self.R = list(map(lambda x, y: x ^ y, self.R, self.L))
# Optimization: This now replaces the below commented code
- #j = 0
+ # j = 0
# while j < len(self.R):
# self.R[j] = self.R[j] ^ self.L[j]
# j += 1
@@ -609,11 +611,11 @@ def crypt(self, data, crypt_type):
i = 0
dict = {}
result = []
- #cached = 0
- #lines = 0
+ # cached = 0
+ # lines = 0
while i < len(data):
# Test code for caching encryption results
- #lines += 1
+ # lines += 1
# if dict.has_key(data[i:i+8]):
# print "Cached result for: %s" % data[i:i+8]
# cached += 1
@@ -621,13 +623,13 @@ def crypt(self, data, crypt_type):
# i += 8
# continue
- block = self.__String_to_BitList(data[i:i+8])
+ block = self.__String_to_BitList(data[i:i + 8])
# Xor with IV if using CBC mode
if self.getMode() == CBC:
if crypt_type == des.ENCRYPT:
block = list(map(lambda x, y: x ^ y, block, iv))
- #j = 0
+ # j = 0
# while j < len(block):
# block[j] = block[j] ^ iv[j]
# j += 1
@@ -637,7 +639,7 @@ def crypt(self, data, crypt_type):
if crypt_type == des.DECRYPT:
processed_block = list(
map(lambda x, y: x ^ y, processed_block, iv))
- #j = 0
+ # j = 0
# while j < len(processed_block):
# processed_block[j] = processed_block[j] ^ iv[j]
# j += 1
@@ -648,10 +650,10 @@ def crypt(self, data, crypt_type):
processed_block = self.__des_crypt(block, crypt_type)
# Add the resulting crypted block to our list
- #d = self.__BitList_to_String(processed_block)
+ # d = self.__BitList_to_String(processed_block)
# result.append(d)
result.append(self.__BitList_to_String(processed_block))
- #dict[data[i:i+8]] = d
+ # dict[data[i:i+8]] = d
i += 8
# print "Lines: %d, cached: %d" % (lines, cached)
@@ -811,7 +813,7 @@ def encrypt(self, data, pad=None, padmode=None):
i = 0
result = []
while i < len(data):
- block = self.__key1.crypt(data[i:i+8], ENCRYPT)
+ block = self.__key1.crypt(data[i:i + 8], ENCRYPT)
block = self.__key2.crypt(block, DECRYPT)
block = self.__key3.crypt(block, ENCRYPT)
self.__key1.setIV(block)
@@ -856,8 +858,8 @@ def decrypt(self, data, pad=None, padmode=None):
i = 0
result = []
while i < len(data):
- iv = data[i:i+8]
- block = self.__key3.crypt(iv, DECRYPT)
+ iv = data[i:i + 8]
+ block = self.__key3.crypt(iv, DECRYPT)
block = self.__key2.crypt(block, ENCRYPT)
block = self.__key1.crypt(block, DECRYPT)
self.__key1.setIV(iv)
diff --git a/js/des.js b/js/des.js
deleted file mode 100644
index 7333a49..0000000
--- a/js/des.js
+++ /dev/null
@@ -1,1049 +0,0 @@
-/**
- * DES加密解密
- * @Copyright Copyright (c) 2006
- * @author Guapo
- * @see DESCore
- */
-
-/*
- * encrypt the string to string made up of hex
- * return the encrypted string
- */
-function strEnc(data, firstKey, secondKey, thirdKey) {
-
- var leng = data.length;
- var encData = "";
- var firstKeyBt, secondKeyBt, thirdKeyBt, firstLength, secondLength, thirdLength;
- if (firstKey != null && firstKey != "") {
- firstKeyBt = getKeyBytes(firstKey);
- firstLength = firstKeyBt.length;
- }
- if (secondKey != null && secondKey != "") {
- secondKeyBt = getKeyBytes(secondKey);
- secondLength = secondKeyBt.length;
- }
- if (thirdKey != null && thirdKey != "") {
- thirdKeyBt = getKeyBytes(thirdKey);
- thirdLength = thirdKeyBt.length;
- }
-
- if (leng > 0) {
- if (leng < 4) {
- var bt = strToBt(data);
- var encByte;
- if (firstKey != null && firstKey != "" && secondKey != null && secondKey != "" && thirdKey != null && thirdKey != "") {
- var tempBt;
- var x, y, z;
- tempBt = bt;
- for (x = 0; x < firstLength; x++) {
- tempBt = enc(tempBt, firstKeyBt[x]);
- }
- for (y = 0; y < secondLength; y++) {
- tempBt = enc(tempBt, secondKeyBt[y]);
- }
- for (z = 0; z < thirdLength; z++) {
- tempBt = enc(tempBt, thirdKeyBt[z]);
- }
- encByte = tempBt;
- } else {
- if (firstKey != null && firstKey != "" && secondKey != null && secondKey != "") {
- var tempBt;
- var x, y;
- tempBt = bt;
- for (x = 0; x < firstLength; x++) {
- tempBt = enc(tempBt, firstKeyBt[x]);
- }
- for (y = 0; y < secondLength; y++) {
- tempBt = enc(tempBt, secondKeyBt[y]);
- }
- encByte = tempBt;
- } else {
- if (firstKey != null && firstKey != "") {
- var tempBt;
- var x = 0;
- tempBt = bt;
- for (x = 0; x < firstLength; x++) {
- tempBt = enc(tempBt, firstKeyBt[x]);
- }
- encByte = tempBt;
- }
- }
- }
- encData = bt64ToHex(encByte);
- } else {
- var iterator = parseInt(leng / 4);
- var remainder = leng % 4;
- var i = 0;
- for (i = 0; i < iterator; i++) {
- var tempData = data.substring(i * 4 + 0, i * 4 + 4);
- var tempByte = strToBt(tempData);
- var encByte;
- if (firstKey != null && firstKey != "" && secondKey != null && secondKey != "" && thirdKey != null && thirdKey != "") {
- var tempBt;
- var x, y, z;
- tempBt = tempByte;
- for (x = 0; x < firstLength; x++) {
- tempBt = enc(tempBt, firstKeyBt[x]);
- }
- for (y = 0; y < secondLength; y++) {
- tempBt = enc(tempBt, secondKeyBt[y]);
- }
- for (z = 0; z < thirdLength; z++) {
- tempBt = enc(tempBt, thirdKeyBt[z]);
- }
- encByte = tempBt;
- } else {
- if (firstKey != null && firstKey != "" && secondKey != null && secondKey != "") {
- var tempBt;
- var x, y;
- tempBt = tempByte;
- for (x = 0; x < firstLength; x++) {
- tempBt = enc(tempBt, firstKeyBt[x]);
- }
- for (y = 0; y < secondLength; y++) {
- tempBt = enc(tempBt, secondKeyBt[y]);
- }
- encByte = tempBt;
- } else {
- if (firstKey != null && firstKey != "") {
- var tempBt;
- var x;
- tempBt = tempByte;
- for (x = 0; x < firstLength; x++) {
- tempBt = enc(tempBt, firstKeyBt[x]);
- }
- encByte = tempBt;
- }
- }
- }
- encData += bt64ToHex(encByte);
- }
- if (remainder > 0) {
- var remainderData = data.substring(iterator * 4 + 0, leng);
- var tempByte = strToBt(remainderData);
- var encByte;
- if (firstKey != null && firstKey != "" && secondKey != null && secondKey != "" && thirdKey != null && thirdKey != "") {
- var tempBt;
- var x, y, z;
- tempBt = tempByte;
- for (x = 0; x < firstLength; x++) {
- tempBt = enc(tempBt, firstKeyBt[x]);
- }
- for (y = 0; y < secondLength; y++) {
- tempBt = enc(tempBt, secondKeyBt[y]);
- }
- for (z = 0; z < thirdLength; z++) {
- tempBt = enc(tempBt, thirdKeyBt[z]);
- }
- encByte = tempBt;
- } else {
- if (firstKey != null && firstKey != "" && secondKey != null && secondKey != "") {
- var tempBt;
- var x, y;
- tempBt = tempByte;
- for (x = 0; x < firstLength; x++) {
- tempBt = enc(tempBt, firstKeyBt[x]);
- }
- for (y = 0; y < secondLength; y++) {
- tempBt = enc(tempBt, secondKeyBt[y]);
- }
- encByte = tempBt;
- } else {
- if (firstKey != null && firstKey != "") {
- var tempBt;
- var x;
- tempBt = tempByte;
- for (x = 0; x < firstLength; x++) {
- tempBt = enc(tempBt, firstKeyBt[x]);
- }
- encByte = tempBt;
- }
- }
- }
- encData += bt64ToHex(encByte);
- }
- }
- }
- return encData;
-}
-
-/*
- * decrypt the encrypted string to the original string
- *
- * return the original string
- */
-function strDec(data, firstKey, secondKey, thirdKey) {
- var leng = data.length;
- var decStr = "";
- var firstKeyBt, secondKeyBt, thirdKeyBt, firstLength, secondLength, thirdLength;
- if (firstKey != null && firstKey != "") {
- firstKeyBt = getKeyBytes(firstKey);
- firstLength = firstKeyBt.length;
- }
- if (secondKey != null && secondKey != "") {
- secondKeyBt = getKeyBytes(secondKey);
- secondLength = secondKeyBt.length;
- }
- if (thirdKey != null && thirdKey != "") {
- thirdKeyBt = getKeyBytes(thirdKey);
- thirdLength = thirdKeyBt.length;
- }
-
- var iterator = parseInt(leng / 16);
- var i = 0;
- for (i = 0; i < iterator; i++) {
- var tempData = data.substring(i * 16 + 0, i * 16 + 16);
- var strByte = hexToBt64(tempData);
- var intByte = new Array(64);
- var j = 0;
- for (j = 0; j < 64; j++) {
- intByte[j] = parseInt(strByte.substring(j, j + 1));
- }
- var decByte;
- if (firstKey != null && firstKey != "" && secondKey != null && secondKey != "" && thirdKey != null && thirdKey != "") {
- var tempBt;
- var x, y, z;
- tempBt = intByte;
- for (x = thirdLength - 1; x >= 0; x--) {
- tempBt = dec(tempBt, thirdKeyBt[x]);
- }
- for (y = secondLength - 1; y >= 0; y--) {
- tempBt = dec(tempBt, secondKeyBt[y]);
- }
- for (z = firstLength - 1; z >= 0; z--) {
- tempBt = dec(tempBt, firstKeyBt[z]);
- }
- decByte = tempBt;
- } else {
- if (firstKey != null && firstKey != "" && secondKey != null && secondKey != "") {
- var tempBt;
- var x, y, z;
- tempBt = intByte;
- for (x = secondLength - 1; x >= 0; x--) {
- tempBt = dec(tempBt, secondKeyBt[x]);
- }
- for (y = firstLength - 1; y >= 0; y--) {
- tempBt = dec(tempBt, firstKeyBt[y]);
- }
- decByte = tempBt;
- } else {
- if (firstKey != null && firstKey != "") {
- var tempBt;
- var x, y, z;
- tempBt = intByte;
- for (x = firstLength - 1; x >= 0; x--) {
- tempBt = dec(tempBt, firstKeyBt[x]);
- }
- decByte = tempBt;
- }
- }
- }
- decStr += byteToString(decByte);
- }
- return decStr;
-}
-/*
- * chang the string into the bit array
- *
- * return bit array(it's length % 64 = 0)
- */
-function getKeyBytes(key) {
- var keyBytes = new Array();
- var leng = key.length;
- var iterator = parseInt(leng / 4);
- var remainder = leng % 4;
- var i = 0;
- for (i = 0; i < iterator; i++) {
- keyBytes[i] = strToBt(key.substring(i * 4 + 0, i * 4 + 4));
- }
- if (remainder > 0) {
- keyBytes[i] = strToBt(key.substring(i * 4 + 0, leng));
- }
- return keyBytes;
-}
-
-/*
- * chang the string(it's length <= 4) into the bit array
- *
- * return bit array(it's length = 64)
- */
-function strToBt(str) {
- var leng = str.length;
- var bt = new Array(64);
- if (leng < 4) {
- var i = 0,
- j = 0,
- p = 0,
- q = 0;
- for (i = 0; i < leng; i++) {
- var k = str.charCodeAt(i);
- for (j = 0; j < 16; j++) {
- var pow = 1,
- m = 0;
- for (m = 15; m > j; m--) {
- pow *= 2;
- }
- bt[16 * i + j] = parseInt(k / pow) % 2;
- }
- }
- for (p = leng; p < 4; p++) {
- var k = 0;
- for (q = 0; q < 16; q++) {
- var pow = 1,
- m = 0;
- for (m = 15; m > q; m--) {
- pow *= 2;
- }
- bt[16 * p + q] = parseInt(k / pow) % 2;
- }
- }
- } else {
- for (i = 0; i < 4; i++) {
- var k = str.charCodeAt(i);
- for (j = 0; j < 16; j++) {
- var pow = 1;
- for (m = 15; m > j; m--) {
- pow *= 2;
- }
- bt[16 * i + j] = parseInt(k / pow) % 2;
- }
- }
- }
- return bt;
-}
-
-/*
- * chang the bit(it's length = 4) into the hex
- *
- * return hex
- */
-function bt4ToHex(binary) {
- var hex;
- switch (binary) {
- case "0000":
- hex = "0";
- break;
- case "0001":
- hex = "1";
- break;
- case "0010":
- hex = "2";
- break;
- case "0011":
- hex = "3";
- break;
- case "0100":
- hex = "4";
- break;
- case "0101":
- hex = "5";
- break;
- case "0110":
- hex = "6";
- break;
- case "0111":
- hex = "7";
- break;
- case "1000":
- hex = "8";
- break;
- case "1001":
- hex = "9";
- break;
- case "1010":
- hex = "A";
- break;
- case "1011":
- hex = "B";
- break;
- case "1100":
- hex = "C";
- break;
- case "1101":
- hex = "D";
- break;
- case "1110":
- hex = "E";
- break;
- case "1111":
- hex = "F";
- break;
- }
- return hex;
-}
-
-/*
- * chang the hex into the bit(it's length = 4)
- *
- * return the bit(it's length = 4)
- */
-function hexToBt4(hex) {
- var binary;
- switch (hex) {
- case "0":
- binary = "0000";
- break;
- case "1":
- binary = "0001";
- break;
- case "2":
- binary = "0010";
- break;
- case "3":
- binary = "0011";
- break;
- case "4":
- binary = "0100";
- break;
- case "5":
- binary = "0101";
- break;
- case "6":
- binary = "0110";
- break;
- case "7":
- binary = "0111";
- break;
- case "8":
- binary = "1000";
- break;
- case "9":
- binary = "1001";
- break;
- case "A":
- binary = "1010";
- break;
- case "B":
- binary = "1011";
- break;
- case "C":
- binary = "1100";
- break;
- case "D":
- binary = "1101";
- break;
- case "E":
- binary = "1110";
- break;
- case "F":
- binary = "1111";
- break;
- }
- return binary;
-}
-
-/*
- * chang the bit(it's length = 64) into the string
- *
- * return string
- */
-function byteToString(byteData) {
- var str = "";
- for (i = 0; i < 4; i++) {
- var count = 0;
- for (j = 0; j < 16; j++) {
- var pow = 1;
- for (m = 15; m > j; m--) {
- pow *= 2;
- }
- count += byteData[16 * i + j] * pow;
- }
- if (count != 0) {
- str += String.fromCharCode(count);
- }
- }
- return str;
-}
-
-function bt64ToHex(byteData) {
- var hex = "";
- for (i = 0; i < 16; i++) {
- var bt = "";
- for (j = 0; j < 4; j++) {
- bt += byteData[i * 4 + j];
- }
- hex += bt4ToHex(bt);
- }
- return hex;
-}
-
-function hexToBt64(hex) {
- var binary = "";
- for (i = 0; i < 16; i++) {
- binary += hexToBt4(hex.substring(i, i + 1));
- }
- return binary;
-}
-
-/*
- * the 64 bit des core arithmetic
- */
-
-function enc(dataByte, keyByte) {
- var keys = generateKeys(keyByte);
- var ipByte = initPermute(dataByte);
- var ipLeft = new Array(32);
- var ipRight = new Array(32);
- var tempLeft = new Array(32);
- var i = 0,
- j = 0,
- k = 0,
- m = 0,
- n = 0;
- for (k = 0; k < 32; k++) {
- ipLeft[k] = ipByte[k];
- ipRight[k] = ipByte[32 + k];
- }
- for (i = 0; i < 16; i++) {
- for (j = 0; j < 32; j++) {
- tempLeft[j] = ipLeft[j];
- ipLeft[j] = ipRight[j];
- }
- var key = new Array(48);
- for (m = 0; m < 48; m++) {
- key[m] = keys[i][m];
- }
- var tempRight = xor(pPermute(sBoxPermute(xor(expandPermute(ipRight), key))), tempLeft);
- for (n = 0; n < 32; n++) {
- ipRight[n] = tempRight[n];
- }
-
- }
-
-
- var finalData = new Array(64);
- for (i = 0; i < 32; i++) {
- finalData[i] = ipRight[i];
- finalData[32 + i] = ipLeft[i];
- }
- return finallyPermute(finalData);
-}
-
-function dec(dataByte, keyByte) {
- var keys = generateKeys(keyByte);
- var ipByte = initPermute(dataByte);
- var ipLeft = new Array(32);
- var ipRight = new Array(32);
- var tempLeft = new Array(32);
- var i = 0,
- j = 0,
- k = 0,
- m = 0,
- n = 0;
- for (k = 0; k < 32; k++) {
- ipLeft[k] = ipByte[k];
- ipRight[k] = ipByte[32 + k];
- }
- for (i = 15; i >= 0; i--) {
- for (j = 0; j < 32; j++) {
- tempLeft[j] = ipLeft[j];
- ipLeft[j] = ipRight[j];
- }
- var key = new Array(48);
- for (m = 0; m < 48; m++) {
- key[m] = keys[i][m];
- }
-
- var tempRight = xor(pPermute(sBoxPermute(xor(expandPermute(ipRight), key))), tempLeft);
- for (n = 0; n < 32; n++) {
- ipRight[n] = tempRight[n];
- }
- }
-
-
- var finalData = new Array(64);
- for (i = 0; i < 32; i++) {
- finalData[i] = ipRight[i];
- finalData[32 + i] = ipLeft[i];
- }
- return finallyPermute(finalData);
-}
-
-function initPermute(originalData) {
- var ipByte = new Array(64);
- for (i = 0, m = 1, n = 0; i < 4; i++, m += 2, n += 2) {
- for (j = 7, k = 0; j >= 0; j--, k++) {
- ipByte[i * 8 + k] = originalData[j * 8 + m];
- ipByte[i * 8 + k + 32] = originalData[j * 8 + n];
- }
- }
- return ipByte;
-}
-
-function expandPermute(rightData) {
- var epByte = new Array(48);
- for (i = 0; i < 8; i++) {
- if (i == 0) {
- epByte[i * 6 + 0] = rightData[31];
- } else {
- epByte[i * 6 + 0] = rightData[i * 4 - 1];
- }
- epByte[i * 6 + 1] = rightData[i * 4 + 0];
- epByte[i * 6 + 2] = rightData[i * 4 + 1];
- epByte[i * 6 + 3] = rightData[i * 4 + 2];
- epByte[i * 6 + 4] = rightData[i * 4 + 3];
- if (i == 7) {
- epByte[i * 6 + 5] = rightData[0];
- } else {
- epByte[i * 6 + 5] = rightData[i * 4 + 4];
- }
- }
- return epByte;
-}
-
-function xor(byteOne, byteTwo) {
- var xorByte = new Array(byteOne.length);
- for (i = 0; i < byteOne.length; i++) {
- xorByte[i] = byteOne[i] ^ byteTwo[i];
- }
- return xorByte;
-}
-
-function sBoxPermute(expandByte) {
-
- var sBoxByte = new Array(32);
- var binary = "";
- var s1 = [
- [14, 4, 13, 1, 2, 15, 11, 8, 3, 10, 6, 12, 5, 9, 0, 7],
- [0, 15, 7, 4, 14, 2, 13, 1, 10, 6, 12, 11, 9, 5, 3, 8],
- [4, 1, 14, 8, 13, 6, 2, 11, 15, 12, 9, 7, 3, 10, 5, 0],
- [15, 12, 8, 2, 4, 9, 1, 7, 5, 11, 3, 14, 10, 0, 6, 13]
- ];
-
- /* Table - s2 */
- var s2 = [
- [15, 1, 8, 14, 6, 11, 3, 4, 9, 7, 2, 13, 12, 0, 5, 10],
- [3, 13, 4, 7, 15, 2, 8, 14, 12, 0, 1, 10, 6, 9, 11, 5],
- [0, 14, 7, 11, 10, 4, 13, 1, 5, 8, 12, 6, 9, 3, 2, 15],
- [13, 8, 10, 1, 3, 15, 4, 2, 11, 6, 7, 12, 0, 5, 14, 9]
- ];
-
- /* Table - s3 */
- var s3 = [
- [10, 0, 9, 14, 6, 3, 15, 5, 1, 13, 12, 7, 11, 4, 2, 8],
- [13, 7, 0, 9, 3, 4, 6, 10, 2, 8, 5, 14, 12, 11, 15, 1],
- [13, 6, 4, 9, 8, 15, 3, 0, 11, 1, 2, 12, 5, 10, 14, 7],
- [1, 10, 13, 0, 6, 9, 8, 7, 4, 15, 14, 3, 11, 5, 2, 12]
- ];
- /* Table - s4 */
- var s4 = [
- [7, 13, 14, 3, 0, 6, 9, 10, 1, 2, 8, 5, 11, 12, 4, 15],
- [13, 8, 11, 5, 6, 15, 0, 3, 4, 7, 2, 12, 1, 10, 14, 9],
- [10, 6, 9, 0, 12, 11, 7, 13, 15, 1, 3, 14, 5, 2, 8, 4],
- [3, 15, 0, 6, 10, 1, 13, 8, 9, 4, 5, 11, 12, 7, 2, 14]
- ];
-
- /* Table - s5 */
- var s5 = [
- [2, 12, 4, 1, 7, 10, 11, 6, 8, 5, 3, 15, 13, 0, 14, 9],
- [14, 11, 2, 12, 4, 7, 13, 1, 5, 0, 15, 10, 3, 9, 8, 6],
- [4, 2, 1, 11, 10, 13, 7, 8, 15, 9, 12, 5, 6, 3, 0, 14],
- [11, 8, 12, 7, 1, 14, 2, 13, 6, 15, 0, 9, 10, 4, 5, 3]
- ];
-
- /* Table - s6 */
- var s6 = [
- [12, 1, 10, 15, 9, 2, 6, 8, 0, 13, 3, 4, 14, 7, 5, 11],
- [10, 15, 4, 2, 7, 12, 9, 5, 6, 1, 13, 14, 0, 11, 3, 8],
- [9, 14, 15, 5, 2, 8, 12, 3, 7, 0, 4, 10, 1, 13, 11, 6],
- [4, 3, 2, 12, 9, 5, 15, 10, 11, 14, 1, 7, 6, 0, 8, 13]
- ];
-
- /* Table - s7 */
- var s7 = [
- [4, 11, 2, 14, 15, 0, 8, 13, 3, 12, 9, 7, 5, 10, 6, 1],
- [13, 0, 11, 7, 4, 9, 1, 10, 14, 3, 5, 12, 2, 15, 8, 6],
- [1, 4, 11, 13, 12, 3, 7, 14, 10, 15, 6, 8, 0, 5, 9, 2],
- [6, 11, 13, 8, 1, 4, 10, 7, 9, 5, 0, 15, 14, 2, 3, 12]
- ];
-
- /* Table - s8 */
- var s8 = [
- [13, 2, 8, 4, 6, 15, 11, 1, 10, 9, 3, 14, 5, 0, 12, 7],
- [1, 15, 13, 8, 10, 3, 7, 4, 12, 5, 6, 11, 0, 14, 9, 2],
- [7, 11, 4, 1, 9, 12, 14, 2, 0, 6, 10, 13, 15, 3, 5, 8],
- [2, 1, 14, 7, 4, 10, 8, 13, 15, 12, 9, 0, 3, 5, 6, 11]
- ];
-
- for (m = 0; m < 8; m++) {
- var i = 0,
- j = 0;
- i = expandByte[m * 6 + 0] * 2 + expandByte[m * 6 + 5];
- j = expandByte[m * 6 + 1] * 2 * 2 * 2 +
- expandByte[m * 6 + 2] * 2 * 2 +
- expandByte[m * 6 + 3] * 2 +
- expandByte[m * 6 + 4];
- switch (m) {
- case 0:
- binary = getBoxBinary(s1[i][j]);
- break;
- case 1:
- binary = getBoxBinary(s2[i][j]);
- break;
- case 2:
- binary = getBoxBinary(s3[i][j]);
- break;
- case 3:
- binary = getBoxBinary(s4[i][j]);
- break;
- case 4:
- binary = getBoxBinary(s5[i][j]);
- break;
- case 5:
- binary = getBoxBinary(s6[i][j]);
- break;
- case 6:
- binary = getBoxBinary(s7[i][j]);
- break;
- case 7:
- binary = getBoxBinary(s8[i][j]);
- break;
- }
- sBoxByte[m * 4 + 0] = parseInt(binary.substring(0, 1));
- sBoxByte[m * 4 + 1] = parseInt(binary.substring(1, 2));
- sBoxByte[m * 4 + 2] = parseInt(binary.substring(2, 3));
- sBoxByte[m * 4 + 3] = parseInt(binary.substring(3, 4));
- }
- return sBoxByte;
-}
-
-function pPermute(sBoxByte) {
- var pBoxPermute = new Array(32);
- pBoxPermute[0] = sBoxByte[15];
- pBoxPermute[1] = sBoxByte[6];
- pBoxPermute[2] = sBoxByte[19];
- pBoxPermute[3] = sBoxByte[20];
- pBoxPermute[4] = sBoxByte[28];
- pBoxPermute[5] = sBoxByte[11];
- pBoxPermute[6] = sBoxByte[27];
- pBoxPermute[7] = sBoxByte[16];
- pBoxPermute[8] = sBoxByte[0];
- pBoxPermute[9] = sBoxByte[14];
- pBoxPermute[10] = sBoxByte[22];
- pBoxPermute[11] = sBoxByte[25];
- pBoxPermute[12] = sBoxByte[4];
- pBoxPermute[13] = sBoxByte[17];
- pBoxPermute[14] = sBoxByte[30];
- pBoxPermute[15] = sBoxByte[9];
- pBoxPermute[16] = sBoxByte[1];
- pBoxPermute[17] = sBoxByte[7];
- pBoxPermute[18] = sBoxByte[23];
- pBoxPermute[19] = sBoxByte[13];
- pBoxPermute[20] = sBoxByte[31];
- pBoxPermute[21] = sBoxByte[26];
- pBoxPermute[22] = sBoxByte[2];
- pBoxPermute[23] = sBoxByte[8];
- pBoxPermute[24] = sBoxByte[18];
- pBoxPermute[25] = sBoxByte[12];
- pBoxPermute[26] = sBoxByte[29];
- pBoxPermute[27] = sBoxByte[5];
- pBoxPermute[28] = sBoxByte[21];
- pBoxPermute[29] = sBoxByte[10];
- pBoxPermute[30] = sBoxByte[3];
- pBoxPermute[31] = sBoxByte[24];
- return pBoxPermute;
-}
-
-function finallyPermute(endByte) {
- var fpByte = new Array(64);
- fpByte[0] = endByte[39];
- fpByte[1] = endByte[7];
- fpByte[2] = endByte[47];
- fpByte[3] = endByte[15];
- fpByte[4] = endByte[55];
- fpByte[5] = endByte[23];
- fpByte[6] = endByte[63];
- fpByte[7] = endByte[31];
- fpByte[8] = endByte[38];
- fpByte[9] = endByte[6];
- fpByte[10] = endByte[46];
- fpByte[11] = endByte[14];
- fpByte[12] = endByte[54];
- fpByte[13] = endByte[22];
- fpByte[14] = endByte[62];
- fpByte[15] = endByte[30];
- fpByte[16] = endByte[37];
- fpByte[17] = endByte[5];
- fpByte[18] = endByte[45];
- fpByte[19] = endByte[13];
- fpByte[20] = endByte[53];
- fpByte[21] = endByte[21];
- fpByte[22] = endByte[61];
- fpByte[23] = endByte[29];
- fpByte[24] = endByte[36];
- fpByte[25] = endByte[4];
- fpByte[26] = endByte[44];
- fpByte[27] = endByte[12];
- fpByte[28] = endByte[52];
- fpByte[29] = endByte[20];
- fpByte[30] = endByte[60];
- fpByte[31] = endByte[28];
- fpByte[32] = endByte[35];
- fpByte[33] = endByte[3];
- fpByte[34] = endByte[43];
- fpByte[35] = endByte[11];
- fpByte[36] = endByte[51];
- fpByte[37] = endByte[19];
- fpByte[38] = endByte[59];
- fpByte[39] = endByte[27];
- fpByte[40] = endByte[34];
- fpByte[41] = endByte[2];
- fpByte[42] = endByte[42];
- fpByte[43] = endByte[10];
- fpByte[44] = endByte[50];
- fpByte[45] = endByte[18];
- fpByte[46] = endByte[58];
- fpByte[47] = endByte[26];
- fpByte[48] = endByte[33];
- fpByte[49] = endByte[1];
- fpByte[50] = endByte[41];
- fpByte[51] = endByte[9];
- fpByte[52] = endByte[49];
- fpByte[53] = endByte[17];
- fpByte[54] = endByte[57];
- fpByte[55] = endByte[25];
- fpByte[56] = endByte[32];
- fpByte[57] = endByte[0];
- fpByte[58] = endByte[40];
- fpByte[59] = endByte[8];
- fpByte[60] = endByte[48];
- fpByte[61] = endByte[16];
- fpByte[62] = endByte[56];
- fpByte[63] = endByte[24];
- return fpByte;
-}
-
-function getBoxBinary(i) {
- var binary = "";
- switch (i) {
- case 0:
- binary = "0000";
- break;
- case 1:
- binary = "0001";
- break;
- case 2:
- binary = "0010";
- break;
- case 3:
- binary = "0011";
- break;
- case 4:
- binary = "0100";
- break;
- case 5:
- binary = "0101";
- break;
- case 6:
- binary = "0110";
- break;
- case 7:
- binary = "0111";
- break;
- case 8:
- binary = "1000";
- break;
- case 9:
- binary = "1001";
- break;
- case 10:
- binary = "1010";
- break;
- case 11:
- binary = "1011";
- break;
- case 12:
- binary = "1100";
- break;
- case 13:
- binary = "1101";
- break;
- case 14:
- binary = "1110";
- break;
- case 15:
- binary = "1111";
- break;
- }
- return binary;
-}
-/*
- * generate 16 keys for xor
- *
- */
-function generateKeys(keyByte) {
- var key = new Array(56);
- var keys = new Array();
-
- keys[0] = new Array();
- keys[1] = new Array();
- keys[2] = new Array();
- keys[3] = new Array();
- keys[4] = new Array();
- keys[5] = new Array();
- keys[6] = new Array();
- keys[7] = new Array();
- keys[8] = new Array();
- keys[9] = new Array();
- keys[10] = new Array();
- keys[11] = new Array();
- keys[12] = new Array();
- keys[13] = new Array();
- keys[14] = new Array();
- keys[15] = new Array();
- var loop = [1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1];
-
- for (i = 0; i < 7; i++) {
- for (j = 0, k = 7; j < 8; j++, k--) {
- key[i * 8 + j] = keyByte[8 * k + i];
- }
- }
-
- var i = 0;
- for (i = 0; i < 16; i++) {
- var tempLeft = 0;
- var tempRight = 0;
- for (j = 0; j < loop[i]; j++) {
- tempLeft = key[0];
- tempRight = key[28];
- for (k = 0; k < 27; k++) {
- key[k] = key[k + 1];
- key[28 + k] = key[29 + k];
- }
- key[27] = tempLeft;
- key[55] = tempRight;
- }
- var tempKey = new Array(48);
- tempKey[0] = key[13];
- tempKey[1] = key[16];
- tempKey[2] = key[10];
- tempKey[3] = key[23];
- tempKey[4] = key[0];
- tempKey[5] = key[4];
- tempKey[6] = key[2];
- tempKey[7] = key[27];
- tempKey[8] = key[14];
- tempKey[9] = key[5];
- tempKey[10] = key[20];
- tempKey[11] = key[9];
- tempKey[12] = key[22];
- tempKey[13] = key[18];
- tempKey[14] = key[11];
- tempKey[15] = key[3];
- tempKey[16] = key[25];
- tempKey[17] = key[7];
- tempKey[18] = key[15];
- tempKey[19] = key[6];
- tempKey[20] = key[26];
- tempKey[21] = key[19];
- tempKey[22] = key[12];
- tempKey[23] = key[1];
- tempKey[24] = key[40];
- tempKey[25] = key[51];
- tempKey[26] = key[30];
- tempKey[27] = key[36];
- tempKey[28] = key[46];
- tempKey[29] = key[54];
- tempKey[30] = key[29];
- tempKey[31] = key[39];
- tempKey[32] = key[50];
- tempKey[33] = key[44];
- tempKey[34] = key[32];
- tempKey[35] = key[47];
- tempKey[36] = key[43];
- tempKey[37] = key[48];
- tempKey[38] = key[38];
- tempKey[39] = key[55];
- tempKey[40] = key[33];
- tempKey[41] = key[52];
- tempKey[42] = key[45];
- tempKey[43] = key[41];
- tempKey[44] = key[49];
- tempKey[45] = key[35];
- tempKey[46] = key[28];
- tempKey[47] = key[31];
- switch (i) {
- case 0:
- for (m = 0; m < 48; m++) {
- keys[0][m] = tempKey[m];
- }
- break;
- case 1:
- for (m = 0; m < 48; m++) {
- keys[1][m] = tempKey[m];
- }
- break;
- case 2:
- for (m = 0; m < 48; m++) {
- keys[2][m] = tempKey[m];
- }
- break;
- case 3:
- for (m = 0; m < 48; m++) {
- keys[3][m] = tempKey[m];
- }
- break;
- case 4:
- for (m = 0; m < 48; m++) {
- keys[4][m] = tempKey[m];
- }
- break;
- case 5:
- for (m = 0; m < 48; m++) {
- keys[5][m] = tempKey[m];
- }
- break;
- case 6:
- for (m = 0; m < 48; m++) {
- keys[6][m] = tempKey[m];
- }
- break;
- case 7:
- for (m = 0; m < 48; m++) {
- keys[7][m] = tempKey[m];
- }
- break;
- case 8:
- for (m = 0; m < 48; m++) {
- keys[8][m] = tempKey[m];
- }
- break;
- case 9:
- for (m = 0; m < 48; m++) {
- keys[9][m] = tempKey[m];
- }
- break;
- case 10:
- for (m = 0; m < 48; m++) {
- keys[10][m] = tempKey[m];
- }
- break;
- case 11:
- for (m = 0; m < 48; m++) {
- keys[11][m] = tempKey[m];
- }
- break;
- case 12:
- for (m = 0; m < 48; m++) {
- keys[12][m] = tempKey[m];
- }
- break;
- case 13:
- for (m = 0; m < 48; m++) {
- keys[13][m] = tempKey[m];
- }
- break;
- case 14:
- for (m = 0; m < 48; m++) {
- keys[14][m] = tempKey[m];
- }
- break;
- case 15:
- for (m = 0; m < 48; m++) {
- keys[15][m] = tempKey[m];
- }
- break;
- }
- }
- return keys;
-}
\ No newline at end of file
diff --git a/json/model.json b/json/model.json
index 812b34a..a01cc8c 100644
--- a/json/model.json
+++ b/json/model.json
@@ -1,310 +1,315 @@
{
- "header": {
- "code": 0,
- "message": {
- "title": "",
- "detail": ""
+ "header": {
+ "code": 0,
+ "message": {
+ "title": "",
+ "detail": ""
+ }
+ },
+ "body": {
+ "dataStores": {
+ "535b1ef6-bf51-4d4c-9ae4-5a90cdc4": {
+ "rowSet": {
+ "primary": [
+ {
+ "ZH": "",
+ "_t": 3,
+ "XM": "",
+ "XSXB": "",
+ "NL": "",
+ "SZDW": "",
+ "ZYMC": "",
+ "XSLX": "",
+ "ZXSJ": "",
+ "SBSJ": "",
+ "FDYXMX": "",
+ "JJLXRXM": "",
+ "JJLXRDH": "",
+ "JJLXRYBRGX": "",
+ "LXZT": "",
+ "DQSFJJIA": "",
+ "sheng_TEXT": "",
+ "sheng": "",
+ "shi_TEXT": "",
+ "shi": "",
+ "quxian_TEXT": "",
+ "quxian": "",
+ "DQJZDZ": "",
+ "XQSFYQRBL": "否No",
+ "DRTW": "{Temp}",
+ "CLSJ": "",
+ "BRSFFS": "否No",
+ "YWZZ": "无症状No symptoms",
+ "ZZLX": "",
+ "JJGDZ": "否No",
+ "JZGDZ": "否No",
+ "YSGDZ": "否No",
+ "YWZZGDZ": "无症状No symptoms",
+ "ZZLXGDZ": "",
+ "QTZZMS": "",
+ "ZKGDZ": "",
+ "SFJJYXGL": "否No",
+ "JJGLZT": "",
+ "YXGCX": "否No",
+ "JZYXGCZT": "",
+ "SFYSHQZ": "否No",
+ "QZQK": "",
+ "SFDGYQSQ": "否No",
+ "SFJCGYQ": "否No",
+ "SFJQZYQHZ": "否No",
+ "JRSFYJCS": "否No",
+ "EXCASE": "否No",
+ "EXCASECONTACT": "否No",
+ "EXFOURTEENFEVER": "否No",
+ "EXTEST": "否No",
+ "EXTESTRESULT": "否No",
+ "sflxs": "否 No",
+ "sqsfyyq": "否 No",
+ "FXQKGDZ": "",
+ "FXLYD": "",
+ "FXSJ": "",
+ "LXMDD": "",
+ "LXSJ": "",
+ "GRCN": "我承诺以上信息真实准确,并愿意承担相应法律责任。I promise that the above information is true and accurate, and I am willing to bear the corresponding legal responsibility.",
+ "FYZKGDZ": "",
+ "JZGC": "",
+ "JZGLDD": "",
+ "JJYXGC": "",
+ "JJYXGCDD": "",
+ "_o": {
+ "ZH": null,
+ "XM": null,
+ "XSXB": null,
+ "NL": null,
+ "SZDW": null,
+ "ZYMC": null,
+ "XSLX": null,
+ "ZXSJ": null,
+ "SBSJ": null,
+ "FDYXMX": null,
+ "JJLXRXM": null,
+ "JJLXRDH": null,
+ "JJLXRYBRGX": null,
+ "LXZT": null,
+ "DQSFJJIA": null,
+ "sheng_TEXT": null,
+ "sheng": null,
+ "shi_TEXT": null,
+ "shi": null,
+ "quxian_TEXT": null,
+ "quxian": null,
+ "DQJZDZ": null,
+ "XQSFYQRBL": null,
+ "DRTW": null,
+ "CLSJ": null,
+ "BRSFFS": null,
+ "YWZZ": null,
+ "ZZLX": null,
+ "JJGDZ": null,
+ "JZGDZ": null,
+ "YSGDZ": null,
+ "YWZZGDZ": null,
+ "ZZLXGDZ": null,
+ "QTZZMS": null,
+ "ZKGDZ": null,
+ "SFJJYXGL": null,
+ "JJGLZT": null,
+ "YXGCX": null,
+ "JZYXGCZT": null,
+ "SFYSHQZ": null,
+ "QZQK": null,
+ "SFDGYQSQ": null,
+ "SFJCGYQ": null,
+ "SFJQZYQHZ": null,
+ "JRSFYJCS": null,
+ "EXCASE": null,
+ "EXCASECONTACT": null,
+ "EXFOURTEENFEVER": null,
+ "EXTEST": null,
+ "EXTESTRESULT": null,
+ "sflxs": null,
+ "sqsfyyq": null,
+ "FXQKGDZ": null,
+ "FXLYD": null,
+ "FXSJ": null,
+ "LXMDD": null,
+ "LXSJ": null,
+ "GRCN": null,
+ "FYZKGDZ": null,
+ "JZGC": null,
+ "JZGLDD": null,
+ "JJYXGC": null,
+ "JJYXGCDD": null
+ }
+ }
+ ],
+ "filter": [],
+ "delete": []
+ },
+ "name": "535b1ef6-bf51-4d4c-9ae4-5a90cdc4",
+ "pageNumber": 1,
+ "pageSize": 2147483647,
+ "recordCount": 1,
+ "rowSetName": "3586b9e6-f964-4a3b-a693-bb23da84",
+ "parameters": {
+ "relatedcontrols": "body_0",
+ "primarykey": "pk_id",
+ "queryds": "535b1ef6-bf51-4d4c-9ae4-5a90cdc4"
}
- },
- "body": {
- "dataStores": {
- "535b1ef6-bf51-4d4c-9ae4-5a90cdc4": {
- "rowSet": {
- "primary": [{
- "ZH": "",
- "_t": 3,
- "XM": "",
- "XSXB": "",
- "NL": "",
- "SZDW": "",
- "ZYMC": "",
- "XSLX": "",
- "ZXSJ": "",
- "SBSJ": "",
- "FDYXMX": "",
- "JJLXRXM": "",
- "JJLXRDH": "",
- "JJLXRYBRGX": "",
- "LXZT": "",
- "DQSFJJIA": "",
- "sheng_TEXT": "",
- "sheng": "",
- "shi_TEXT": "",
- "shi": "",
- "quxian_TEXT": "",
- "quxian": "",
- "DQJZDZ": "",
- "XQSFYQRBL": "否No",
- "DRTW": "{Temp}",
- "CLSJ": "",
- "BRSFFS": "否No",
- "YWZZ": "无症状No symptoms",
- "ZZLX": "",
- "JJGDZ": "否No",
- "JZGDZ": "否No",
- "YSGDZ": "否No",
- "YWZZGDZ": "无症状No symptoms",
- "ZZLXGDZ": "",
- "QTZZMS": "",
- "ZKGDZ": "",
- "SFJJYXGL": "否No",
- "JJGLZT": "",
- "YXGCX": "否No",
- "JZYXGCZT": "",
- "SFYSHQZ": "否No",
- "QZQK": "",
- "SFDGYQSQ": "否No",
- "SFJCGYQ": "否No",
- "SFJQZYQHZ": "否No",
- "JRSFYJCS": "否No",
- "EXCASE": "否No",
- "EXCASECONTACT": "否No",
- "EXFOURTEENFEVER": "否No",
- "EXTEST": "否No",
- "EXTESTRESULT": "否No",
- "sflxs": "否 No",
- "sqsfyyq": "否 No",
- "FXQKGDZ": "",
- "FXLYD": "",
- "FXSJ": "",
- "LXMDD": "",
- "LXSJ": "",
- "GRCN": "我承诺以上信息真实准确,并愿意承担相应法律责任。I promise that the above information is true and accurate, and I am willing to bear the corresponding legal responsibility.",
- "FYZKGDZ": "",
- "JZGC": "",
- "JZGLDD": "",
- "JJYXGC": "",
- "JJYXGCDD": "",
- "_o": {
- "ZH": null,
- "XM": null,
- "XSXB": null,
- "NL": null,
- "SZDW": null,
- "ZYMC": null,
- "XSLX": null,
- "ZXSJ": null,
- "SBSJ": null,
- "FDYXMX": null,
- "JJLXRXM": null,
- "JJLXRDH": null,
- "JJLXRYBRGX": null,
- "LXZT": null,
- "DQSFJJIA": null,
- "sheng_TEXT": null,
- "sheng": null,
- "shi_TEXT": null,
- "shi": null,
- "quxian_TEXT": null,
- "quxian": null,
- "DQJZDZ": null,
- "XQSFYQRBL": null,
- "DRTW": null,
- "CLSJ": null,
- "BRSFFS": null,
- "YWZZ": null,
- "ZZLX": null,
- "JJGDZ": null,
- "JZGDZ": null,
- "YSGDZ": null,
- "YWZZGDZ": null,
- "ZZLXGDZ": null,
- "QTZZMS": null,
- "ZKGDZ": null,
- "SFJJYXGL": null,
- "JJGLZT": null,
- "YXGCX": null,
- "JZYXGCZT": null,
- "SFYSHQZ": null,
- "QZQK": null,
- "SFDGYQSQ": null,
- "SFJCGYQ": null,
- "SFJQZYQHZ": null,
- "JRSFYJCS": null,
- "EXCASE": null,
- "EXCASECONTACT": null,
- "EXFOURTEENFEVER": null,
- "EXTEST": null,
- "EXTESTRESULT": null,
- "sflxs": null,
- "sqsfyyq": null,
- "FXQKGDZ": null,
- "FXLYD": null,
- "FXSJ": null,
- "LXMDD": null,
- "LXSJ": null,
- "GRCN": null,
- "FYZKGDZ": null,
- "JZGC": null,
- "JZGLDD": null,
- "JJYXGC": null,
- "JJYXGCDD": null
- }
- }],
- "filter": [],
- "delete": []
- },
- "name": "535b1ef6-bf51-4d4c-9ae4-5a90cdc4",
- "pageNumber": 1,
- "pageSize": 2147483647,
- "recordCount": 1,
- "rowSetName": "3586b9e6-f964-4a3b-a693-bb23da84",
- "parameters": {
- "relatedcontrols": "body_0",
- "primarykey": "pk_id",
- "queryds": "535b1ef6-bf51-4d4c-9ae4-5a90cdc4"
- }
- },
- "535b1ef6-bf51-4d4c-9ae4-5a90cdc4_record": {
- "rowSet": {
- "primary": [{
- "ZZLX": "",
- "LXZT": "",
- "DRTW": "36.3",
- "JJGLZT": "",
- "GRCN": "我承诺以上信息真实准确,并愿意承担相应法律责任。I promise that the above information is true and accurate, and I am willing to bear the corresponding legal responsibility.",
- "ZXSJ": "",
- "pk_id": "",
- "ZH": "",
- "YWZZ": "无症状No symptoms",
- "JZGDZ": "否No",
- "ZYMC": "",
- "LXMDD": "",
- "quxian_TEXT": "",
- "DQSFJJIA": "",
- "SZDW": "",
- "FXQKGDZ": "",
- "CLSJ": "",
- "SFJCGYQ": "否No",
- "YWZZGDZ": "无症状No symptoms",
- "JZYXGCZT": "",
- "SBSJ": "",
- "YSGDZ": "否No",
- "shi": "",
- "BRSFFS": "否No",
- "FDYXMX": "",
- "EXFOURTEENFEVER": "否No",
- "XSXB": "",
- "JJYXGCDD": "",
- "JJLXRDH": "",
- "SFJJYXGL": "否No",
- "DQJZDZ": "",
- "NL": "",
- "LXSJ": "",
- "JZGC": "",
- "FYZKGDZ": "",
- "JRSFYJCS": "否No",
- "FXSJ": "",
- "JJLXRXM": "",
- "XQSFYQRBL": "否No",
- "fk_id": "",
- "JJLXRYBRGX": "",
- "XM": "",
- "JJYXGC": "",
- "SFJQZYQHZ": "否No",
- "SFYSHQZ": "否No",
- "sheng": "",
- "XSLX": "",
- "ZZLXGDZ": "",
- "SFDGYQSQ": "否No",
- "ZKGDZ": "",
- "EXTESTRESULT": "否No",
- "EXCASECONTACT": "否No",
- "SBSJ_STR": "",
- "JZGLDD": "",
- "JJGDZ": "否No",
- "quxian": "",
- "shi_TEXT": "",
- "sqsfyyq": "否 No",
- "EXTEST": "否No",
- "EXCASE": "否No",
- "FXLYD": "",
- "sflxs": "否 No",
- "sheng_TEXT": "",
- "YXGCX": "否No",
- "QZQK": "",
- "CLSJ_STR": "",
- "QTZZMS": ""
- }],
- "filter": [],
- "delete": []
- },
- "name": "535b1ef6-bf51-4d4c-9ae4-5a90cdc4_record",
- "pageNumber": 1,
- "pageSize": 2147483647,
- "recordCount": 0,
- "rowSetName": "3586b9e6-f964-4a3b-a693-bb23da84",
- "parameters": {
- "relatedcontrols": "body_0",
- "primarykey": "pk_id",
- "queryds": "535b1ef6-bf51-4d4c-9ae4-5a90cdc4"
- }
- },
- "variable": {
- "rowSet": {
- "primary": [{
- "source": "interface",
- "name": "SYS_USER",
- "value": "",
- "type": "string"
- },
- {
- "source": "interface",
- "name": "SYS_UNIT",
- "value": "",
- "type": "string"
- },
- {
- "source": "interface",
- "name": "SYS_DATE",
- "value": "",
- "type": "date"
- },
- {
- "name": "1189060d-4465-4b53-89c2-c9f88457.ID_NUMBER",
- "value": ""
- },
- {
- "name": "1189060d-4465-4b53-89c2-c9f88457.USER_NAME",
- "value": ""
- },
- {
- "name": "666d8a60-7108-4681-829d-545841c3.XB",
- "value": ""
- },
- {
- "name": "666d8a60-7108-4681-829d-545841c3.SZYX",
- "value": ""
- },
- {
- "name": "666d8a60-7108-4681-829d-545841c3.ZYMC",
- "value": ""
- },
- {
- "name": "1189060d-4465-4b53-89c2-c9f88457.MOBILE",
- "value": ""
- }
- ],
- "filter": [],
- "delete": []
- },
- "name": "variable",
- "pageNumber": 1,
- "pageSize": 2147483647,
- "recordCount": 0,
- "parameters": {}
+ },
+ "535b1ef6-bf51-4d4c-9ae4-5a90cdc4_record": {
+ "rowSet": {
+ "primary": [
+ {
+ "ZZLX": "",
+ "LXZT": "",
+ "DRTW": "36.3",
+ "JJGLZT": "",
+ "GRCN": "我承诺以上信息真实准确,并愿意承担相应法律责任。I promise that the above information is true and accurate, and I am willing to bear the corresponding legal responsibility.",
+ "ZXSJ": "",
+ "pk_id": "",
+ "ZH": "",
+ "YWZZ": "无症状No symptoms",
+ "JZGDZ": "否No",
+ "ZYMC": "",
+ "LXMDD": "",
+ "quxian_TEXT": "",
+ "DQSFJJIA": "",
+ "SZDW": "",
+ "FXQKGDZ": "",
+ "CLSJ": "",
+ "SFJCGYQ": "否No",
+ "YWZZGDZ": "无症状No symptoms",
+ "JZYXGCZT": "",
+ "SBSJ": "",
+ "YSGDZ": "否No",
+ "shi": "",
+ "BRSFFS": "否No",
+ "FDYXMX": "",
+ "EXFOURTEENFEVER": "否No",
+ "XSXB": "",
+ "JJYXGCDD": "",
+ "JJLXRDH": "",
+ "SFJJYXGL": "否No",
+ "DQJZDZ": "",
+ "NL": "",
+ "LXSJ": "",
+ "JZGC": "",
+ "FYZKGDZ": "",
+ "JRSFYJCS": "否No",
+ "FXSJ": "",
+ "JJLXRXM": "",
+ "XQSFYQRBL": "否No",
+ "fk_id": "",
+ "JJLXRYBRGX": "",
+ "XM": "",
+ "JJYXGC": "",
+ "SFJQZYQHZ": "否No",
+ "SFYSHQZ": "否No",
+ "sheng": "",
+ "XSLX": "",
+ "ZZLXGDZ": "",
+ "SFDGYQSQ": "否No",
+ "ZKGDZ": "",
+ "EXTESTRESULT": "否No",
+ "EXCASECONTACT": "否No",
+ "SBSJ_STR": "",
+ "JZGLDD": "",
+ "JJGDZ": "否No",
+ "quxian": "",
+ "shi_TEXT": "",
+ "sqsfyyq": "否 No",
+ "EXTEST": "否No",
+ "EXCASE": "否No",
+ "FXLYD": "",
+ "sflxs": "否 No",
+ "sheng_TEXT": "",
+ "YXGCX": "否No",
+ "QZQK": "",
+ "CLSJ_STR": "",
+ "QTZZMS": ""
}
+ ],
+ "filter": [],
+ "delete": []
},
+ "name": "535b1ef6-bf51-4d4c-9ae4-5a90cdc4_record",
+ "pageNumber": 1,
+ "pageSize": 2147483647,
+ "recordCount": 0,
+ "rowSetName": "3586b9e6-f964-4a3b-a693-bb23da84",
"parameters": {
- "formid": "",
- "status": "select",
- "privilegeId": "",
- "seqId": "",
- "service_id": "41d9ad4a-f681-4872-a400-20a3b606d399",
- "process": "",
- "strUserId": "",
- "strUserIdCC": "",
- "nextActId": ""
+ "relatedcontrols": "body_0",
+ "primarykey": "pk_id",
+ "queryds": "535b1ef6-bf51-4d4c-9ae4-5a90cdc4"
}
+ },
+ "variable": {
+ "rowSet": {
+ "primary": [
+ {
+ "source": "interface",
+ "name": "SYS_USER",
+ "value": "",
+ "type": "string"
+ },
+ {
+ "source": "interface",
+ "name": "SYS_UNIT",
+ "value": "",
+ "type": "string"
+ },
+ {
+ "source": "interface",
+ "name": "SYS_DATE",
+ "value": "",
+ "type": "date"
+ },
+ {
+ "name": "1189060d-4465-4b53-89c2-c9f88457.ID_NUMBER",
+ "value": ""
+ },
+ {
+ "name": "1189060d-4465-4b53-89c2-c9f88457.USER_NAME",
+ "value": ""
+ },
+ {
+ "name": "666d8a60-7108-4681-829d-545841c3.XB",
+ "value": ""
+ },
+ {
+ "name": "666d8a60-7108-4681-829d-545841c3.SZYX",
+ "value": ""
+ },
+ {
+ "name": "666d8a60-7108-4681-829d-545841c3.ZYMC",
+ "value": ""
+ },
+ {
+ "name": "1189060d-4465-4b53-89c2-c9f88457.MOBILE",
+ "value": ""
+ }
+ ],
+ "filter": [],
+ "delete": []
+ },
+ "name": "variable",
+ "pageNumber": 1,
+ "pageSize": 2147483647,
+ "recordCount": 0,
+ "parameters": {}
+ }
+ },
+ "parameters": {
+ "formid": "",
+ "status": "select",
+ "privilegeId": "",
+ "seqId": "",
+ "service_id": "41d9ad4a-f681-4872-a400-20a3b606d399",
+ "process": "",
+ "strUserId": "",
+ "strUserIdCC": "",
+ "nextActId": ""
}
+ }
}
\ No newline at end of file
diff --git a/json/new_model.json b/json/new_model.json
index a6fdd4e..28a52ff 100644
--- a/json/new_model.json
+++ b/json/new_model.json
@@ -1 +1,315 @@
-{"body":{"dataStores":{"2d26dfad-56ae-4cf3-ab26-87112f1e":{"name":"2d26dfad-56ae-4cf3-ab26-87112f1e","pageNumber":1,"pageSize":2147483647,"parameters":{"primarykey":"pk_id","queryds":"2d26dfad-56ae-4cf3-ab26-87112f1e","relatedcontrols":"body_0"},"recordCount":1,"rowSet":{"delete":[],"filter":[],"primary":[{"BRSFFS":"否No","CLSJ":"","DQJZDZ":"","DQSFJJIA":"","DRTW":"36.2","EXCASE":"否No","EXCASECONTACT":"否No","EXFOURTEENFEVER":"否No","EXTEST":"否No","EXTESTRESULT":"否No","FDYXMX":"","FXLYD":"","FXQKGDZ":"","FXSJ":"","FYZKGDZ":"","GRCN":"我承诺以上信息真实准确,并愿意承担相应法律责任。I promise that the above information is true and accurate, and I am willing to bear the corresponding legal responsibility.","JJGDZ":"否No","JJGLZT":"","JJLXRDH":"","JJLXRXM":"","JJLXRYBRGX":"","JJYXGC":"","JJYXGCDD":"","JRSFYJCS":"否No","JZGC":"","JZGDZ":"否No","JZGLDD":"","JZYXGCZT":"","LXMDD":"","LXSJ":"","LXZT":"","NL":"","QTZZMS":"","QZQK":"","SBSJ":"","SFDGYQSQ":"否No","SFJCGYQ":"否No","SFJJYXGL":"否No","SFJQZYQHZ":"否No","SFYSHQZ":"否No","SZDW":"","XM":"","XQSFYQRBL":"否No","XSLX":"","XSXB":"","YSGDZ":"否No","YWZZ":"无症状No symptoms","YWZZGDZ":"无症状No symptoms","YXGCX":"否No","ZH":"","ZKGDZ":"","ZXSJ":"","ZYMC":"","ZZLX":"","ZZLXGDZ":"","_o":{"BRSFFS":null,"CLSJ":null,"DQJZDZ":null,"DQSFJJIA":null,"DRTW":null,"EXCASE":null,"EXCASECONTACT":null,"EXFOURTEENFEVER":null,"EXTEST":null,"EXTESTRESULT":null,"FDYXMX":null,"FXLYD":null,"FXQKGDZ":null,"FXSJ":null,"FYZKGDZ":null,"GRCN":null,"JJGDZ":null,"JJGLZT":null,"JJLXRDH":null,"JJLXRXM":null,"JJLXRYBRGX":null,"JJYXGC":null,"JJYXGCDD":null,"JRSFYJCS":null,"JZGC":null,"JZGDZ":null,"JZGLDD":null,"JZYXGCZT":null,"LXMDD":null,"LXSJ":null,"LXZT":null,"NL":null,"QTZZMS":null,"QZQK":null,"SBSJ":null,"SFDGYQSQ":null,"SFJCGYQ":null,"SFJJYXGL":null,"SFJQZYQHZ":null,"SFYSHQZ":null,"SZDW":null,"XM":null,"XQSFYQRBL":null,"XSLX":null,"XSXB":null,"YSGDZ":null,"YWZZ":null,"YWZZGDZ":null,"YXGCX":null,"ZH":null,"ZKGDZ":null,"ZXSJ":null,"ZYMC":null,"ZZLX":null,"ZZLXGDZ":null,"quxian":null,"quxian_TEXT":null,"sflxs":null,"sheng":null,"sheng_TEXT":null,"shi":null,"shi_TEXT":null,"sqsfyyq":null},"_t":3,"quxian":"","quxian_TEXT":"","sflxs":"否 No","sheng":"","sheng_TEXT":"","shi":"","shi_TEXT":"","sqsfyyq":"否 No"}]},"rowSetName":"f4575f2f-e527-419d-8378-235497f9"},"2d26dfad-56ae-4cf3-ab26-87112f1e_record":{"name":"2d26dfad-56ae-4cf3-ab26-87112f1e_record","pageNumber":1,"pageSize":2147483647,"parameters":{"primarykey":"pk_id","queryds":"2d26dfad-56ae-4cf3-ab26-87112f1e","relatedcontrols":"body_0"},"recordCount":0,"rowSet":{"delete":[],"filter":[],"primary":[{"BRSFFS":"否No","CLSJ":"","CLSJ_STR":"","DQJZDZ":"","DQSFJJIA":"","DRTW":"36.3","EXCASE":"否No","EXCASECONTACT":"否No","EXFOURTEENFEVER":"否No","EXTEST":"否No","EXTESTRESULT":"否No","FDYXMX":"","FXLYD":"","FXQKGDZ":"","FXSJ":"","FYZKGDZ":"","GRCN":"我承诺以上信息真实准确,并愿意承担相应法律责任。I promise that the above information is true and accurate, and I am willing to bear the corresponding legal responsibility.","JJGDZ":"否No","JJGLZT":"","JJLXRDH":"","JJLXRXM":"","JJLXRYBRGX":"","JJYXGC":"","JJYXGCDD":"","JRSFYJCS":"否No","JZGC":"","JZGDZ":"否No","JZGLDD":"","JZYXGCZT":"","LXMDD":"","LXSJ":"","LXZT":"","NL":"","QTZZMS":"","QZQK":"","SBSJ":"","SBSJ_STR":"","SFDGYQSQ":"否No","SFJCGYQ":"否No","SFJJYXGL":"否No","SFJQZYQHZ":"否No","SFYSHQZ":"否No","SZDW":"","XM":"","XQSFYQRBL":"否No","XSLX":"","XSXB":"","YSGDZ":"否No","YWZZ":"无症状No symptoms","YWZZGDZ":"无症状No symptoms","YXGCX":"否No","ZH":"","ZKGDZ":"","ZXSJ":"","ZYMC":"","ZZLX":"","ZZLXGDZ":"","fk_id":"","pk_id":"","quxian":"","quxian_TEXT":"","sflxs":"否 No","sheng":"","sheng_TEXT":"","shi":"","shi_TEXT":"","sqsfyyq":"否 No"}]},"rowSetName":"f4575f2f-e527-419d-8378-235497f9"},"variable":{"name":"variable","pageNumber":1,"pageSize":2147483647,"parameters":{},"recordCount":0,"rowSet":{"delete":[],"filter":[],"primary":[{"name":"SYS_USER","source":"interface","type":"string","value":""},{"name":"SYS_UNIT","source":"interface","type":"string","value":""},{"name":"SYS_DATE","source":"interface","type":"date","value":""},{"name":"1189060d-4465-4b53-89c2-c9f88457.ID_NUMBER","value":""},{"name":"1189060d-4465-4b53-89c2-c9f88457.USER_NAME","value":""},{"name":"666d8a60-7108-4681-829d-545841c3.XB","value":""},{"name":"666d8a60-7108-4681-829d-545841c3.SZYX","value":""},{"name":"666d8a60-7108-4681-829d-545841c3.ZYMC","value":""},{"name":"1189060d-4465-4b53-89c2-c9f88457.MOBILE","value":""}]}}},"parameters":{"formid":"","nextActId":"","privilegeId":"","process":"","seqId":"","service_id":"41d9ad4a-f681-4872-a400-20a3b606d399","status":"select","strUserId":"","strUserIdCC":""}},"header":{"code":0,"message":{"detail":"","title":""}}}
\ No newline at end of file
+{
+ "body": {
+ "dataStores": {
+ "2d26dfad-56ae-4cf3-ab26-87112f1e": {
+ "name": "2d26dfad-56ae-4cf3-ab26-87112f1e",
+ "pageNumber": 1,
+ "pageSize": 2147483647,
+ "parameters": {
+ "primarykey": "pk_id",
+ "queryds": "2d26dfad-56ae-4cf3-ab26-87112f1e",
+ "relatedcontrols": "body_0"
+ },
+ "recordCount": 1,
+ "rowSet": {
+ "delete": [],
+ "filter": [],
+ "primary": [
+ {
+ "BRSFFS": "否No",
+ "CLSJ": "",
+ "DQJZDZ": "",
+ "DQSFJJIA": "",
+ "DRTW": "36.2",
+ "EXCASE": "否No",
+ "EXCASECONTACT": "否No",
+ "EXFOURTEENFEVER": "否No",
+ "EXTEST": "否No",
+ "EXTESTRESULT": "否No",
+ "FDYXMX": "",
+ "FXLYD": "",
+ "FXQKGDZ": "",
+ "FXSJ": "",
+ "FYZKGDZ": "",
+ "GRCN": "我承诺以上信息真实准确,并愿意承担相应法律责任。I promise that the above information is true and accurate, and I am willing to bear the corresponding legal responsibility.",
+ "JJGDZ": "否No",
+ "JJGLZT": "",
+ "JJLXRDH": "",
+ "JJLXRXM": "",
+ "JJLXRYBRGX": "",
+ "JJYXGC": "",
+ "JJYXGCDD": "",
+ "JRSFYJCS": "否No",
+ "JZGC": "",
+ "JZGDZ": "否No",
+ "JZGLDD": "",
+ "JZYXGCZT": "",
+ "LXMDD": "",
+ "LXSJ": "",
+ "LXZT": "",
+ "NL": "",
+ "QTZZMS": "",
+ "QZQK": "",
+ "SBSJ": "",
+ "SFDGYQSQ": "否No",
+ "SFJCGYQ": "否No",
+ "SFJJYXGL": "否No",
+ "SFJQZYQHZ": "否No",
+ "SFYSHQZ": "否No",
+ "SZDW": "",
+ "XM": "",
+ "XQSFYQRBL": "否No",
+ "XSLX": "",
+ "XSXB": "",
+ "YSGDZ": "否No",
+ "YWZZ": "无症状No symptoms",
+ "YWZZGDZ": "无症状No symptoms",
+ "YXGCX": "否No",
+ "ZH": "",
+ "ZKGDZ": "",
+ "ZXSJ": "",
+ "ZYMC": "",
+ "ZZLX": "",
+ "ZZLXGDZ": "",
+ "_o": {
+ "BRSFFS": null,
+ "CLSJ": null,
+ "DQJZDZ": null,
+ "DQSFJJIA": null,
+ "DRTW": null,
+ "EXCASE": null,
+ "EXCASECONTACT": null,
+ "EXFOURTEENFEVER": null,
+ "EXTEST": null,
+ "EXTESTRESULT": null,
+ "FDYXMX": null,
+ "FXLYD": null,
+ "FXQKGDZ": null,
+ "FXSJ": null,
+ "FYZKGDZ": null,
+ "GRCN": null,
+ "JJGDZ": null,
+ "JJGLZT": null,
+ "JJLXRDH": null,
+ "JJLXRXM": null,
+ "JJLXRYBRGX": null,
+ "JJYXGC": null,
+ "JJYXGCDD": null,
+ "JRSFYJCS": null,
+ "JZGC": null,
+ "JZGDZ": null,
+ "JZGLDD": null,
+ "JZYXGCZT": null,
+ "LXMDD": null,
+ "LXSJ": null,
+ "LXZT": null,
+ "NL": null,
+ "QTZZMS": null,
+ "QZQK": null,
+ "SBSJ": null,
+ "SFDGYQSQ": null,
+ "SFJCGYQ": null,
+ "SFJJYXGL": null,
+ "SFJQZYQHZ": null,
+ "SFYSHQZ": null,
+ "SZDW": null,
+ "XM": null,
+ "XQSFYQRBL": null,
+ "XSLX": null,
+ "XSXB": null,
+ "YSGDZ": null,
+ "YWZZ": null,
+ "YWZZGDZ": null,
+ "YXGCX": null,
+ "ZH": null,
+ "ZKGDZ": null,
+ "ZXSJ": null,
+ "ZYMC": null,
+ "ZZLX": null,
+ "ZZLXGDZ": null,
+ "quxian": null,
+ "quxian_TEXT": null,
+ "sflxs": null,
+ "sheng": null,
+ "sheng_TEXT": null,
+ "shi": null,
+ "shi_TEXT": null,
+ "sqsfyyq": null
+ },
+ "_t": 3,
+ "quxian": "",
+ "quxian_TEXT": "",
+ "sflxs": "否 No",
+ "sheng": "",
+ "sheng_TEXT": "",
+ "shi": "",
+ "shi_TEXT": "",
+ "sqsfyyq": "否 No"
+ }
+ ]
+ },
+ "rowSetName": "f4575f2f-e527-419d-8378-235497f9"
+ },
+ "2d26dfad-56ae-4cf3-ab26-87112f1e_record": {
+ "name": "2d26dfad-56ae-4cf3-ab26-87112f1e_record",
+ "pageNumber": 1,
+ "pageSize": 2147483647,
+ "parameters": {
+ "primarykey": "pk_id",
+ "queryds": "2d26dfad-56ae-4cf3-ab26-87112f1e",
+ "relatedcontrols": "body_0"
+ },
+ "recordCount": 0,
+ "rowSet": {
+ "delete": [],
+ "filter": [],
+ "primary": [
+ {
+ "BRSFFS": "否No",
+ "CLSJ": "",
+ "CLSJ_STR": "",
+ "DQJZDZ": "",
+ "DQSFJJIA": "",
+ "DRTW": "36.3",
+ "EXCASE": "否No",
+ "EXCASECONTACT": "否No",
+ "EXFOURTEENFEVER": "否No",
+ "EXTEST": "否No",
+ "EXTESTRESULT": "否No",
+ "FDYXMX": "",
+ "FXLYD": "",
+ "FXQKGDZ": "",
+ "FXSJ": "",
+ "FYZKGDZ": "",
+ "GRCN": "我承诺以上信息真实准确,并愿意承担相应法律责任。I promise that the above information is true and accurate, and I am willing to bear the corresponding legal responsibility.",
+ "JJGDZ": "否No",
+ "JJGLZT": "",
+ "JJLXRDH": "",
+ "JJLXRXM": "",
+ "JJLXRYBRGX": "",
+ "JJYXGC": "",
+ "JJYXGCDD": "",
+ "JRSFYJCS": "否No",
+ "JZGC": "",
+ "JZGDZ": "否No",
+ "JZGLDD": "",
+ "JZYXGCZT": "",
+ "LXMDD": "",
+ "LXSJ": "",
+ "LXZT": "",
+ "NL": "",
+ "QTZZMS": "",
+ "QZQK": "",
+ "SBSJ": "",
+ "SBSJ_STR": "",
+ "SFDGYQSQ": "否No",
+ "SFJCGYQ": "否No",
+ "SFJJYXGL": "否No",
+ "SFJQZYQHZ": "否No",
+ "SFYSHQZ": "否No",
+ "SZDW": "",
+ "XM": "",
+ "XQSFYQRBL": "否No",
+ "XSLX": "",
+ "XSXB": "",
+ "YSGDZ": "否No",
+ "YWZZ": "无症状No symptoms",
+ "YWZZGDZ": "无症状No symptoms",
+ "YXGCX": "否No",
+ "ZH": "",
+ "ZKGDZ": "",
+ "ZXSJ": "",
+ "ZYMC": "",
+ "ZZLX": "",
+ "ZZLXGDZ": "",
+ "fk_id": "",
+ "pk_id": "",
+ "quxian": "",
+ "quxian_TEXT": "",
+ "sflxs": "否 No",
+ "sheng": "",
+ "sheng_TEXT": "",
+ "shi": "",
+ "shi_TEXT": "",
+ "sqsfyyq": "否 No"
+ }
+ ]
+ },
+ "rowSetName": "f4575f2f-e527-419d-8378-235497f9"
+ },
+ "variable": {
+ "name": "variable",
+ "pageNumber": 1,
+ "pageSize": 2147483647,
+ "parameters": {},
+ "recordCount": 0,
+ "rowSet": {
+ "delete": [],
+ "filter": [],
+ "primary": [
+ {
+ "name": "SYS_USER",
+ "source": "interface",
+ "type": "string",
+ "value": ""
+ },
+ {
+ "name": "SYS_UNIT",
+ "source": "interface",
+ "type": "string",
+ "value": ""
+ },
+ {
+ "name": "SYS_DATE",
+ "source": "interface",
+ "type": "date",
+ "value": ""
+ },
+ {
+ "name": "1189060d-4465-4b53-89c2-c9f88457.ID_NUMBER",
+ "value": ""
+ },
+ {
+ "name": "1189060d-4465-4b53-89c2-c9f88457.USER_NAME",
+ "value": ""
+ },
+ {
+ "name": "666d8a60-7108-4681-829d-545841c3.XB",
+ "value": ""
+ },
+ {
+ "name": "666d8a60-7108-4681-829d-545841c3.SZYX",
+ "value": ""
+ },
+ {
+ "name": "666d8a60-7108-4681-829d-545841c3.ZYMC",
+ "value": ""
+ },
+ {
+ "name": "1189060d-4465-4b53-89c2-c9f88457.MOBILE",
+ "value": ""
+ }
+ ]
+ }
+ }
+ },
+ "parameters": {
+ "formid": "",
+ "nextActId": "",
+ "privilegeId": "",
+ "process": "",
+ "seqId": "",
+ "service_id": "41d9ad4a-f681-4872-a400-20a3b606d399",
+ "status": "select",
+ "strUserId": "",
+ "strUserIdCC": ""
+ }
+ },
+ "header": {
+ "code": 0,
+ "message": {
+ "detail": "",
+ "title": ""
+ }
+ }
+}
\ No newline at end of file
diff --git a/model.py b/model.py
index 0acf6b8..6acec72 100644
--- a/model.py
+++ b/model.py
@@ -1,8 +1,9 @@
-import time
-import pytz
import datetime
-import demjson as json
import random as rand
+import time
+
+import demjson as json
+import pytz
TIME_ZONE = 'Asia/Shanghai'
@@ -11,9 +12,10 @@ def test(data):
print("model")
print(data)
+
def get_random_temp():
temp = 36.2
- if(rand.random() > 0.8):
+ if (rand.random() > 0.8):
temp += 0.1
return temp
@@ -44,7 +46,7 @@ def generate_post_data(source_data):
for code in source_data["body"]["dataStores"]:
new_key[code] = len(code)
- sorted_key = sorted(new_key.items(), key = lambda x:x[1])
+ sorted_key = sorted(new_key.items(), key=lambda x: x[1])
# print("sorted_key",sorted_key)
# print("sorted_key[1][0]",sorted_key[1][0])
@@ -59,7 +61,7 @@ def generate_post_data(source_data):
json_file.close()
# add {var} feature
- model_txt = model_txt.replace(r"{Temp}", "%.1f"%get_random_temp())
+ model_txt = model_txt.replace(r"{Temp}", "%.1f" % get_random_temp())
model_data = json.decode(model_txt)
# model_data = json.decode_file("./json/model.json")
@@ -80,8 +82,10 @@ def generate_post_data(source_data):
new_model_data["body"]["parameters"] = model_data["body"]["parameters"]
new_model_data["body"]["dataStores"] = {}
new_model_data["body"]["dataStores"]["variable"] = model_data["body"]["dataStores"]["variable"]
- new_model_data["body"]["dataStores"][unknown_code_use] = model_data["body"]["dataStores"]['535b1ef6-bf51-4d4c-9ae4-5a90cdc4']
- new_model_data["body"]["dataStores"][unknown_code_record] = model_data["body"]["dataStores"]['535b1ef6-bf51-4d4c-9ae4-5a90cdc4_record']
+ new_model_data["body"]["dataStores"][unknown_code_use] = model_data["body"]["dataStores"][
+ '535b1ef6-bf51-4d4c-9ae4-5a90cdc4']
+ new_model_data["body"]["dataStores"][unknown_code_record] = model_data["body"]["dataStores"][
+ '535b1ef6-bf51-4d4c-9ae4-5a90cdc4_record']
new_model_data["body"]["dataStores"][unknown_code_use]["name"] = unknown_code_use
new_model_data["body"]["dataStores"][unknown_code_use]["parameters"]["queryds"] = unknown_code_use
new_model_data["body"]["dataStores"][unknown_code_record]["name"] = unknown_code_record
@@ -90,7 +94,6 @@ def generate_post_data(source_data):
new_model_data["body"]["dataStores"][unknown_code_use]["rowSetName"] = rowSetName
new_model_data["body"]["dataStores"][unknown_code_record]["rowSetName"] = rowSetName
-
json.encode_to_file("./json/new_model.json", new_model_data, overwrite=True)
model_data = new_model_data
@@ -108,29 +111,29 @@ def generate_post_data(source_data):
del model_data["body"]["dataStores"][unknown_code_record]
del model_data["body"]["dataStores"][unknown_code_use]["rowSet"]["primary"][0]["_o"]
- zh = source_record["ZH"] # student id
- xm = source_record["XM"] # student name
- xsxb = source_record["XSXB"] # student sex
- nl = source_record["NL"] # student age
- szdw = source_record["SZDW"] # student school
- zymc = source_record["ZYMC"] # student major
- xslx = source_record["XSLX"] # student type
- zxsj = source_record["ZXSJ"] # student phone number
- sbsj = current_date # date
- fdyxmx = source_record["FDYXMX"] # teacher name
- jjlxrxm = source_record["JJLXRXM"] # parent name
- jjlxrdh = source_record["JJLXRDH"] # parent phone number
- jjlxrybrgx = source_record["JJLXRYBRGX"] # parent rel.
- lxzt = source_record["LXZT"] # current city
- dqsfjjia = source_record["DQSFJJIA"] # at home or not?
- sheng_text = source_record["sheng_TEXT"] # provience text
- sheng = source_record["sheng"] # provience
- shi_text = source_record["shi_TEXT"] # city text
- shi = source_record["shi"] # city
+ zh = source_record["ZH"] # student id
+ xm = source_record["XM"] # student name
+ xsxb = source_record["XSXB"] # student sex
+ nl = source_record["NL"] # student age
+ szdw = source_record["SZDW"] # student school
+ zymc = source_record["ZYMC"] # student major
+ xslx = source_record["XSLX"] # student type
+ zxsj = source_record["ZXSJ"] # student phone number
+ sbsj = current_date # date
+ fdyxmx = source_record["FDYXMX"] # teacher name
+ jjlxrxm = source_record["JJLXRXM"] # parent name
+ jjlxrdh = source_record["JJLXRDH"] # parent phone number
+ jjlxrybrgx = source_record["JJLXRYBRGX"] # parent rel.
+ lxzt = source_record["LXZT"] # current city
+ dqsfjjia = source_record["DQSFJJIA"] # at home or not?
+ sheng_text = source_record["sheng_TEXT"] # provience text
+ sheng = source_record["sheng"] # provience
+ shi_text = source_record["shi_TEXT"] # city text
+ shi = source_record["shi"] # city
quxian_text = source_record["quxian_TEXT"] # tone text
- quxian = source_record["quxian"] # tone
- dqjzdz = source_record["DQJZDZ"] # location
- clsj = yesterday_date_time # temp. time
+ quxian = source_record["quxian"] # tone
+ dqjzdz = source_record["DQJZDZ"] # location
+ clsj = yesterday_date_time # temp. time
# SYS_USER = source_vars[0]["value"] # student name
# SYS_UNIT = source_vars[1]["value"] # student unit
diff --git a/requirements.txt b/requirements.txt
index 825d7a4..575617a 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -2,5 +2,5 @@ pytz==2020.5
requests==2.22.0
demjson==2.2.4
beautifulsoup4==4.9.3
-PyYAML==5.4.1
+PyYAML==5.3.1
secrets==1.0.2
diff --git a/sduhealth.py b/sduhealth.py
index dfd233f..be1a3fb 100644
--- a/sduhealth.py
+++ b/sduhealth.py
@@ -1,14 +1,12 @@
-import requests
import secrets
+from tkinter import messagebox
+
import demjson as json
-import os
-import yaml
+import requests
+from bs4 import BeautifulSoup
-import model
import encrypt
-
-from bs4 import BeautifulSoup
-from tkinter import messagebox
+import model
def js_from_file(filename):
@@ -49,7 +47,6 @@ def __init__(self, username, password) -> None:
self.username = username
self.password = password
-
self.home_title = "山东大学信息化公共服务平台"
self.serviceID = '41d9ad4a-f681-4872-a400-20a3b606d399'
self.privilege_id = ''
@@ -107,7 +104,7 @@ def health_login(self):
r = self.session.get(self.login_url)
if r.status_code != 200:
self.check_login = False
- #raise RuntimeError('Network Error!')
+ # raise RuntimeError('Network Error!')
return "网络错误"
lt_execution = get_lt_And_execution(r)
@@ -135,7 +132,7 @@ def health_login(self):
if title == self.home_title:
print(title)
print("login successful")
- #text.insert(INSERT,"login successful")
+ # text.insert(INSERT,"login successful")
self.check_login = True
return "登录成功"
else:
@@ -205,8 +202,8 @@ def get_continue_service(self):
def get_sign_data(self):
get_sign_data_url = "https://scenter.sdu.edu.cn/tp_fp/formParser?status=select&formid=" + self.form_id + "&service_id=" + \
- self.serviceID + "&process=" + self.process_id + "&seqId=&SYS_FK=" + \
- self.SYS_FK + "&privilegeId=" + self.privilege_id
+ self.serviceID + "&process=" + self.process_id + "&seqId=&SYS_FK=" + \
+ self.SYS_FK + "&privilegeId=" + self.privilege_id
try:
get_sign_data_result = self.session.get(get_sign_data_url)
@@ -257,7 +254,7 @@ def health_checkin(self):
return "你今天已经打过卡了"
checkin_url = "https://scenter.sdu.edu.cn/tp_fp/formParser?status=update&formid=" + \
- self.form_id + "&workflowAction=startProcess&seqId=&workitemid=&process=" + self.process_id
+ self.form_id + "&workflowAction=startProcess&seqId=&workitemid=&process=" + self.process_id
checkin_body = json.encode(self.frame_json)
print("Start Checkin!")
@@ -270,7 +267,7 @@ def health_checkin(self):
if result.status_code != 200:
self.check_checkin = False
return "网络错误"
- #raise RuntimeError("Checkin Network Error")
+ # raise RuntimeError("Checkin Network Error")
except:
self.check_checkin = False
else:
@@ -297,37 +294,15 @@ def read():
studentPasswords = []
try:
with open('./userinfo.txt', 'r') as f:
- user =f.readline()
+ user = f.readline()
password = f.readline()
- print(user,password)
- studentIDs.append(user.strip() )
+ print(user, password)
+ studentIDs.append(user.strip())
studentPasswords.append(password.strip())
return studentIDs, studentPasswords
except:
print("获取学号以及密码出错,请检查yml文件")
messagebox.showwarning('提示', '请先写入学工号和密码')
- # if 'CONFIG' in os.environ:
- # try:
- # with open('./userinfo.txt','r') as f:
- # studentIDs.append(f.readline())
- # studentPasswords.append(f.readline())
- # # config_current = yaml.load(
- # # os.environ['CONFIG'], Loader=yaml.FullLoader)
- # # studentIDs = config_current['jobs']['studentID']
- # # studentPasswords = config_current['jobs']['studentPassword']
- #
- # return studentIDs, studentPasswords
- # except:
- # print("获取学号以及密码出错,请检查yml文件")
- # messagebox.showwarning('提示','请先写入学工号和密码')
-
- # else:
- # with open("./config.yml", mode='r', encoding='utf-8') as f:
- # config_current = yaml.load(f, Loader=yaml.FullLoader)
- #
- # studentIDs = config_current['jobs']['studentID']
- # studentPasswords = config_current['jobs']['studentPassword']
- # return studentIDs, studentPasswords
def main():
@@ -343,7 +318,6 @@ def main():
if sdu.check_login == False:
print("Login Error")
return "请检查网络或者用户名和密码是否正确"
- #raise RuntimeError("Login Error")
info = sdu.health_checkin()
if sdu.whether_signed:
@@ -353,23 +327,16 @@ def main():
print("Get Sign Data Error")
sdu.health_logout()
return "获取签名数据错误"
- #raise RuntimeError("Get Sign Data Error")
if sdu.check_checkin == False:
print("Checkin Error")
sdu.health_logout()
return "Checkin错误"
- #raise RuntimeError("Checkin Error")
if not sdu.whether_signed:
sdu.health_logout()
return "打卡成功"
-
- # sdu.health_logout()
- # print("Logout Successful")
-
-
if __name__ == "__main__":
main()
diff --git "a/\345\261\261\345\244\247\346\211\223\345\215\241.py" "b/\345\261\261\345\244\247\346\211\223\345\215\241.py"
index a710e82..1546831 100644
--- "a/\345\261\261\345\244\247\346\211\223\345\215\241.py"
+++ "b/\345\261\261\345\244\247\346\211\223\345\215\241.py"
@@ -1,10 +1,9 @@
-from sduhealth import main
-from tkinter import messagebox
-from tkinter import *
import os
-import sys
from pathlib import Path
+from tkinter import *
+from tkinter import messagebox
+from sduhealth import main
class GuiSon():
@@ -31,10 +30,10 @@ def __init__(self):
self.text2.place(x=80, y=48, width=150, height=20)
self.btn = Button(self.top, text="保存", font=("微软雅黑", 15),
- bg='black', fg='white', relief='ridge', command=lambda: infoSave(self.text1.get(), self.text2.get(), self.top))
+ bg='black', fg='white', relief='ridge',
+ command=lambda: infoSave(self.text1.get(), self.text2.get(), self.top))
self.btn.place(x=85, y=78, width=80, height=35)
-
def getUserInfo(self):
if os.path.exists('./userinfo.txt'):
with open('./userinfo.txt', 'r') as f:
@@ -44,9 +43,11 @@ def getUserInfo(self):
self.text2.select_clear()
self.text1.insert(0, user.strip())
self.text2.insert(0, password.strip())
+
def mainloop(self):
self.top.mainloop()
+
class GUI():
def __init__(self):
self.window = Tk()
@@ -57,16 +58,17 @@ def __init__(self):
self.screenwidth = self.window.winfo_screenwidth()
self.screenheight = self.window.winfo_screenheight()
self.window.geometry('%dx%d+%d+%d' % (
- self.width, self.height, (self.screenwidth - self.width) / 2, (self.screenheight - self.height) / 2))
+ self.width, self.height, (self.screenwidth - self.width) / 2, (self.screenheight - self.height) / 2))
self.window.resizable(0, 0)
self.window.iconbitmap(Path(sys.argv[0]).parent.joinpath('sdu.ico'))
self.text = ''
def LabelInit(self):
- label1 = Label(self.window,text = '使用方法:1.配置用户名和密码',font=("微软雅黑", 10))
+ label1 = Label(self.window, text='使用方法:1.配置用户名和密码', font=("微软雅黑", 10))
label1.place(x=30, y=151)
label2 = Label(self.window, text="2.点击一键打卡", font=("微软雅黑", 10))
label2.place(x=86, y=171)
+
def buttonInit(self):
btn1 = Button(self.window, text="配置用户名和密码", font=("微软雅黑", 11),
fg='white', bg='#6495ED', command=create)
@@ -81,28 +83,28 @@ def buttonInit(self):
def mainloop(self):
self.window.mainloop()
-def clicked(text,window):
+
+def clicked(text, window):
info = main()
messagebox.showinfo('提示', info)
-def infoSave(user,password,top):
- f = open('./userinfo.txt','w')
- f.write(user+'\n')
+
+def infoSave(user, password, top):
+ f = open('./userinfo.txt', 'w')
+ f.write(user + '\n')
f.write(password)
- messagebox.showinfo('提示','信息保存成功!')
+ messagebox.showinfo('提示', '信息保存成功!')
top.destroy()
+
def create():
gui2 = GuiSon()
gui2.getUserInfo()
gui.mainloop()
+
if __name__ == "__main__":
gui = GUI()
gui.LabelInit()
gui.buttonInit()
gui.mainloop()
-
-
-
-