Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
M
micro-remote
Project
Project
Details
Activity
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
tarak.li
micro-remote
Commits
c2f9c745
Commit
c2f9c745
authored
May 20, 2020
by
tarak.li
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
自动出金二期,商城自动部署
parent
bbb77cf6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
58 additions
and
6 deletions
+58
-6
__init__.py
server/www/teleport/webroot/app/controller/__init__.py
+12
-6
plugin.py
server/www/teleport/webroot/app/controller/plugin.py
+0
-0
plugin.py
server/www/teleport/webroot/app/model/plugin.py
+46
-0
No files found.
server/www/teleport/webroot/app/controller/__init__.py
View file @
c2f9c745
...
...
@@ -292,17 +292,23 @@ controllers = [
# 绑定支付宝账户
(
r'/plugin/bind_pay_account'
,
plugin
.
BindPayAccountHandler
),
# 账户状态
(
r'/micro_remote/plugin/account_status'
,
plugin
.
AccountStatusHandler
),
(
r'/plugin/account_status'
,
plugin
.
AccountStatusHandler
),
# 主机监控状态
(
r'/plugin/host_monitor'
,
plugin
.
HostMonitorHandler
),
# 账户账户密码获取
(
r'/micro_remote/plugin/account_info'
,
plugin
.
AccountInfoHandler
),
(
r'/plugin/account_info'
,
plugin
.
AccountInfoHandler
),
# 商城狀態查詢
(
r'/plugin/shop_info'
,
plugin
.
ShopInfoHandler
),
# 商城綁定接口
(
r'/plugin/shop_bind'
,
plugin
.
ShopBindHandler
),
# 密码修改
(
r'/plugin/password_update'
,
plugin
.
PasswordUpdateHandler
),
# 下载地址获取接口
(
r'/plugin/bat_download_url'
,
plugin
.
BatDownloadHandler
),
# websocket for real-time information
# ws-client call 'http://ip:7190/ws/action/'
(
r'/ws/(.*)'
,
ws
.
WebSocketHandler
),
(
r'/.*'
,
index
.
CatchAllHandler
),
]
...
...
server/www/teleport/webroot/app/controller/plugin.py
View file @
c2f9c745
This diff is collapsed.
Click to expand it.
server/www/teleport/webroot/app/model/plugin.py
View file @
c2f9c745
...
...
@@ -66,6 +66,25 @@ def get_bind_info(host_id):
return
bind
def
get_shop_bind_info
(
host_id
):
s
=
SQL
(
get_db
())
s
.
select_from
(
'remote_shop_bind'
,
[
'host_id'
,
'name'
,
'domain'
,
'url'
,
'status'
,
'username'
,
'password'
,
'remark'
,
'create_time'
],
alt_name
=
'a'
)
# 判断
if
host_id
:
s
.
where
(
'a.host_id in ({host_ids})'
.
format
(
host_ids
=
','
.
join
(
host_id
)))
err
=
s
.
query
()
if
err
!=
TPE_OK
:
return
err
,
None
bind
=
s
.
recorder
for
item
in
bind
:
item
[
'password'
]
=
"******"
return
bind
def
get_account_info
(
host_id
,
mch_no
):
s
=
SQL
(
get_db
())
s
.
select_from
(
'remote_account_host_bind'
,
...
...
@@ -394,3 +413,30 @@ def update(table: str, fields: dict, where: dict):
return
TPE_DATABASE
return
TPE_OK
def
add_shop_bind
(
handler
,
args
):
db
=
get_db
()
_time_now
=
tp_timestamp_utc_now
()
operator
=
handler
.
get_current_user
()
sql
=
'INSERT INTO `tp_remote_shop_bind` (host_id, name, domain, url, status, username, password, remark, create_time, create_by, update_time, update_by) VALUES '
\
'({host_id}, "{name}", "{domain}", "{url}", {status}, "{username}", "{password}", "{remark}", "{create_time}", "{create_by}", "{update_time}", "{update_by}");'
\
''
.
format
(
host_id
=
args
.
get
(
"host_id"
,
0
),
name
=
args
.
get
(
"name"
,
""
),
domain
=
args
.
get
(
"domain"
,
""
),
url
=
args
.
get
(
"url"
,
""
),
status
=
args
.
get
(
"status"
,
0
),
username
=
args
.
get
(
"username"
,
""
),
password
=
args
.
get
(
"password"
,
""
),
remark
=
args
.
get
(
"remark"
,
""
),
create_time
=
_time_now
,
create_by
=
operator
[
'id'
],
update_time
=
_time_now
,
update_by
=
operator
[
'id'
],
)
db_ret
=
db
.
exec
(
sql
)
if
not
db_ret
:
return
TPE_DATABASE
,
0
_id
=
db
.
last_insert_id
()
# acc_name = '{}@{}'.format(args['username'], args['host_ip'])
# if len(args['router_ip']) > 0:
# acc_name += '(由{}:{}路由)'.format(args['router_ip'], args['router_port'])
# syslog.sys_log(operator, handler.request.remote_ip, TPE_OK, "创建账号:{}".format(acc_name))
# 更新主机相关账号数量
return
TPE_OK
,
_id
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