File tree 2 files changed +21
-17
lines changed
2 files changed +21
-17
lines changed Original file line number Diff line number Diff line change 37
37
# For a discussion on single-sourcing the version across setup.py and the
38
38
# project code, see
39
39
# https://packaging.python.org/en/latest/single_source_version.html
40
- version = '1.1.2 ' , # Required. eg. 1.2.3
40
+ version = '1.1.3 ' , # Required. eg. 1.2.3
41
41
42
42
# This is a one-line description or tagline of what your project does. This
43
43
# corresponds to the "Summary" metadata field:
Original file line number Diff line number Diff line change @@ -43,21 +43,25 @@ def verify_authorization(user_code, crypt=CRYPT) :
43
43
[param] crypt: 加解密类
44
44
[return] true: 注册码一致; false: 注册码不同
45
45
'''
46
- uuid = MI .generate ()
47
- expire_time = crypt .decrypt_des (user_code )
48
- register_code = gen_rc (crypt , uuid , expire_time )
49
- rst = (register_code == read (REGISTER_CODE_PATH ))
50
- if rst :
51
- expire_time = int (expire_time )
52
- expire_date = time .strftime ('%Y-%m-%d %H:%M:%S' , time .localtime (expire_time ))
53
- if expire_time == 0 :
54
- print ('注册码正确(永久)。' )
55
-
56
- elif now () <= expire_time :
57
- print ('注册码正确(有效期至 %s)。' % expire_date )
58
- else :
59
- rst = False
60
- print ('注册码已过期(有效期至 %s)。' % expire_date )
61
- else :
46
+ rst = False
47
+ try :
48
+ uuid = MI .generate ()
49
+ expire_time = crypt .decrypt_des (user_code )
50
+ register_code = gen_rc (crypt , uuid , expire_time )
51
+ rst = (register_code == read (REGISTER_CODE_PATH ))
52
+ if rst :
53
+ expire_time = int (expire_time )
54
+ expire_date = time .strftime ('%Y-%m-%d %H:%M:%S' , time .localtime (expire_time ))
55
+ if expire_time == 0 :
56
+ print ('注册码正确(永久)。' )
57
+
58
+ elif now () <= expire_time :
59
+ print ('注册码正确(有效期至 %s)。' % expire_date )
60
+ else :
61
+ rst = False
62
+ print ('注册码已过期(有效期至 %s)。' % expire_date )
63
+ except :
64
+ pass
65
+ if not rst :
62
66
print ('用户码错误 或 注册码不存在,请联系管理员。' )
63
67
return rst
You can’t perform that action at this time.
0 commit comments