Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
financial-system
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xianyang
financial-system
Commits
ce181c18
Commit
ce181c18
authored
May 10, 2023
by
xianyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化nacos初始化问题
parent
a0cf1088
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
env.py
core/config/env.py
+4
-4
yaml_file.py
libs/yaml_file.py
+2
-2
No files found.
core/config/env.py
View file @
ce181c18
...
...
@@ -56,8 +56,8 @@ class TestingEnv(Env):
LOGIN_URL
=
YAML_DATA
.
get
(
'login_url'
)
NACOS_URL
=
YAML_DATA
.
get
(
'config_url'
)
NACOSCONFIG
=
"show=all&dataId=fj-finance-test&group=DEFAULT_GROUP&tenant=cw-test&namespaceId=cw-test"
NAME
=
YAML_DATA
.
get
(
'name'
)
PWD
=
YAML_DATA
.
get
(
'pwd'
)
NA
COS_NA
ME
=
YAML_DATA
.
get
(
'name'
)
NACOS_
PWD
=
YAML_DATA
.
get
(
'pwd'
)
DB_HISTORY
=
apo
.
get
(
'history'
)
DB_3YV2
=
apo
.
get
(
'business'
)
Redis
=
apo
.
get
(
'redis'
)
...
...
@@ -79,8 +79,8 @@ class ProdEnv(Env):
LOG_ERROR_PATH
=
os
.
path
.
join
(
SITE_ROOT_TOO
,
"bin"
,
"runtime"
,
"logs"
,
"error"
,
""
)
PEM_PATH
=
os
.
path
.
join
(
SITE_ROOT_YAML
,
"config"
,
""
)
YAML_DATA
=
apo
.
get
(
'yaml'
)
NAME
=
YAML_DATA
.
get
(
'name'
)
PWD
=
YAML_DATA
.
get
(
'pw
d'
)
NA
COS_NA
ME
=
YAML_DATA
.
get
(
'name'
)
NACOS_PWD
=
YAML_DATA
.
get
(
'passwor
d'
)
LOGIN_URL
=
YAML_DATA
.
get
(
'login_url'
)
NACOS_URL
=
YAML_DATA
.
get
(
'config_url'
)
NACOSCONFIG
=
"dataId=fj-finance&group=DEFAULT_GROUP&namespaceId=cw-pro&tenant=cw-pro&show=all&username=fj_finance"
...
...
libs/yaml_file.py
View file @
ce181c18
...
...
@@ -8,8 +8,8 @@ from libs.log_utils import Logger
def
get_yaml_token
():
url
=
env
.
LOGIN_URL
data
=
{
"username"
:
env
.
NAME
,
"password"
:
env
.
PWD
"username"
:
env
.
NA
COS_NA
ME
,
"password"
:
env
.
NACOS_
PWD
}
response
=
requests
.
post
(
url
=
url
,
data
=
data
)
if
response
.
status_code
==
200
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment