Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
周伟奇
/
bmw-ocr
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
417d8dee
authored
2022-05-30 10:42:07 +0800
by
周伟奇
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
token fix
1 parent
2e2c0a83
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
7 deletions
src/apps/doc/management/commands/folder_wsc_process.py
src/apps/doc/ocr/cms.py
src/apps/doc/views.py
src/settings/conf/prd.ini
src/apps/doc/management/commands/folder_wsc_process.py
View file @
417d8de
...
...
@@ -487,7 +487,6 @@ class Command(BaseCommand, LoggerMixin):
else
:
self
.
folder_log
.
warn
(
'{0} [go failed] [img_path={1}]'
.
format
(
self
.
log_base
,
img_path
))
def
get_pno
(
self
,
img_path
):
img_name
,
_
=
os
.
path
.
splitext
(
os
.
path
.
basename
(
img_path
))
return
int
(
img_name
.
split
(
'_'
)[
1
])
...
...
src/apps/doc/ocr/cms.py
View file @
417d8de
...
...
@@ -31,7 +31,13 @@ class CMS:
self
.
token
=
token
self
.
token_type
=
response
.
json
()
.
get
(
self
.
token_type_key
,
self
.
token_type
)
expires
=
response
.
json
()
.
get
(
self
.
expires_key
,
3600
)
rh
.
set_cms_token
(
self
.
token
,
expires
)
if
isinstance
(
expires
,
int
):
expires_int
=
expires
-
10
elif
isinstance
(
expires
,
str
):
expires_int
=
int
(
expires
)
-
10
else
:
expires_int
=
3600
-
10
rh
.
set_cms_token
(
self
.
token
,
expires_int
)
def
get_token
(
self
):
# if self.token is None:
...
...
src/apps/doc/views.py
View file @
417d8de
...
...
@@ -1390,10 +1390,10 @@ class AutoSettlementView(GenericView):
class
AutoSettlementExcelView
(
GenericView
):
#
permission_classes = []
#
authentication_classes = []
permission_classes
=
[
IsAuthenticated
]
authentication_classes
=
[
OAuth2AuthenticationWithUser
]
permission_classes
=
[]
authentication_classes
=
[]
#
permission_classes = [IsAuthenticated]
#
authentication_classes = [OAuth2AuthenticationWithUser]
# 获取auto settlement excel
@use_args
(
auto_list_args
,
location
=
'querystring'
)
...
...
src/settings/conf/prd.ini
View file @
417d8de
...
...
@@ -12,7 +12,7 @@ EDMS_DOWNLOAD_URL = http://sccn0639.bmwgroup.net/FH/FileHold/DocumentRepository/
EDMS_UPLOAD_URL
=
http://sccn0639.bmwgroup.net/FH/FileHold/DocumentRepository/UploadHandler.ashx
DEALER_CODE
=
ocr_group
BASE_URL
=
https://
lp19dkocrprod01vm
.bmwgroup.net
BASE_URL
=
https://
sfocr-prod
.bmwgroup.net
DELAY_SECONDS
=
60
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment