gomyck-tools 1.5.2__py3-none-any.whl → 1.5.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -127,11 +127,16 @@ class CBottle:
127
127
  def enable_spa_mode(self):
128
128
  @self.bottle.error(404)
129
129
  def error_404_handler(error):
130
- if request.path.startswith('/api/'): return R.error(resp=R.Code.cus_code(404, "资源未找到: {}".format(error.body)))
130
+ if request.path.startswith('/api/'):
131
+ response.status = 404
132
+ return R.error(resp=R.Code.cus_code(404, "资源未找到: {}".format(error.body)))
131
133
  return static_file(filename=self.index_filename, root=self.index_root)
132
134
 
133
135
  @self.bottle.error(401)
134
136
  def unauthorized(error):
137
+ if request.path.startswith('/api/'):
138
+ response.status = 401
139
+ return R.error(resp=R.Code.cus_code(401, "系统未授权! {}".format(error.body)))
135
140
  response.status=301
136
141
  response.set_header('Location', urljoin(request.url, '/'))
137
142
  return response
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gomyck-tools
3
- Version: 1.5.2
3
+ Version: 1.5.3
4
4
  Summary: A tools collection for python development by hao474798383
5
5
  Author-email: gomyck <hao474798383@163.com>
6
6
  License-Expression: Apache-2.0
@@ -75,14 +75,14 @@ ctools/web/__init__.py,sha256=koSNYeKF5Z_xbp4Q2qbZ4ZP-3--1phbOYN9e4SJy_gk,98
75
75
  ctools/web/aio_web_server.py,sha256=p46BOU3_m4Jb57yAACeedKjhlFc1YC0QJSUe2selBgA,5693
76
76
  ctools/web/api_result.py,sha256=i1MjTnnlgkWl_q07xr-TLQeLYlXEh4DEclUFE414nSk,1568
77
77
  ctools/web/bottle_web_base.py,sha256=iQZJtRQH3HJ-P-48Gspvp1VEd6boAlZfiat3H8E5bBU,8763
78
- ctools/web/bottle_webserver.py,sha256=Gke_rjRrnUAl0rVe8rkTaq7SPrxb0cHKV_Ln6l7fqus,6854
78
+ ctools/web/bottle_webserver.py,sha256=0NzojpVL6_dBiY6tjrNtMFyu2-q1pKox4o9WDeAIQzE,7057
79
79
  ctools/web/bottle_websocket.py,sha256=xsu9fAtTuR5DsSsQjiBfaYxLjOWFyfr1sYM6cktTovI,1957
80
80
  ctools/web/ctoken.py,sha256=WaB29kqGlKAh21aUw5avl2h8AgLD1aESw8KCpqaN5nM,2539
81
81
  ctools/web/download_util.py,sha256=v0JTXiED1bvoWFfwfd-LD5s7_aoRQ0lCkaGwSnSp7WI,1954
82
82
  ctools/web/params_util.py,sha256=eJDV3PSq-ZHb8UZf6xqs8kOhbyZzits1H9yPoUBIDXg,828
83
83
  ctools/web/upload_util.py,sha256=z1QQCi4SFx08jrAQH5-Y_ShiM4MghuD_5Qz6V9KK_4U,1076
84
- gomyck_tools-1.5.2.dist-info/licenses/LICENSE,sha256=X25ypfH9E6VTht2hcO8k7LCSdHUcoG_ALQt80jdYZfY,547
85
- gomyck_tools-1.5.2.dist-info/METADATA,sha256=g3hKnHGV8s5DRPzimxL0XBhLbvHelBTKi0fAhN_iwto,1826
86
- gomyck_tools-1.5.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
87
- gomyck_tools-1.5.2.dist-info/top_level.txt,sha256=-MiIH9FYRVKp1i5_SVRkaI-71WmF1sZSRrNWFU9ls3s,7
88
- gomyck_tools-1.5.2.dist-info/RECORD,,
84
+ gomyck_tools-1.5.3.dist-info/licenses/LICENSE,sha256=X25ypfH9E6VTht2hcO8k7LCSdHUcoG_ALQt80jdYZfY,547
85
+ gomyck_tools-1.5.3.dist-info/METADATA,sha256=KU20PViB_EpAe3T8nFoHj77sXESeN3r7IAm53yK6mhU,1826
86
+ gomyck_tools-1.5.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
87
+ gomyck_tools-1.5.3.dist-info/top_level.txt,sha256=-MiIH9FYRVKp1i5_SVRkaI-71WmF1sZSRrNWFU9ls3s,7
88
+ gomyck_tools-1.5.3.dist-info/RECORD,,