diff --git a/class/core/vip_api.py b/class/core/vip_api.py new file mode 100644 index 000000000..b5f90bb7a --- /dev/null +++ b/class/core/vip_api.py @@ -0,0 +1,24 @@ +# coding:utf-8 + +# --------------------------------------------------------------------------------- +# MW-Linux面板 +# --------------------------------------------------------------------------------- +# copyright (c) 2018-∞(https://github.com/midoks/mdserver-web) All rights reserved. +# --------------------------------------------------------------------------------- +# Author: midoks +# --------------------------------------------------------------------------------- + +# --------------------------------------------------------------------------------- +# VIP用户管理 +# --------------------------------------------------------------------------------- + +import mw + + +class vip_api: + + def __init__(self): + pass + + def loginApi(self): + return mw.returnJson(False, "测试中!") diff --git a/route/__init__.py b/route/__init__.py index 08597e4d3..87860f669 100755 --- a/route/__init__.py +++ b/route/__init__.py @@ -548,7 +548,7 @@ def index(reqClass=None, reqAction=None, reqData=None): # API请求 classFile = ('config_api', 'crontab_api', 'files_api', 'firewall_api', - 'plugins_api', 'system_api', 'site_api', 'task_api') + 'plugins_api', 'system_api', 'site_api', 'task_api', 'vip_api') className = reqClass + '_api' if not className in classFile: return "api error request" diff --git a/route/static/app/config.js b/route/static/app/config.js index 5912f8cd0..031fe210a 100755 --- a/route/static/app/config.js +++ b/route/static/app/config.js @@ -86,6 +86,55 @@ $('input[name="bind_ssl"]').click(function(){ /** op **/ +// VIP -- start +function setVipInfo(){ + layer.open({ + type: 1, + area: "400px", + title: 'VIP登录', + closeBtn: 1, + shift: 5, + btn:["登录","关闭"], + shadeClose: false, + content: "
\ +
\ + 用户名\ +
\ +
\ +
\ + 密码\ +
\ +
\ +
", + yes:function(index){ + var pdata = {}; + + pdata['username'] = $('input[name="username"]').val(); + pdata['password'] = $('input[name="password"]').val(); + + if (pdata['username'] == ''){ + layer.msg('用户名不能为空!', {icon:2}); + return false; + } + + if (pdata['password'] == ''){ + layer.msg('密码不能为空!', {icon:2}); + return false; + } + + $.post('/vip/login',{'username':pdata['username'], 'password':pdata['password']},function(rdata){ + showMsg(rdata.msg, function(){ + if (rdata.status){ + layer.close(index); + } + },{icon:rdata.status?1:2},2000); + },'json'); + }, + }); +} +// VIP -- end + + //关闭面板 function closePanel(){ layer.confirm('关闭面板会导致您无法访问面板 ,您真的要关闭Linux面板吗?',{title:'关闭面板',closeBtn:2,icon:13,cancel:function(){ diff --git a/route/templates/default/config.html b/route/templates/default/config.html index f4147ed1d..85c884f01 100755 --- a/route/templates/default/config.html +++ b/route/templates/default/config.html @@ -171,17 +171,16 @@ - +