Skip to content

Commit

Permalink
feat:HookUrlApiReceiver (#853)
Browse files Browse the repository at this point in the history
* feat:HookUrlApiReceiver

* open: 多明细

* open:mdi7
  • Loading branch information
getrebuild authored Dec 27, 2024
1 parent c8f76a2 commit 801088d
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 28 deletions.
2 changes: 1 addition & 1 deletion @rbv
Submodule @rbv updated from 951a8f to e28024
14 changes: 7 additions & 7 deletions src/main/java/com/rebuild/api/ApiGateway.java
Original file line number Diff line number Diff line change
Expand Up @@ -202,27 +202,27 @@ protected ApiContext verfiy(HttpServletRequest request, ApiContext base, @Suppre
throw new ApiInvokeException(ApiInvokeException.ERR_BADAUTH, "Invalid [timestamp] : " + timestamp);
}

StringBuilder sign2 = new StringBuilder();
StringBuilder sb = new StringBuilder();
for (Map.Entry<String, String> e : sortedMap.entrySet()) {
sign2.append(e.getKey())
sb.append(e.getKey())
.append('=')
.append(e.getValue())
.append('&');
}
sign2.append(appid)
sb.append(appid)
.append('.')
.append(apiConfig.getString("appSecret"));

String sign2sign;
String signCheck;
if ("MD5".equals(signType)) {
sign2sign = EncryptUtils.toMD5Hex(sign2.toString());
signCheck = EncryptUtils.toMD5Hex(sb.toString());
} else if ("SHA1".equals(signType)) {
sign2sign = EncryptUtils.toSHA1Hex(sign2.toString());
signCheck = EncryptUtils.toSHA1Hex(sb.toString());
} else {
throw new ApiInvokeException(ApiInvokeException.ERR_BADAUTH, "Invalid [sign_type] : " + signType);
}

if (!sign.equals(sign2sign)) {
if (!sign.equals(signCheck)) {
throw new ApiInvokeException(ApiInvokeException.ERR_BADAUTH, "Invalid [sign] : " + sign);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ public Object invoke(MethodInvocation invocation) throws Throwable {
@Override
public void checkGuard(Object object) throws SecurityException {
final MethodInvocation invocation = (MethodInvocation) object;
if (!isGuardMethod(invocation)) {
return;
}
if (!isGuardMethod(invocation)) return;

final ID caller = UserContextHolder.getUser();
if (Application.devMode()) log.info("User [ {} ] call : {}", caller, invocation.getMethod());
Expand All @@ -67,9 +65,7 @@ public void checkGuard(Object object) throws SecurityException {
}

// 仅 EntityService 或子类会验证角色权限
if (!EntityService.class.isAssignableFrom(invocationClass)) {
return;
}
if (!EntityService.class.isAssignableFrom(invocationClass)) return;

boolean isBulk = invocation.getMethod().getName().startsWith("bulk");
if (isBulk) {
Expand Down Expand Up @@ -221,10 +217,7 @@ private String formatHumanMessage(Permission action, Entity entity, ID target) {
actionHuman = Language.L("审批");
}

if (target == null) {
return Language.L("你没有%s%s权限", actionHuman, EasyMetaFactory.getLabel(entity));
} else {
return Language.L("你没有%s此记录的权限", actionHuman);
}
if (target == null) return Language.L("你没有%s%s权限", actionHuman, EasyMetaFactory.getLabel(entity));
return Language.L("你没有%s此记录的权限", actionHuman);
}
}
52 changes: 52 additions & 0 deletions src/main/resources/web/assets/js/mdi7-icons.js
Original file line number Diff line number Diff line change
Expand Up @@ -6728,4 +6728,56 @@ const MDI7_ICONS_IGNORE = [
'mdi-regex',
'mdi-page-first',
'mdi-page-last',
'mdi-abjad-arabic',
'mdi-apple-keyboard-control',
'mdi-arrow-bottom-left-thin',
'mdi-arrow-bottom-right-thin',
'mdi-arrow-projectile',
'mdi-brightness-3',
'mdi-bulma',
'mdi-call-merge',
'mdi-call-missed',
'mdi-cellphone-basic',
'mdi-decimal',
'mdi-decimal-comma',
'mdi-decimal-comma-decrease',
'mdi-decimal-decrease',
'mdi-decimal-increase',
'mdi-dots-horizontal',
'mdi-drag-horizontal',
'mdi-drag-horizontal-variant',
'mdi-drag-vertical',
'mdi-drag-vertical-variant',
'mdi-eject-outline',
'mdi-electric-switch',
'mdi-electric-switch-closed',
'mdi-epsilon',
'mdi-exclamation',
'mdi-goodreads',
'mdi-loading',
'mdi-math-integral',
'mdi-math-norm',
'mdi-middleware',
'mdi-middleware-outline',
'mdi-midi',
'mdi-minus',
'mdi-minus-thick',
'mdi-oar',
'mdi-ocarina',
'mdi-rake',
'mdi-record',
'mdi-rivet',
'mdi-window-close',
'mdi-unfold-more-vertical',
'mdi-train-car-flatbed',
'mdi-tilde',
'mdi-tilde-off',
'mdi-texture',
'mdi-texture-box',
'mdi-soundbar',
'mdi-soundcloud',
'mdi-sign-pole',
'mdi-plus',
'mdi-pan-vertical',
'mdi-music-accidental-flat',
]
3 changes: 1 addition & 2 deletions src/main/resources/web/assets/js/metadata/entity-new2.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,10 @@ class EntityNew2 extends RbModalHandler {
{this.state.entities &&
this.state.entities.map((item) => {
if (item.mainEntity) return null
if (item.detailEntity && !window.__BOSSKEY) return null
if (item.detailEntity && rb.commercial < 10) return null
return (
<option key={item.entityName} value={item.entityName}>
{item.entityLabel}
{item.detailEntity ? ' (LAB)' : ''}
</option>
)
})}
Expand Down
12 changes: 5 additions & 7 deletions src/main/resources/web/common/search-icon.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,20 +48,18 @@
<script th:src="@{/assets/js/mdi7-icons.js}"></script>
<script type="text/babel">
const cb = function (icon) {
(parent && parent.clickIcon ? parent.clickIcon : console.log)(icon)
;(parent && parent.clickIcon ? parent.clickIcon : console.log)(icon)
}
$(document).ready(() => {
if ($urlp('mdi7')) renderMdi7()
else renderZmdi()
renderMdi7()
parent && parent.RbModal && parent.RbModal.resize()

window.bosskeyTrigger = function () {
$('#icons').empty()
$('#icons').text('MDI7 Loading')

$('#icons').text('ZMDI Loading')
setTimeout(() => {
$('#icons').empty()
renderMdi7()
renderZmdi()
parent && parent.RbModal && parent.RbModal.resize()
}, 666)
}
Expand Down Expand Up @@ -100,7 +98,7 @@
}
})
}
// V2
// V2-4.0
function renderMdi7() {
MDI7_ICONS.forEach((icon) => {
if (MDI7_ICONS_IGNORE.includes(icon)) return
Expand Down

0 comments on commit 801088d

Please sign in to comment.