修改了一些代码的注释,方便后期对代码进行维护,修改,以及新功能模块的开发
This commit is contained in:
parent
465952560f
commit
479957fbc1
|
|
@ -14,26 +14,10 @@
|
||||||
|
|
||||||
<body class="gray-bg">
|
<body class="gray-bg">
|
||||||
<div class="row border-bottom white-bg dashboard-header">
|
<div class="row border-bottom white-bg dashboard-header">
|
||||||
<div class="col-sm-12">
|
|
||||||
<blockquote class="text-warning" style="font-size:14px">
|
|
||||||
领取阿里云1888通用代金券(新老客户均可用)
|
|
||||||
<br><a target="_blank" href="https://promotion.aliyun.com/ntms/yunparter/invite.html?userCode=brki8iof">https://promotion.aliyun.com/ntms/yunparter/invite.html?userCode=brki8iof</a>
|
|
||||||
<h4 class="text-danger">云产品通用红包,可叠加官网常规优惠使用。</h4>
|
|
||||||
</blockquote>
|
|
||||||
|
|
||||||
<hr>
|
|
||||||
</div>
|
|
||||||
<div class="col-sm-3">
|
|
||||||
<h2>Hello,Guest</h2>
|
|
||||||
<small>移动设备访问请扫描以下二维码:</small>
|
|
||||||
<br>
|
|
||||||
<br>
|
|
||||||
<img th:src="@{/img/qr_code.png}" width="100%" style="max-width:264px;">
|
|
||||||
<br>
|
|
||||||
</div>
|
|
||||||
<div class="col-sm-5">
|
<div class="col-sm-5">
|
||||||
<h2>若依后台管理框架</h2>
|
<h2>若依后台管理框架</h2>
|
||||||
<p>一直想做一款后台管理系统,看了很多优秀的开源项目但是发现没有合适自己的。于是利用空闲休息时间开始自己写一套后台系统。如此有了若依管理系统。,她可以用于所有的Web应用程序,如<b>网站管理后台</b>,<b>网站会员中心</b>,<b>CMS</b>,<b>CRM</b>,<b>OA</b>等等,当然,您也可以对她进行深度定制,以做出更强系统。所有前端后台代码封装过后十分精简易上手,出错概率低。同时支持移动客户端访问。系统会陆续更新一些实用功能。</p>
|
<p>一直想做一款后台管理系统,看了很多优秀的开源项目但是发现没有合适自己的。于是利用空闲休息时间开始自己写一套后台系统。如此有了若依管理系统。,她可以用于所有的Web应用程序,如<b>网站管理后台</b>,<b>网站会员中心</b>,<b>CMS</b>,<b>CRM</b>,<b>OA</b>等等,当然,您也可以对她进行深度定制,以做出更强系统。所有前端后台代码封装过后十分精简易上手,出错概率低。同时支持移动客户端访问。系统会陆续更新一些实用功能。
|
||||||
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<b>当前版本:</b><span>v[[${version}]]</span>
|
<b>当前版本:</b><span>v[[${version}]]</span>
|
||||||
</p>
|
</p>
|
||||||
|
|
@ -67,25 +51,6 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="wrapper wrapper-content">
|
<div class="wrapper wrapper-content">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-4">
|
|
||||||
|
|
||||||
<div class="ibox float-e-margins">
|
|
||||||
<div class="ibox-title">
|
|
||||||
<h5>联系信息</h5>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<div class="ibox-content">
|
|
||||||
<p><i class="fa fa-send-o"></i> 官网:<a href="http://www.ruoyi.vip" target="_blank">http://www.ruoyi.vip</a>
|
|
||||||
</p>
|
|
||||||
<p><i class="fa fa-qq"></i> QQ群:<s>满1389287</s> <s>满1679294</s> <a href="https://jq.qq.com/?_wv=1027&k=5YW0wjE" target="_blank">1529866</a>
|
|
||||||
</p>
|
|
||||||
<p><i class="fa fa-weixin"></i> 微信:<a href="javascript:;">/ *若依</a>
|
|
||||||
</p>
|
|
||||||
<p><i class="fa fa-credit-card"></i> 支付宝:<a href="javascript:;" class="支付宝信息">/ *若依</a>
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-sm-4">
|
<div class="col-sm-4">
|
||||||
<div class="ibox float-e-margins">
|
<div class="ibox float-e-margins">
|
||||||
<div class="ibox-title">
|
<div class="ibox-title">
|
||||||
|
|
@ -97,7 +62,8 @@
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<h5 class="panel-title">
|
<h5 class="panel-title">
|
||||||
<a data-toggle="collapse" data-parent="#version" href="#v31">v3.1.0</a><code class="pull-right">2018.12.03</code>
|
<a data-toggle="collapse" data-parent="#version" href="#v31">v3.1.0</a><code
|
||||||
|
class="pull-right">2018.12.03</code>
|
||||||
</h5>
|
</h5>
|
||||||
</div>
|
</div>
|
||||||
<div id="v31" class="panel-collapse collapse in">
|
<div id="v31" class="panel-collapse collapse in">
|
||||||
|
|
@ -127,7 +93,8 @@
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<h5 class="panel-title">
|
<h5 class="panel-title">
|
||||||
<a data-toggle="collapse" data-parent="#version" href="#v30">v3.0.0</a><code class="pull-right">2018.10.08</code>
|
<a data-toggle="collapse" data-parent="#version" href="#v30">v3.0.0</a><code
|
||||||
|
class="pull-right">2018.10.08</code>
|
||||||
</h5>
|
</h5>
|
||||||
</div>
|
</div>
|
||||||
<div id="v30" class="panel-collapse collapse">
|
<div id="v30" class="panel-collapse collapse">
|
||||||
|
|
@ -154,7 +121,8 @@
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<h5 class="panel-title">
|
<h5 class="panel-title">
|
||||||
<a data-toggle="collapse" data-parent="#version" href="#v24">v2.4.0</a><code class="pull-right">2018.09.03</code>
|
<a data-toggle="collapse" data-parent="#version" href="#v24">v2.4.0</a><code
|
||||||
|
class="pull-right">2018.09.03</code>
|
||||||
</h5>
|
</h5>
|
||||||
</div>
|
</div>
|
||||||
<div id="v24" class="panel-collapse collapse">
|
<div id="v24" class="panel-collapse collapse">
|
||||||
|
|
@ -185,7 +153,8 @@
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<h5 class="panel-title">
|
<h5 class="panel-title">
|
||||||
<a data-toggle="collapse" data-parent="#version" href="#v23">v2.3.0</a><code class="pull-right">2018.08.06</code>
|
<a data-toggle="collapse" data-parent="#version" href="#v23">v2.3.0</a><code
|
||||||
|
class="pull-right">2018.08.06</code>
|
||||||
</h5>
|
</h5>
|
||||||
</div>
|
</div>
|
||||||
<div id="v23" class="panel-collapse collapse">
|
<div id="v23" class="panel-collapse collapse">
|
||||||
|
|
@ -215,7 +184,8 @@
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<h5 class="panel-title">
|
<h5 class="panel-title">
|
||||||
<a data-toggle="collapse" data-parent="#version" href="#v22">v2.2.0</a><code class="pull-right">2018.07.23</code>
|
<a data-toggle="collapse" data-parent="#version" href="#v22">v2.2.0</a><code
|
||||||
|
class="pull-right">2018.07.23</code>
|
||||||
</h5>
|
</h5>
|
||||||
</div>
|
</div>
|
||||||
<div id="v22" class="panel-collapse collapse">
|
<div id="v22" class="panel-collapse collapse">
|
||||||
|
|
@ -239,7 +209,8 @@
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<h5 class="panel-title">
|
<h5 class="panel-title">
|
||||||
<a data-toggle="collapse" data-parent="#version" href="#v21">v2.1.0</a><code class="pull-right">2018.07.10</code>
|
<a data-toggle="collapse" data-parent="#version" href="#v21">v2.1.0</a><code
|
||||||
|
class="pull-right">2018.07.10</code>
|
||||||
</h5>
|
</h5>
|
||||||
</div>
|
</div>
|
||||||
<div id="v21" class="panel-collapse collapse">
|
<div id="v21" class="panel-collapse collapse">
|
||||||
|
|
@ -264,7 +235,8 @@
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<h5 class="panel-title">
|
<h5 class="panel-title">
|
||||||
<a data-toggle="collapse" data-parent="#version" href="#v20">v2.0.0</a><code class="pull-right">2018.07.02</code>
|
<a data-toggle="collapse" data-parent="#version" href="#v20">v2.0.0</a><code
|
||||||
|
class="pull-right">2018.07.02</code>
|
||||||
</h5>
|
</h5>
|
||||||
</div>
|
</div>
|
||||||
<div id="v20" class="panel-collapse collapse">
|
<div id="v20" class="panel-collapse collapse">
|
||||||
|
|
@ -287,7 +259,8 @@
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<h5 class="panel-title">
|
<h5 class="panel-title">
|
||||||
<a data-toggle="collapse" data-parent="#version" href="#v16">v1.1.6</a><code class="pull-right">2018.06.04</code>
|
<a data-toggle="collapse" data-parent="#version" href="#v16">v1.1.6</a><code
|
||||||
|
class="pull-right">2018.06.04</code>
|
||||||
</h5>
|
</h5>
|
||||||
</div>
|
</div>
|
||||||
<div id="v16" class="panel-collapse collapse">
|
<div id="v16" class="panel-collapse collapse">
|
||||||
|
|
@ -309,7 +282,8 @@
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<h5 class="panel-title">
|
<h5 class="panel-title">
|
||||||
<a data-toggle="collapse" data-parent="#version" href="#v15">v1.1.5</a><code class="pull-right">2018.05.28</code>
|
<a data-toggle="collapse" data-parent="#version" href="#v15">v1.1.5</a><code
|
||||||
|
class="pull-right">2018.05.28</code>
|
||||||
</h5>
|
</h5>
|
||||||
</div>
|
</div>
|
||||||
<div id="v15" class="panel-collapse collapse">
|
<div id="v15" class="panel-collapse collapse">
|
||||||
|
|
@ -331,7 +305,8 @@
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<h5 class="panel-title">
|
<h5 class="panel-title">
|
||||||
<a data-toggle="collapse" data-parent="#version" href="#v14">v1.1.4</a><code class="pull-right">2018.05.20</code>
|
<a data-toggle="collapse" data-parent="#version" href="#v14">v1.1.4</a><code
|
||||||
|
class="pull-right">2018.05.20</code>
|
||||||
</h5>
|
</h5>
|
||||||
</div>
|
</div>
|
||||||
<div id="v14" class="panel-collapse collapse">
|
<div id="v14" class="panel-collapse collapse">
|
||||||
|
|
@ -353,7 +328,8 @@
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<h5 class="panel-title">
|
<h5 class="panel-title">
|
||||||
<a data-toggle="collapse" data-parent="#version" href="#v13">v1.1.3</a><code class="pull-right">2018.05.14</code>
|
<a data-toggle="collapse" data-parent="#version" href="#v13">v1.1.3</a><code
|
||||||
|
class="pull-right">2018.05.14</code>
|
||||||
</h5>
|
</h5>
|
||||||
</div>
|
</div>
|
||||||
<div id="v13" class="panel-collapse collapse">
|
<div id="v13" class="panel-collapse collapse">
|
||||||
|
|
@ -374,7 +350,8 @@
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<h5 class="panel-title">
|
<h5 class="panel-title">
|
||||||
<a data-toggle="collapse" data-parent="#version" href="#v12">v1.1.2</a><code class="pull-right">2018.05.07</code>
|
<a data-toggle="collapse" data-parent="#version" href="#v12">v1.1.2</a><code
|
||||||
|
class="pull-right">2018.05.07</code>
|
||||||
</h5>
|
</h5>
|
||||||
</div>
|
</div>
|
||||||
<div id="v12" class="panel-collapse collapse">
|
<div id="v12" class="panel-collapse collapse">
|
||||||
|
|
@ -396,7 +373,8 @@
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<h5 class="panel-title">
|
<h5 class="panel-title">
|
||||||
<a data-toggle="collapse" data-parent="#version" href="#v11">v1.1.1</a><code class="pull-right">2018.04.23</code>
|
<a data-toggle="collapse" data-parent="#version" href="#v11">v1.1.1</a><code
|
||||||
|
class="pull-right">2018.04.23</code>
|
||||||
</h5>
|
</h5>
|
||||||
</div>
|
</div>
|
||||||
<div id="v11" class="panel-collapse collapse">
|
<div id="v11" class="panel-collapse collapse">
|
||||||
|
|
@ -415,7 +393,8 @@
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<h5 class="panel-title">
|
<h5 class="panel-title">
|
||||||
<a data-toggle="collapse" data-parent="#version" href="#v10">v1.1.0</a><code class="pull-right">2018.04.20</code>
|
<a data-toggle="collapse" data-parent="#version" href="#v10">v1.1.0</a><code
|
||||||
|
class="pull-right">2018.04.20</code>
|
||||||
</h5>
|
</h5>
|
||||||
</div>
|
</div>
|
||||||
<div id="v10" class="panel-collapse collapse">
|
<div id="v10" class="panel-collapse collapse">
|
||||||
|
|
@ -435,7 +414,8 @@
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<h5 class="panel-title">
|
<h5 class="panel-title">
|
||||||
<a data-toggle="collapse" data-parent="#version" href="#v09">v1.0.9</a><code class="pull-right">2018.04.14</code>
|
<a data-toggle="collapse" data-parent="#version" href="#v09">v1.0.9</a><code
|
||||||
|
class="pull-right">2018.04.14</code>
|
||||||
</h5>
|
</h5>
|
||||||
</div>
|
</div>
|
||||||
<div id="v09" class="panel-collapse collapse">
|
<div id="v09" class="panel-collapse collapse">
|
||||||
|
|
@ -450,7 +430,8 @@
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<h5 class="panel-title">
|
<h5 class="panel-title">
|
||||||
<a data-toggle="collapse" data-parent="#version" href="#v08">v1.0.8</a><code class="pull-right">2018.04.08</code>
|
<a data-toggle="collapse" data-parent="#version" href="#v08">v1.0.8</a><code
|
||||||
|
class="pull-right">2018.04.08</code>
|
||||||
</h5>
|
</h5>
|
||||||
</div>
|
</div>
|
||||||
<div id="v08" class="panel-collapse collapse">
|
<div id="v08" class="panel-collapse collapse">
|
||||||
|
|
@ -465,7 +446,8 @@
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<h5 class="panel-title">
|
<h5 class="panel-title">
|
||||||
<a data-toggle="collapse" data-parent="#version" href="#v07">v1.0.7</a><code class="pull-right">2018.04.04</code>
|
<a data-toggle="collapse" data-parent="#version" href="#v07">v1.0.7</a><code
|
||||||
|
class="pull-right">2018.04.04</code>
|
||||||
</h5>
|
</h5>
|
||||||
</div>
|
</div>
|
||||||
<div id="v07" class="panel-collapse collapse">
|
<div id="v07" class="panel-collapse collapse">
|
||||||
|
|
@ -480,7 +462,8 @@
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<h5 class="panel-title">
|
<h5 class="panel-title">
|
||||||
<a data-toggle="collapse" data-parent="#version" href="#v06">v1.0.6</a><code class="pull-right">2018.03.15</code>
|
<a data-toggle="collapse" data-parent="#version" href="#v06">v1.0.6</a><code
|
||||||
|
class="pull-right">2018.03.15</code>
|
||||||
</h5>
|
</h5>
|
||||||
</div>
|
</div>
|
||||||
<div id="v06" class="panel-collapse collapse">
|
<div id="v06" class="panel-collapse collapse">
|
||||||
|
|
@ -496,7 +479,8 @@
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<h5 class="panel-title">
|
<h5 class="panel-title">
|
||||||
<a data-toggle="collapse" data-parent="#version" href="#v05">v1.0.5</a><code class="pull-right">2018.03.12</code>
|
<a data-toggle="collapse" data-parent="#version" href="#v05">v1.0.5</a><code
|
||||||
|
class="pull-right">2018.03.12</code>
|
||||||
</h5>
|
</h5>
|
||||||
</div>
|
</div>
|
||||||
<div id="v05" class="panel-collapse collapse">
|
<div id="v05" class="panel-collapse collapse">
|
||||||
|
|
@ -511,7 +495,8 @@
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<h5 class="panel-title">
|
<h5 class="panel-title">
|
||||||
<a data-toggle="collapse" data-parent="#version" href="#v04">v1.0.4</a><code class="pull-right">2018.03.11</code>
|
<a data-toggle="collapse" data-parent="#version" href="#v04">v1.0.4</a><code
|
||||||
|
class="pull-right">2018.03.11</code>
|
||||||
</h5>
|
</h5>
|
||||||
</div>
|
</div>
|
||||||
<div id="v04" class="panel-collapse collapse">
|
<div id="v04" class="panel-collapse collapse">
|
||||||
|
|
@ -525,7 +510,8 @@
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<h5 class="panel-title">
|
<h5 class="panel-title">
|
||||||
<a data-toggle="collapse" data-parent="#version" href="#v03">v1.0.3</a><code class="pull-right">2018.03.08</code>
|
<a data-toggle="collapse" data-parent="#version" href="#v03">v1.0.3</a><code
|
||||||
|
class="pull-right">2018.03.08</code>
|
||||||
</h5>
|
</h5>
|
||||||
</div>
|
</div>
|
||||||
<div id="v03" class="panel-collapse collapse">
|
<div id="v03" class="panel-collapse collapse">
|
||||||
|
|
@ -539,7 +525,8 @@
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<h5 class="panel-title">
|
<h5 class="panel-title">
|
||||||
<a data-toggle="collapse" data-parent="#version" href="#v02">v1.0.2</a><code class="pull-right">2018.03.04</code>
|
<a data-toggle="collapse" data-parent="#version" href="#v02">v1.0.2</a><code
|
||||||
|
class="pull-right">2018.03.04</code>
|
||||||
</h5>
|
</h5>
|
||||||
</div>
|
</div>
|
||||||
<div id="v02" class="panel-collapse collapse">
|
<div id="v02" class="panel-collapse collapse">
|
||||||
|
|
@ -553,7 +540,8 @@
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<h5 class="panel-title">
|
<h5 class="panel-title">
|
||||||
<a data-toggle="collapse" data-parent="#version" href="#v01">v1.0.1</a><code class="pull-right">2018.03.03</code>
|
<a data-toggle="collapse" data-parent="#version" href="#v01">v1.0.1</a><code
|
||||||
|
class="pull-right">2018.03.03</code>
|
||||||
</h5>
|
</h5>
|
||||||
</div>
|
</div>
|
||||||
<div id="v01" class="panel-collapse collapse">
|
<div id="v01" class="panel-collapse collapse">
|
||||||
|
|
@ -570,7 +558,8 @@
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<h4 class="panel-title">
|
<h4 class="panel-title">
|
||||||
<a data-toggle="collapse" data-parent="#version" href="#v00">v1.0.0</a><code class="pull-right">2018.03.01</code>
|
<a data-toggle="collapse" data-parent="#version" href="#v00">v1.0.0</a><code
|
||||||
|
class="pull-right">2018.03.01</code>
|
||||||
</h4>
|
</h4>
|
||||||
</div>
|
</div>
|
||||||
<div id="v00" class="panel-collapse collapse">
|
<div id="v00" class="panel-collapse collapse">
|
||||||
|
|
@ -586,23 +575,6 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-4">
|
|
||||||
<div class="ibox float-e-margins">
|
|
||||||
<div class="ibox-title">
|
|
||||||
<h5>捐赠</h5>
|
|
||||||
</div>
|
|
||||||
<div class="ibox-content">
|
|
||||||
<div class="alert alert-warning">
|
|
||||||
请作者喝杯咖啡。
|
|
||||||
</div>
|
|
||||||
<p id="pay-qrcode">
|
|
||||||
<a href="javascript:;"><img th:src="@{/img/pay.png}" width="100%" alt="请使用手机支付宝或者微信扫码支付">
|
|
||||||
</a>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<script th:src="@{/js/jquery.min.js}"></script>
|
<script th:src="@{/js/jquery.min.js}"></script>
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,14 @@ import org.apache.shiro.subject.Subject;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* shiro 工具类
|
* shiro 工具类
|
||||||
|
* Subject:主体.每个用户登录后都会对应一个Subject对象,所有用户信息都存储到Subject中
|
||||||
|
* Security Manager:Shiro最大的容器.Shiro所有功能都封装在Security Manager中 1:编写代码时,想要使用Shiro第一个步骤获取到Security Manager 2:在整个程序中保证Security Manager有且只有一个
|
||||||
|
* Authenticator: 认证器.执行认证过程调用的组件.
|
||||||
|
* Authorizer:授权器.执行授权时调用的组件.
|
||||||
|
* Session Manager: Session管理器.
|
||||||
|
* Cache Manager: 缓存管理器.Shiro支持很多第三方缓存工具.例如Ehcache等.
|
||||||
|
* SessionDao: 操作Session内容的组件
|
||||||
|
* Realm:该组件的作用负责获取到数据库中数据并根据用户自定义逻辑进行授权和认证等操作. 1:Shiro 框架和数据库没有关系.没有对数据库设计有认证强制要求 2:如果Shiro想要访问数据库都是通过Realm组件. 3:如果Shiro数据不是来源于数据库,可以使用.ini文件设置静态数据.
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
|
|
@ -52,7 +60,7 @@ public class ShiroUtils {
|
||||||
*/
|
*/
|
||||||
public static void setSysUser(SysUser user) {
|
public static void setSysUser(SysUser user) {
|
||||||
Subject subject = getSubject();
|
Subject subject = getSubject();
|
||||||
//获取当事人的信息
|
//获取当事人的信息,身份.代表用户名,邮箱,手机等能够唯一确认身份的信息
|
||||||
PrincipalCollection principalCollection = subject.getPrincipals();
|
PrincipalCollection principalCollection = subject.getPrincipals();
|
||||||
String realmName = principalCollection.getRealmNames().iterator().next();
|
String realmName = principalCollection.getRealmNames().iterator().next();
|
||||||
PrincipalCollection newPrincipalCollection = new SimplePrincipalCollection(user, realmName);
|
PrincipalCollection newPrincipalCollection = new SimplePrincipalCollection(user, realmName);
|
||||||
|
|
|
||||||
|
|
@ -12,14 +12,14 @@ import org.springframework.stereotype.Component;
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
@Component
|
@Component
|
||||||
public final class SpringUtils implements BeanFactoryPostProcessor
|
public final class SpringUtils implements BeanFactoryPostProcessor {
|
||||||
{
|
/**
|
||||||
/** Spring应用上下文环境 */
|
* Spring应用上下文环境
|
||||||
|
*/
|
||||||
private static ConfigurableListableBeanFactory beanFactory;
|
private static ConfigurableListableBeanFactory beanFactory;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException
|
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
|
||||||
{
|
|
||||||
SpringUtils.beanFactory = beanFactory;
|
SpringUtils.beanFactory = beanFactory;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -29,11 +29,9 @@ public final class SpringUtils implements BeanFactoryPostProcessor
|
||||||
* @param name
|
* @param name
|
||||||
* @return Object 一个以所给名字注册的bean的实例
|
* @return Object 一个以所给名字注册的bean的实例
|
||||||
* @throws org.springframework.beans.BeansException
|
* @throws org.springframework.beans.BeansException
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public static <T> T getBean(String name) throws BeansException
|
public static <T> T getBean(String name) throws BeansException {
|
||||||
{
|
|
||||||
return (T) beanFactory.getBean(name);
|
return (T) beanFactory.getBean(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -43,10 +41,8 @@ public final class SpringUtils implements BeanFactoryPostProcessor
|
||||||
* @param clz
|
* @param clz
|
||||||
* @return
|
* @return
|
||||||
* @throws org.springframework.beans.BeansException
|
* @throws org.springframework.beans.BeansException
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public static <T> T getBean(Class<T> clz) throws BeansException
|
public static <T> T getBean(Class<T> clz) throws BeansException {
|
||||||
{
|
|
||||||
T result = (T) beanFactory.getBean(clz);
|
T result = (T) beanFactory.getBean(clz);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
@ -57,8 +53,7 @@ public final class SpringUtils implements BeanFactoryPostProcessor
|
||||||
* @param name
|
* @param name
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public static boolean containsBean(String name)
|
public static boolean containsBean(String name) {
|
||||||
{
|
|
||||||
return beanFactory.containsBean(name);
|
return beanFactory.containsBean(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -68,10 +63,8 @@ public final class SpringUtils implements BeanFactoryPostProcessor
|
||||||
* @param name
|
* @param name
|
||||||
* @return boolean
|
* @return boolean
|
||||||
* @throws org.springframework.beans.factory.NoSuchBeanDefinitionException
|
* @throws org.springframework.beans.factory.NoSuchBeanDefinitionException
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public static boolean isSingleton(String name) throws NoSuchBeanDefinitionException
|
public static boolean isSingleton(String name) throws NoSuchBeanDefinitionException {
|
||||||
{
|
|
||||||
return beanFactory.isSingleton(name);
|
return beanFactory.isSingleton(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -79,10 +72,8 @@ public final class SpringUtils implements BeanFactoryPostProcessor
|
||||||
* @param name
|
* @param name
|
||||||
* @return Class 注册对象的类型
|
* @return Class 注册对象的类型
|
||||||
* @throws org.springframework.beans.factory.NoSuchBeanDefinitionException
|
* @throws org.springframework.beans.factory.NoSuchBeanDefinitionException
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public static Class<?> getType(String name) throws NoSuchBeanDefinitionException
|
public static Class<?> getType(String name) throws NoSuchBeanDefinitionException {
|
||||||
{
|
|
||||||
return beanFactory.getType(name);
|
return beanFactory.getType(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -92,10 +83,8 @@ public final class SpringUtils implements BeanFactoryPostProcessor
|
||||||
* @param name
|
* @param name
|
||||||
* @return
|
* @return
|
||||||
* @throws org.springframework.beans.factory.NoSuchBeanDefinitionException
|
* @throws org.springframework.beans.factory.NoSuchBeanDefinitionException
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public static String[] getAliases(String name) throws NoSuchBeanDefinitionException
|
public static String[] getAliases(String name) throws NoSuchBeanDefinitionException {
|
||||||
{
|
|
||||||
return beanFactory.getAliases(name);
|
return beanFactory.getAliases(name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,5 @@
|
||||||
package com.ruoyi.framework.web.base;
|
package com.ruoyi.framework.web.base;
|
||||||
|
|
||||||
import java.beans.PropertyEditorSupport;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
import org.springframework.web.bind.WebDataBinder;
|
|
||||||
import org.springframework.web.bind.annotation.InitBinder;
|
|
||||||
import com.github.pagehelper.PageHelper;
|
import com.github.pagehelper.PageHelper;
|
||||||
import com.github.pagehelper.PageInfo;
|
import com.github.pagehelper.PageInfo;
|
||||||
import com.ruoyi.common.base.AjaxResult;
|
import com.ruoyi.common.base.AjaxResult;
|
||||||
|
|
@ -15,41 +10,41 @@ import com.ruoyi.common.utils.StringUtils;
|
||||||
import com.ruoyi.framework.util.ShiroUtils;
|
import com.ruoyi.framework.util.ShiroUtils;
|
||||||
import com.ruoyi.framework.web.page.TableSupport;
|
import com.ruoyi.framework.web.page.TableSupport;
|
||||||
import com.ruoyi.system.domain.SysUser;
|
import com.ruoyi.system.domain.SysUser;
|
||||||
|
import org.springframework.web.bind.WebDataBinder;
|
||||||
|
import org.springframework.web.bind.annotation.InitBinder;
|
||||||
|
|
||||||
|
import java.beans.PropertyEditorSupport;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* web层通用数据处理
|
* web层通用数据处理
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
public class BaseController
|
public class BaseController {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* 将前台传递过来的日期格式的字符串,自动转化为Date类型
|
* 将前台传递过来的日期格式的字符串,自动转化为Date类型
|
||||||
*/
|
*/
|
||||||
@InitBinder
|
@InitBinder
|
||||||
public void initBinder(WebDataBinder binder)
|
public void initBinder(WebDataBinder binder) {
|
||||||
{
|
|
||||||
// Date 类型转换
|
// Date 类型转换
|
||||||
binder.registerCustomEditor(Date.class, new PropertyEditorSupport()
|
binder.registerCustomEditor(Date.class, new PropertyEditorSupport() {
|
||||||
{
|
|
||||||
@Override
|
@Override
|
||||||
public void setAsText(String text)
|
public void setAsText(String text) {
|
||||||
{
|
|
||||||
setValue(DateUtils.parseDate(text));
|
setValue(DateUtils.parseDate(text));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置请求分页数据
|
* 设置请求分页数据,查询的时候调用分页查询
|
||||||
*/
|
*/
|
||||||
protected void startPage()
|
protected void startPage() {
|
||||||
{
|
|
||||||
PageDomain pageDomain = TableSupport.buildPageRequest();
|
PageDomain pageDomain = TableSupport.buildPageRequest();
|
||||||
Integer pageNum = pageDomain.getPageNum();
|
Integer pageNum = pageDomain.getPageNum();
|
||||||
Integer pageSize = pageDomain.getPageSize();
|
Integer pageSize = pageDomain.getPageSize();
|
||||||
if (StringUtils.isNotNull(pageNum) && StringUtils.isNotNull(pageSize))
|
if (StringUtils.isNotNull(pageNum) && StringUtils.isNotNull(pageSize)) {
|
||||||
{
|
|
||||||
String orderBy = pageDomain.getOrderBy();
|
String orderBy = pageDomain.getOrderBy();
|
||||||
PageHelper.startPage(pageNum, pageSize, orderBy);
|
PageHelper.startPage(pageNum, pageSize, orderBy);
|
||||||
}
|
}
|
||||||
|
|
@ -57,10 +52,10 @@ public class BaseController
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 响应请求分页数据
|
* 响应请求分页数据
|
||||||
|
* 分页返回的数据
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||||
protected TableDataInfo getDataTable(List<?> list)
|
protected TableDataInfo getDataTable(List<?> list) {
|
||||||
{
|
|
||||||
TableDataInfo rspData = new TableDataInfo();
|
TableDataInfo rspData = new TableDataInfo();
|
||||||
rspData.setCode(0);
|
rspData.setCode(0);
|
||||||
rspData.setRows(list);
|
rspData.setRows(list);
|
||||||
|
|
@ -69,13 +64,12 @@ public class BaseController
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 响应返回结果
|
* 响应返回结果,如果查询出的行数 > 0的话,就返回成功,否则返回错误
|
||||||
*
|
*
|
||||||
* @param rows 影响行数
|
* @param rows 影响行数
|
||||||
* @return 操作结果
|
* @return 操作结果
|
||||||
*/
|
*/
|
||||||
protected AjaxResult toAjax(int rows)
|
protected AjaxResult toAjax(int rows) {
|
||||||
{
|
|
||||||
return rows > 0 ? success() : error();
|
return rows > 0 ? success() : error();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -85,76 +79,65 @@ public class BaseController
|
||||||
* @param result 结果
|
* @param result 结果
|
||||||
* @return 操作结果
|
* @return 操作结果
|
||||||
*/
|
*/
|
||||||
protected AjaxResult toAjax(boolean result)
|
protected AjaxResult toAjax(boolean result) {
|
||||||
{
|
|
||||||
return result ? success() : error();
|
return result ? success() : error();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 返回成功
|
* 返回成功
|
||||||
*/
|
*/
|
||||||
public AjaxResult success()
|
public AjaxResult success() {
|
||||||
{
|
|
||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 返回失败消息
|
* 返回失败消息
|
||||||
*/
|
*/
|
||||||
public AjaxResult error()
|
public AjaxResult error() {
|
||||||
{
|
|
||||||
return AjaxResult.error();
|
return AjaxResult.error();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 返回成功消息
|
* 返回成功消息
|
||||||
*/
|
*/
|
||||||
public AjaxResult success(String message)
|
public AjaxResult success(String message) {
|
||||||
{
|
|
||||||
return AjaxResult.success(message);
|
return AjaxResult.success(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 返回失败消息
|
* 返回失败消息
|
||||||
*/
|
*/
|
||||||
public AjaxResult error(String message)
|
public AjaxResult error(String message) {
|
||||||
{
|
|
||||||
return AjaxResult.error(message);
|
return AjaxResult.error(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 返回错误码消息
|
* 返回错误码消息
|
||||||
*/
|
*/
|
||||||
public AjaxResult error(int code, String message)
|
public AjaxResult error(int code, String message) {
|
||||||
{
|
|
||||||
return AjaxResult.error(code, message);
|
return AjaxResult.error(code, message);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 页面跳转
|
* 页面跳转
|
||||||
*/
|
*/
|
||||||
public String redirect(String url)
|
public String redirect(String url) {
|
||||||
{
|
|
||||||
return StringUtils.format("redirect:{}", url);
|
return StringUtils.format("redirect:{}", url);
|
||||||
}
|
}
|
||||||
|
|
||||||
public SysUser getSysUser()
|
public SysUser getSysUser() {
|
||||||
{
|
|
||||||
return ShiroUtils.getSysUser();
|
return ShiroUtils.getSysUser();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSysUser(SysUser user)
|
public void setSysUser(SysUser user) {
|
||||||
{
|
|
||||||
ShiroUtils.setSysUser(user);
|
ShiroUtils.setSysUser(user);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Long getUserId()
|
public Long getUserId() {
|
||||||
{
|
|
||||||
return getSysUser().getUserId();
|
return getSysUser().getUserId();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getLoginName()
|
public String getLoginName() {
|
||||||
{
|
|
||||||
return getSysUser().getLoginName();
|
return getSysUser().getLoginName();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,8 @@
|
||||||
package com.ruoyi.framework.web.domain;
|
package com.ruoyi.framework.web.domain;
|
||||||
|
|
||||||
import java.net.UnknownHostException;
|
|
||||||
import java.util.LinkedList;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Properties;
|
|
||||||
import com.ruoyi.common.utils.Arith;
|
import com.ruoyi.common.utils.Arith;
|
||||||
import com.ruoyi.common.utils.IpUtils;
|
import com.ruoyi.common.utils.IpUtils;
|
||||||
import com.ruoyi.framework.web.domain.server.Cpu;
|
import com.ruoyi.framework.web.domain.server.*;
|
||||||
import com.ruoyi.framework.web.domain.server.Jvm;
|
|
||||||
import com.ruoyi.framework.web.domain.server.Mem;
|
|
||||||
import com.ruoyi.framework.web.domain.server.Sys;
|
|
||||||
import com.ruoyi.framework.web.domain.server.SysFile;
|
|
||||||
import oshi.SystemInfo;
|
import oshi.SystemInfo;
|
||||||
import oshi.hardware.CentralProcessor;
|
import oshi.hardware.CentralProcessor;
|
||||||
import oshi.hardware.CentralProcessor.TickType;
|
import oshi.hardware.CentralProcessor.TickType;
|
||||||
|
|
@ -21,13 +13,17 @@ import oshi.software.os.OSFileStore;
|
||||||
import oshi.software.os.OperatingSystem;
|
import oshi.software.os.OperatingSystem;
|
||||||
import oshi.util.Util;
|
import oshi.util.Util;
|
||||||
|
|
||||||
|
import java.net.UnknownHostException;
|
||||||
|
import java.util.LinkedList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Properties;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 服务器相关信息
|
* 服务器相关信息:包含CPU、JVM、内存、磁盘、服务器相关信息
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
public class Server
|
public class Server {
|
||||||
{
|
|
||||||
|
|
||||||
private static final int OSHI_WAIT_SECOND = 1000;
|
private static final int OSHI_WAIT_SECOND = 1000;
|
||||||
|
|
||||||
|
|
@ -56,58 +52,47 @@ public class Server
|
||||||
*/
|
*/
|
||||||
private List<SysFile> sysFiles = new LinkedList<SysFile>();
|
private List<SysFile> sysFiles = new LinkedList<SysFile>();
|
||||||
|
|
||||||
public Cpu getCpu()
|
public Cpu getCpu() {
|
||||||
{
|
|
||||||
return cpu;
|
return cpu;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCpu(Cpu cpu)
|
public void setCpu(Cpu cpu) {
|
||||||
{
|
|
||||||
this.cpu = cpu;
|
this.cpu = cpu;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Mem getMem()
|
public Mem getMem() {
|
||||||
{
|
|
||||||
return mem;
|
return mem;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setMem(Mem mem)
|
public void setMem(Mem mem) {
|
||||||
{
|
|
||||||
this.mem = mem;
|
this.mem = mem;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Jvm getJvm()
|
public Jvm getJvm() {
|
||||||
{
|
|
||||||
return jvm;
|
return jvm;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setJvm(Jvm jvm)
|
public void setJvm(Jvm jvm) {
|
||||||
{
|
|
||||||
this.jvm = jvm;
|
this.jvm = jvm;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Sys getSys()
|
public Sys getSys() {
|
||||||
{
|
|
||||||
return sys;
|
return sys;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSys(Sys sys)
|
public void setSys(Sys sys) {
|
||||||
{
|
|
||||||
this.sys = sys;
|
this.sys = sys;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<SysFile> getSysFiles()
|
public List<SysFile> getSysFiles() {
|
||||||
{
|
|
||||||
return sysFiles;
|
return sysFiles;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSysFiles(List<SysFile> sysFiles)
|
public void setSysFiles(List<SysFile> sysFiles) {
|
||||||
{
|
|
||||||
this.sysFiles = sysFiles;
|
this.sysFiles = sysFiles;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void copyTo() throws Exception
|
public void copyTo() throws Exception {
|
||||||
{
|
|
||||||
SystemInfo si = new SystemInfo();
|
SystemInfo si = new SystemInfo();
|
||||||
HardwareAbstractionLayer hal = si.getHardware();
|
HardwareAbstractionLayer hal = si.getHardware();
|
||||||
|
|
||||||
|
|
@ -125,8 +110,7 @@ public class Server
|
||||||
/**
|
/**
|
||||||
* 设置CPU信息
|
* 设置CPU信息
|
||||||
*/
|
*/
|
||||||
private void setCpuInfo(CentralProcessor processor)
|
private void setCpuInfo(CentralProcessor processor) {
|
||||||
{
|
|
||||||
// CPU信息
|
// CPU信息
|
||||||
long[] prevTicks = processor.getSystemCpuLoadTicks();
|
long[] prevTicks = processor.getSystemCpuLoadTicks();
|
||||||
Util.sleep(OSHI_WAIT_SECOND);
|
Util.sleep(OSHI_WAIT_SECOND);
|
||||||
|
|
@ -151,8 +135,7 @@ public class Server
|
||||||
/**
|
/**
|
||||||
* 设置内存信息
|
* 设置内存信息
|
||||||
*/
|
*/
|
||||||
private void setMemInfo(GlobalMemory memory)
|
private void setMemInfo(GlobalMemory memory) {
|
||||||
{
|
|
||||||
mem.setTotal(memory.getTotal());
|
mem.setTotal(memory.getTotal());
|
||||||
mem.setUsed(memory.getTotal() - memory.getAvailable());
|
mem.setUsed(memory.getTotal() - memory.getAvailable());
|
||||||
mem.setFree(memory.getAvailable());
|
mem.setFree(memory.getAvailable());
|
||||||
|
|
@ -161,8 +144,7 @@ public class Server
|
||||||
/**
|
/**
|
||||||
* 设置服务器信息
|
* 设置服务器信息
|
||||||
*/
|
*/
|
||||||
private void setSysInfo()
|
private void setSysInfo() {
|
||||||
{
|
|
||||||
Properties props = System.getProperties();
|
Properties props = System.getProperties();
|
||||||
sys.setComputerName(IpUtils.getHostName());
|
sys.setComputerName(IpUtils.getHostName());
|
||||||
sys.setComputerIp(IpUtils.getHostIp());
|
sys.setComputerIp(IpUtils.getHostIp());
|
||||||
|
|
@ -174,8 +156,7 @@ public class Server
|
||||||
/**
|
/**
|
||||||
* 设置Java虚拟机
|
* 设置Java虚拟机
|
||||||
*/
|
*/
|
||||||
private void setJvmInfo() throws UnknownHostException
|
private void setJvmInfo() throws UnknownHostException {
|
||||||
{
|
|
||||||
Properties props = System.getProperties();
|
Properties props = System.getProperties();
|
||||||
jvm.setTotal(Runtime.getRuntime().totalMemory());
|
jvm.setTotal(Runtime.getRuntime().totalMemory());
|
||||||
jvm.setMax(Runtime.getRuntime().maxMemory());
|
jvm.setMax(Runtime.getRuntime().maxMemory());
|
||||||
|
|
@ -187,12 +168,10 @@ public class Server
|
||||||
/**
|
/**
|
||||||
* 设置磁盘信息
|
* 设置磁盘信息
|
||||||
*/
|
*/
|
||||||
private void setSysFiles(OperatingSystem os)
|
private void setSysFiles(OperatingSystem os) {
|
||||||
{
|
|
||||||
FileSystem fileSystem = os.getFileSystem();
|
FileSystem fileSystem = os.getFileSystem();
|
||||||
OSFileStore[] fsArray = fileSystem.getFileStores();
|
OSFileStore[] fsArray = fileSystem.getFileStores();
|
||||||
for (OSFileStore fs : fsArray)
|
for (OSFileStore fs : fsArray) {
|
||||||
{
|
|
||||||
long free = fs.getUsableSpace();
|
long free = fs.getUsableSpace();
|
||||||
long total = fs.getTotalSpace();
|
long total = fs.getTotalSpace();
|
||||||
long used = total - free;
|
long used = total - free;
|
||||||
|
|
@ -214,27 +193,19 @@ public class Server
|
||||||
* @param size 字节大小
|
* @param size 字节大小
|
||||||
* @return 转换后值
|
* @return 转换后值
|
||||||
*/
|
*/
|
||||||
public String convertFileSize(long size)
|
public String convertFileSize(long size) {
|
||||||
{
|
|
||||||
long kb = 1024;
|
long kb = 1024;
|
||||||
long mb = kb * 1024;
|
long mb = kb * 1024;
|
||||||
long gb = mb * 1024;
|
long gb = mb * 1024;
|
||||||
if (size >= gb)
|
if (size >= gb) {
|
||||||
{
|
|
||||||
return String.format("%.1f GB", (float) size / gb);
|
return String.format("%.1f GB", (float) size / gb);
|
||||||
}
|
} else if (size >= mb) {
|
||||||
else if (size >= mb)
|
|
||||||
{
|
|
||||||
float f = (float) size / mb;
|
float f = (float) size / mb;
|
||||||
return String.format(f > 100 ? "%.0f MB" : "%.1f MB", f);
|
return String.format(f > 100 ? "%.0f MB" : "%.1f MB", f);
|
||||||
}
|
} else if (size >= kb) {
|
||||||
else if (size >= kb)
|
|
||||||
{
|
|
||||||
float f = (float) size / kb;
|
float f = (float) size / kb;
|
||||||
return String.format(f > 100 ? "%.0f KB" : "%.1f KB", f);
|
return String.format(f > 100 ? "%.0f KB" : "%.1f KB", f);
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
return String.format("%d B", size);
|
return String.format("%d B", size);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,12 +3,11 @@ package com.ruoyi.framework.web.domain.server;
|
||||||
import com.ruoyi.common.utils.Arith;
|
import com.ruoyi.common.utils.Arith;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* CPU相关信息
|
* CPU实体类:CPU相关信息
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
public class Cpu
|
public class Cpu {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* 核心数
|
* 核心数
|
||||||
*/
|
*/
|
||||||
|
|
@ -39,63 +38,51 @@ public class Cpu
|
||||||
*/
|
*/
|
||||||
private double free;
|
private double free;
|
||||||
|
|
||||||
public int getCpuNum()
|
public int getCpuNum() {
|
||||||
{
|
|
||||||
return cpuNum;
|
return cpuNum;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCpuNum(int cpuNum)
|
public void setCpuNum(int cpuNum) {
|
||||||
{
|
|
||||||
this.cpuNum = cpuNum;
|
this.cpuNum = cpuNum;
|
||||||
}
|
}
|
||||||
|
|
||||||
public double getTotal()
|
public double getTotal() {
|
||||||
{
|
|
||||||
return Arith.round(Arith.mul(total, 100), 2);
|
return Arith.round(Arith.mul(total, 100), 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTotal(double total)
|
public void setTotal(double total) {
|
||||||
{
|
|
||||||
this.total = total;
|
this.total = total;
|
||||||
}
|
}
|
||||||
|
|
||||||
public double getSys()
|
public double getSys() {
|
||||||
{
|
|
||||||
return Arith.round(Arith.mul(sys / total, 100), 2);
|
return Arith.round(Arith.mul(sys / total, 100), 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSys(double sys)
|
public void setSys(double sys) {
|
||||||
{
|
|
||||||
this.sys = sys;
|
this.sys = sys;
|
||||||
}
|
}
|
||||||
|
|
||||||
public double getUsed()
|
public double getUsed() {
|
||||||
{
|
|
||||||
return Arith.round(Arith.mul(used / total, 100), 2);
|
return Arith.round(Arith.mul(used / total, 100), 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUsed(double used)
|
public void setUsed(double used) {
|
||||||
{
|
|
||||||
this.used = used;
|
this.used = used;
|
||||||
}
|
}
|
||||||
|
|
||||||
public double getWait()
|
public double getWait() {
|
||||||
{
|
|
||||||
return Arith.round(Arith.mul(wait / total, 100), 2);
|
return Arith.round(Arith.mul(wait / total, 100), 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setWait(double wait)
|
public void setWait(double wait) {
|
||||||
{
|
|
||||||
this.wait = wait;
|
this.wait = wait;
|
||||||
}
|
}
|
||||||
|
|
||||||
public double getFree()
|
public double getFree() {
|
||||||
{
|
|
||||||
return Arith.round(Arith.mul(free / total, 100), 2);
|
return Arith.round(Arith.mul(free / total, 100), 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setFree(double free)
|
public void setFree(double free) {
|
||||||
{
|
|
||||||
this.free = free;
|
this.free = free;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,16 @@
|
||||||
package com.ruoyi.framework.web.domain.server;
|
package com.ruoyi.framework.web.domain.server;
|
||||||
|
|
||||||
import java.lang.management.ManagementFactory;
|
|
||||||
import com.ruoyi.common.utils.Arith;
|
import com.ruoyi.common.utils.Arith;
|
||||||
import com.ruoyi.common.utils.DateUtils;
|
import com.ruoyi.common.utils.DateUtils;
|
||||||
|
|
||||||
|
import java.lang.management.ManagementFactory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* JVM相关信息
|
* JVM实体类:JVM相关信息
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
public class Jvm
|
public class Jvm {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* 当前JVM占用的内存总数(M)
|
* 当前JVM占用的内存总数(M)
|
||||||
*/
|
*/
|
||||||
|
|
@ -36,87 +36,72 @@ public class Jvm
|
||||||
*/
|
*/
|
||||||
private String home;
|
private String home;
|
||||||
|
|
||||||
public double getTotal()
|
public double getTotal() {
|
||||||
{
|
|
||||||
return Arith.div(total, (1024 * 1024), 2);
|
return Arith.div(total, (1024 * 1024), 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTotal(double total)
|
public void setTotal(double total) {
|
||||||
{
|
|
||||||
this.total = total;
|
this.total = total;
|
||||||
}
|
}
|
||||||
|
|
||||||
public double getMax()
|
public double getMax() {
|
||||||
{
|
|
||||||
return Arith.div(max, (1024 * 1024), 2);
|
return Arith.div(max, (1024 * 1024), 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setMax(double max)
|
public void setMax(double max) {
|
||||||
{
|
|
||||||
this.max = max;
|
this.max = max;
|
||||||
}
|
}
|
||||||
|
|
||||||
public double getFree()
|
public double getFree() {
|
||||||
{
|
|
||||||
return Arith.div(free, (1024 * 1024), 2);
|
return Arith.div(free, (1024 * 1024), 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setFree(double free)
|
public void setFree(double free) {
|
||||||
{
|
|
||||||
this.free = free;
|
this.free = free;
|
||||||
}
|
}
|
||||||
|
|
||||||
public double getUsed()
|
public double getUsed() {
|
||||||
{
|
|
||||||
return Arith.div(total - free, (1024 * 1024), 2);
|
return Arith.div(total - free, (1024 * 1024), 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
public double getUsage()
|
public double getUsage() {
|
||||||
{
|
|
||||||
return Arith.mul(Arith.div(total - free, total, 4), 100);
|
return Arith.mul(Arith.div(total - free, total, 4), 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取JDK名称
|
* 获取JDK名称
|
||||||
*/
|
*/
|
||||||
public String getName()
|
public String getName() {
|
||||||
{
|
|
||||||
return ManagementFactory.getRuntimeMXBean().getVmName();
|
return ManagementFactory.getRuntimeMXBean().getVmName();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getVersion()
|
public String getVersion() {
|
||||||
{
|
|
||||||
return version;
|
return version;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setVersion(String version)
|
public void setVersion(String version) {
|
||||||
{
|
|
||||||
this.version = version;
|
this.version = version;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getHome()
|
public String getHome() {
|
||||||
{
|
|
||||||
return home;
|
return home;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setHome(String home)
|
public void setHome(String home) {
|
||||||
{
|
|
||||||
this.home = home;
|
this.home = home;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* JDK启动时间
|
* JDK启动时间
|
||||||
*/
|
*/
|
||||||
public String getStartTime()
|
public String getStartTime() {
|
||||||
{
|
|
||||||
return DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, DateUtils.getServerStartDate());
|
return DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, DateUtils.getServerStartDate());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* JDK运行时间
|
* JDK运行时间
|
||||||
*/
|
*/
|
||||||
public String getRunTime()
|
public String getRunTime() {
|
||||||
{
|
|
||||||
return DateUtils.getDatePoor(DateUtils.getNowDate(), DateUtils.getServerStartDate());
|
return DateUtils.getDatePoor(DateUtils.getNowDate(), DateUtils.getServerStartDate());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,12 +3,11 @@ package com.ruoyi.framework.web.domain.server;
|
||||||
import com.ruoyi.common.utils.Arith;
|
import com.ruoyi.common.utils.Arith;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 內存相关信息
|
* 内存实体类:內存相关信息
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
public class Mem
|
public class Mem {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* 内存总量
|
* 内存总量
|
||||||
*/
|
*/
|
||||||
|
|
@ -24,38 +23,31 @@ public class Mem
|
||||||
*/
|
*/
|
||||||
private double free;
|
private double free;
|
||||||
|
|
||||||
public double getTotal()
|
public double getTotal() {
|
||||||
{
|
|
||||||
return Arith.div(total, (1024 * 1024 * 1024), 2);
|
return Arith.div(total, (1024 * 1024 * 1024), 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTotal(long total)
|
public void setTotal(long total) {
|
||||||
{
|
|
||||||
this.total = total;
|
this.total = total;
|
||||||
}
|
}
|
||||||
|
|
||||||
public double getUsed()
|
public double getUsed() {
|
||||||
{
|
|
||||||
return Arith.div(used, (1024 * 1024 * 1024), 2);
|
return Arith.div(used, (1024 * 1024 * 1024), 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUsed(long used)
|
public void setUsed(long used) {
|
||||||
{
|
|
||||||
this.used = used;
|
this.used = used;
|
||||||
}
|
}
|
||||||
|
|
||||||
public double getFree()
|
public double getFree() {
|
||||||
{
|
|
||||||
return Arith.div(free, (1024 * 1024 * 1024), 2);
|
return Arith.div(free, (1024 * 1024 * 1024), 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setFree(long free)
|
public void setFree(long free) {
|
||||||
{
|
|
||||||
this.free = free;
|
this.free = free;
|
||||||
}
|
}
|
||||||
|
|
||||||
public double getUsage()
|
public double getUsage() {
|
||||||
{
|
|
||||||
return Arith.mul(Arith.div(used, total, 4), 100);
|
return Arith.mul(Arith.div(used, total, 4), 100);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,11 @@
|
||||||
package com.ruoyi.framework.web.domain.server;
|
package com.ruoyi.framework.web.domain.server;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 系统相关信息
|
* 系统实体类:系统相关信息
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
public class Sys
|
public class Sys {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* 服务器名称
|
* 服务器名称
|
||||||
*/
|
*/
|
||||||
|
|
@ -32,53 +31,43 @@ public class Sys
|
||||||
*/
|
*/
|
||||||
private String osArch;
|
private String osArch;
|
||||||
|
|
||||||
public String getComputerName()
|
public String getComputerName() {
|
||||||
{
|
|
||||||
return computerName;
|
return computerName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setComputerName(String computerName)
|
public void setComputerName(String computerName) {
|
||||||
{
|
|
||||||
this.computerName = computerName;
|
this.computerName = computerName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getComputerIp()
|
public String getComputerIp() {
|
||||||
{
|
|
||||||
return computerIp;
|
return computerIp;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setComputerIp(String computerIp)
|
public void setComputerIp(String computerIp) {
|
||||||
{
|
|
||||||
this.computerIp = computerIp;
|
this.computerIp = computerIp;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getUserDir()
|
public String getUserDir() {
|
||||||
{
|
|
||||||
return userDir;
|
return userDir;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUserDir(String userDir)
|
public void setUserDir(String userDir) {
|
||||||
{
|
|
||||||
this.userDir = userDir;
|
this.userDir = userDir;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getOsName()
|
public String getOsName() {
|
||||||
{
|
|
||||||
return osName;
|
return osName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setOsName(String osName)
|
public void setOsName(String osName) {
|
||||||
{
|
|
||||||
this.osName = osName;
|
this.osName = osName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getOsArch()
|
public String getOsArch() {
|
||||||
{
|
|
||||||
return osArch;
|
return osArch;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setOsArch(String osArch)
|
public void setOsArch(String osArch) {
|
||||||
{
|
|
||||||
this.osArch = osArch;
|
this.osArch = osArch;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,11 @@
|
||||||
package com.ruoyi.framework.web.domain.server;
|
package com.ruoyi.framework.web.domain.server;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 系统文件相关信息
|
* 系统文件:系统文件相关信息
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
public class SysFile
|
public class SysFile {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* 盘符路径
|
* 盘符路径
|
||||||
*/
|
*/
|
||||||
|
|
@ -42,73 +41,59 @@ public class SysFile
|
||||||
*/
|
*/
|
||||||
private double usage;
|
private double usage;
|
||||||
|
|
||||||
public String getDirName()
|
public String getDirName() {
|
||||||
{
|
|
||||||
return dirName;
|
return dirName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDirName(String dirName)
|
public void setDirName(String dirName) {
|
||||||
{
|
|
||||||
this.dirName = dirName;
|
this.dirName = dirName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getSysTypeName()
|
public String getSysTypeName() {
|
||||||
{
|
|
||||||
return sysTypeName;
|
return sysTypeName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSysTypeName(String sysTypeName)
|
public void setSysTypeName(String sysTypeName) {
|
||||||
{
|
|
||||||
this.sysTypeName = sysTypeName;
|
this.sysTypeName = sysTypeName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getTypeName()
|
public String getTypeName() {
|
||||||
{
|
|
||||||
return typeName;
|
return typeName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTypeName(String typeName)
|
public void setTypeName(String typeName) {
|
||||||
{
|
|
||||||
this.typeName = typeName;
|
this.typeName = typeName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getTotal()
|
public String getTotal() {
|
||||||
{
|
|
||||||
return total;
|
return total;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTotal(String total)
|
public void setTotal(String total) {
|
||||||
{
|
|
||||||
this.total = total;
|
this.total = total;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getFree()
|
public String getFree() {
|
||||||
{
|
|
||||||
return free;
|
return free;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setFree(String free)
|
public void setFree(String free) {
|
||||||
{
|
|
||||||
this.free = free;
|
this.free = free;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getUsed()
|
public String getUsed() {
|
||||||
{
|
|
||||||
return used;
|
return used;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUsed(String used)
|
public void setUsed(String used) {
|
||||||
{
|
|
||||||
this.used = used;
|
this.used = used;
|
||||||
}
|
}
|
||||||
|
|
||||||
public double getUsage()
|
public double getUsage() {
|
||||||
{
|
|
||||||
return usage;
|
return usage;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUsage(double usage)
|
public void setUsage(double usage) {
|
||||||
{
|
|
||||||
this.usage = usage;
|
this.usage = usage;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,15 @@
|
||||||
package com.ruoyi.framework.web.exception;
|
package com.ruoyi.framework.web.exception;
|
||||||
|
|
||||||
|
import com.ruoyi.common.base.AjaxResult;
|
||||||
|
import com.ruoyi.common.exception.BusinessException;
|
||||||
|
import com.ruoyi.common.exception.DemoModeException;
|
||||||
|
import com.ruoyi.framework.util.PermissionUtils;
|
||||||
import org.apache.shiro.authz.AuthorizationException;
|
import org.apache.shiro.authz.AuthorizationException;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.web.HttpRequestMethodNotSupportedException;
|
import org.springframework.web.HttpRequestMethodNotSupportedException;
|
||||||
import org.springframework.web.bind.annotation.ExceptionHandler;
|
import org.springframework.web.bind.annotation.ExceptionHandler;
|
||||||
import org.springframework.web.bind.annotation.RestControllerAdvice;
|
import org.springframework.web.bind.annotation.RestControllerAdvice;
|
||||||
import com.ruoyi.common.base.AjaxResult;
|
|
||||||
import com.ruoyi.common.exception.BusinessException;
|
|
||||||
import com.ruoyi.common.exception.DemoModeException;
|
|
||||||
import com.ruoyi.framework.util.PermissionUtils;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 自定义异常处理器
|
* 自定义异常处理器
|
||||||
|
|
@ -17,16 +17,14 @@ import com.ruoyi.framework.util.PermissionUtils;
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
@RestControllerAdvice
|
@RestControllerAdvice
|
||||||
public class DefaultExceptionHandler
|
public class DefaultExceptionHandler {
|
||||||
{
|
|
||||||
private static final Logger log = LoggerFactory.getLogger(DefaultExceptionHandler.class);
|
private static final Logger log = LoggerFactory.getLogger(DefaultExceptionHandler.class);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 权限校验失败
|
* 权限校验失败
|
||||||
*/
|
*/
|
||||||
@ExceptionHandler(AuthorizationException.class)
|
@ExceptionHandler(AuthorizationException.class)
|
||||||
public AjaxResult handleAuthorizationException(AuthorizationException e)
|
public AjaxResult handleAuthorizationException(AuthorizationException e) {
|
||||||
{
|
|
||||||
log.error(e.getMessage(), e);
|
log.error(e.getMessage(), e);
|
||||||
return AjaxResult.error(PermissionUtils.getMsg(e.getMessage()));
|
return AjaxResult.error(PermissionUtils.getMsg(e.getMessage()));
|
||||||
}
|
}
|
||||||
|
|
@ -35,8 +33,7 @@ public class DefaultExceptionHandler
|
||||||
* 请求方式不支持
|
* 请求方式不支持
|
||||||
*/
|
*/
|
||||||
@ExceptionHandler({HttpRequestMethodNotSupportedException.class})
|
@ExceptionHandler({HttpRequestMethodNotSupportedException.class})
|
||||||
public AjaxResult handleException(HttpRequestMethodNotSupportedException e)
|
public AjaxResult handleException(HttpRequestMethodNotSupportedException e) {
|
||||||
{
|
|
||||||
log.error(e.getMessage(), e);
|
log.error(e.getMessage(), e);
|
||||||
return AjaxResult.error("不支持' " + e.getMethod() + "'请求");
|
return AjaxResult.error("不支持' " + e.getMethod() + "'请求");
|
||||||
}
|
}
|
||||||
|
|
@ -45,8 +42,7 @@ public class DefaultExceptionHandler
|
||||||
* 拦截未知的运行时异常
|
* 拦截未知的运行时异常
|
||||||
*/
|
*/
|
||||||
@ExceptionHandler(RuntimeException.class)
|
@ExceptionHandler(RuntimeException.class)
|
||||||
public AjaxResult notFount(RuntimeException e)
|
public AjaxResult notFount(RuntimeException e) {
|
||||||
{
|
|
||||||
log.error("运行时异常:", e);
|
log.error("运行时异常:", e);
|
||||||
return AjaxResult.error("运行时异常:" + e.getMessage());
|
return AjaxResult.error("运行时异常:" + e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
@ -55,8 +51,7 @@ public class DefaultExceptionHandler
|
||||||
* 系统异常
|
* 系统异常
|
||||||
*/
|
*/
|
||||||
@ExceptionHandler(Exception.class)
|
@ExceptionHandler(Exception.class)
|
||||||
public AjaxResult handleException(Exception e)
|
public AjaxResult handleException(Exception e) {
|
||||||
{
|
|
||||||
log.error(e.getMessage(), e);
|
log.error(e.getMessage(), e);
|
||||||
return AjaxResult.error("服务器错误,请联系管理员");
|
return AjaxResult.error("服务器错误,请联系管理员");
|
||||||
}
|
}
|
||||||
|
|
@ -65,8 +60,7 @@ public class DefaultExceptionHandler
|
||||||
* 业务异常
|
* 业务异常
|
||||||
*/
|
*/
|
||||||
@ExceptionHandler(BusinessException.class)
|
@ExceptionHandler(BusinessException.class)
|
||||||
public AjaxResult businessException(BusinessException e)
|
public AjaxResult businessException(BusinessException e) {
|
||||||
{
|
|
||||||
log.error(e.getMessage(), e);
|
log.error(e.getMessage(), e);
|
||||||
return AjaxResult.error(e.getMessage());
|
return AjaxResult.error(e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
@ -75,8 +69,7 @@ public class DefaultExceptionHandler
|
||||||
* 演示模式异常
|
* 演示模式异常
|
||||||
*/
|
*/
|
||||||
@ExceptionHandler(DemoModeException.class)
|
@ExceptionHandler(DemoModeException.class)
|
||||||
public AjaxResult demoModeException(DemoModeException e)
|
public AjaxResult demoModeException(DemoModeException e) {
|
||||||
{
|
|
||||||
return AjaxResult.error("演示模式,不允许操作");
|
return AjaxResult.error("演示模式,不允许操作");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,12 +4,11 @@ import com.ruoyi.common.utils.StringUtils;
|
||||||
import com.ruoyi.framework.util.MessageUtils;
|
import com.ruoyi.framework.util.MessageUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 基础异常
|
* 基础异常,把平常容易出错且多次出现的异常封装在一起,方便管理和调用
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
public class BaseException extends RuntimeException
|
public class BaseException extends RuntimeException {
|
||||||
{
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -32,66 +31,54 @@ public class BaseException extends RuntimeException
|
||||||
*/
|
*/
|
||||||
private String defaultMessage;
|
private String defaultMessage;
|
||||||
|
|
||||||
public BaseException(String module, String code, Object[] args, String defaultMessage)
|
public BaseException(String module, String code, Object[] args, String defaultMessage) {
|
||||||
{
|
|
||||||
this.module = module;
|
this.module = module;
|
||||||
this.code = code;
|
this.code = code;
|
||||||
this.args = args;
|
this.args = args;
|
||||||
this.defaultMessage = defaultMessage;
|
this.defaultMessage = defaultMessage;
|
||||||
}
|
}
|
||||||
|
|
||||||
public BaseException(String module, String code, Object[] args)
|
public BaseException(String module, String code, Object[] args) {
|
||||||
{
|
|
||||||
this(module, code, args, null);
|
this(module, code, args, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public BaseException(String module, String defaultMessage)
|
public BaseException(String module, String defaultMessage) {
|
||||||
{
|
|
||||||
this(module, null, null, defaultMessage);
|
this(module, null, null, defaultMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
public BaseException(String code, Object[] args)
|
public BaseException(String code, Object[] args) {
|
||||||
{
|
|
||||||
this(null, code, args, null);
|
this(null, code, args, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public BaseException(String defaultMessage)
|
public BaseException(String defaultMessage) {
|
||||||
{
|
|
||||||
this(null, null, null, defaultMessage);
|
this(null, null, null, defaultMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getMessage()
|
public String getMessage() {
|
||||||
{
|
|
||||||
String message = null;
|
String message = null;
|
||||||
if (!StringUtils.isEmpty(code))
|
if (!StringUtils.isEmpty(code)) {
|
||||||
{
|
|
||||||
message = MessageUtils.message(code, args);
|
message = MessageUtils.message(code, args);
|
||||||
}
|
}
|
||||||
if (message == null)
|
if (message == null) {
|
||||||
{
|
|
||||||
message = defaultMessage;
|
message = defaultMessage;
|
||||||
}
|
}
|
||||||
return message;
|
return message;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getModule()
|
public String getModule() {
|
||||||
{
|
|
||||||
return module;
|
return module;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getCode()
|
public String getCode() {
|
||||||
{
|
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Object[] getArgs()
|
public Object[] getArgs() {
|
||||||
{
|
|
||||||
return args;
|
return args;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDefaultMessage()
|
public String getDefaultMessage() {
|
||||||
{
|
|
||||||
return defaultMessage;
|
return defaultMessage;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,28 +1,26 @@
|
||||||
package com.ruoyi.framework.web.service;
|
package com.ruoyi.framework.web.service;
|
||||||
|
|
||||||
|
import com.ruoyi.system.service.ISysConfigService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.ruoyi.system.service.ISysConfigService;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* RuoYi首创 html调用 thymeleaf 实现参数管理
|
* 首创 html调用 thymeleaf 实现参数管理
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
@Service("config")
|
@Service("config")
|
||||||
public class ConfigService
|
public class ConfigService {
|
||||||
{
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISysConfigService configService;
|
private ISysConfigService configService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据键名查询参数配置信息
|
* 根据键名查询参数配置信息
|
||||||
*
|
*
|
||||||
* @param configName 参数名称
|
* @param configKey 参数名称
|
||||||
* @return 参数键值
|
* @return 参数键值
|
||||||
*/
|
*/
|
||||||
public String getKey(String configKey)
|
public String getKey(String configKey) {
|
||||||
{
|
|
||||||
return configService.selectConfigByKey(configKey);
|
return configService.selectConfigByKey(configKey);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,19 @@
|
||||||
package com.ruoyi.framework.web.service;
|
package com.ruoyi.framework.web.service;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import com.ruoyi.system.domain.SysDictData;
|
import com.ruoyi.system.domain.SysDictData;
|
||||||
import com.ruoyi.system.service.ISysDictDataService;
|
import com.ruoyi.system.service.ISysDictDataService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* RuoYi首创 html调用 thymeleaf 实现字典读取
|
* 首创 html调用 thymeleaf 实现字典读取
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
@Service("dict")
|
@Service("dict")
|
||||||
public class DictService
|
public class DictService {
|
||||||
{
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISysDictDataService dictDataService;
|
private ISysDictDataService dictDataService;
|
||||||
|
|
||||||
|
|
@ -23,8 +23,7 @@ public class DictService
|
||||||
* @param dictType 字典类型
|
* @param dictType 字典类型
|
||||||
* @return 参数键值
|
* @return 参数键值
|
||||||
*/
|
*/
|
||||||
public List<SysDictData> getType(String dictType)
|
public List<SysDictData> getType(String dictType) {
|
||||||
{
|
|
||||||
return dictDataService.selectDictDataByType(dictType);
|
return dictDataService.selectDictDataByType(dictType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -35,8 +34,7 @@ public class DictService
|
||||||
* @param dictValue 字典键值
|
* @param dictValue 字典键值
|
||||||
* @return 字典标签
|
* @return 字典标签
|
||||||
*/
|
*/
|
||||||
public String getLabel(String dictType, String dictValue)
|
public String getLabel(String dictType, String dictValue) {
|
||||||
{
|
|
||||||
return dictDataService.selectDictLabel(dictType, dictValue);
|
return dictDataService.selectDictLabel(dictType, dictValue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,20 +4,17 @@ import org.apache.shiro.SecurityUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* RuoYi首创 js调用 thymeleaf 实现按钮权限可见性
|
* 首创 js调用 thymeleaf 实现按钮权限可见性
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
@Service("permission")
|
@Service("permission")
|
||||||
public class PermissionService
|
public class PermissionService {
|
||||||
{
|
public String hasPermi(String permission) {
|
||||||
public String hasPermi(String permission)
|
|
||||||
{
|
|
||||||
return isPermittedOperator(permission) ? "" : "hidden";
|
return isPermittedOperator(permission) ? "" : "hidden";
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isPermittedOperator(String permission)
|
private boolean isPermittedOperator(String permission) {
|
||||||
{
|
|
||||||
return SecurityUtils.getSubject().isPermitted(permission);
|
return SecurityUtils.getSubject().isPermitted(permission);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue