Merge remote-tracking branch 'origin/main'
This commit is contained in:
@@ -38,7 +38,6 @@ import javax.servlet.http.HttpServletRequest;
|
||||
import javax.validation.Valid;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@IocBean
|
||||
@At("/platform/sys/menu")
|
||||
@@ -391,11 +390,11 @@ public class SysMenuController {
|
||||
@At
|
||||
@Ok("json")
|
||||
@SaCheckPermission("sys.manager.menu.edit")
|
||||
public Object sortDo(@Param("ids") String ids, HttpServletRequest req) {
|
||||
public Object sortDo(@Param("ids") String ids, @Param("platform") String platform, HttpServletRequest req) {
|
||||
try {
|
||||
String[] menuIds = StringUtils.split(ids, ",");
|
||||
int i = 0;
|
||||
sysMenuService.execute(Sqls.create("update sys_menu set location=0"));
|
||||
sysMenuService.execute(Sqls.create("update sys_menu set location=0 where platform = '%s'".formatted(platform)));
|
||||
for (String s : menuIds) {
|
||||
if (!Strings.isBlank(s)) {
|
||||
sysMenuService.update(org.nutz.dao.Chain.make("location", i), Cnd.where("id", "=", s));
|
||||
@@ -425,11 +424,11 @@ public class SysMenuController {
|
||||
@SaCheckPermission("sys.manager.menu")
|
||||
@ApiOperation("更新首页推荐应用或服务")
|
||||
public Result updateRecommendSetting(@Param("menuIds") String[] menuIds, String platform, String type) {
|
||||
String column = "";
|
||||
switch (type) {
|
||||
case "app" -> column = "isRecommendApp";
|
||||
case "service" -> column = "isRecommendService";
|
||||
}
|
||||
String column = "";
|
||||
switch (type) {
|
||||
case "app" -> column = "isRecommendApp";
|
||||
case "service" -> column = "isRecommendService";
|
||||
}
|
||||
sysMenuService.update(Chain.make(column, 0), Cnd.where("id", "is not", null).and("platform", "=", platform));
|
||||
if (ArrayUtil.isNotEmpty(menuIds)) {
|
||||
sysMenuService.update(Chain.make(column, 1), Cnd.where("id", "in", menuIds).and("platform", "=", platform));
|
||||
|
||||
@@ -304,7 +304,7 @@ public class SysUserServiceImpl extends BaseServiceImpl<Sys_user> implements Sys
|
||||
String decodePwd = Base64Decoder.decodeStr(passowrd);
|
||||
String hashedPassword = PwdUtil.getPassword(decodePwd, user.getSalt());
|
||||
if (!Strings.sNull(hashedPassword).equalsIgnoreCase(user.getPassword())) {
|
||||
if (!Globals.sso) {
|
||||
if (Globals.sso) {
|
||||
throw new BaseException("用户名或者密码不正确");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,25 +2,25 @@
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<style>
|
||||
.context-menu {
|
||||
position: fixed;
|
||||
background: #fff;
|
||||
border: 1px solid #dcdfe6;
|
||||
border-radius: 4px;
|
||||
box-shadow: 0 2px 12px 0 rgba(0,0,0,.1);
|
||||
z-index: 3000;
|
||||
list-style: none;
|
||||
padding: 5px 0;
|
||||
margin: 0;
|
||||
font-size: 14px;
|
||||
}
|
||||
.context-menu li {
|
||||
padding: 7px 20px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.context-menu li:hover {
|
||||
background: #f2f6fc;
|
||||
}
|
||||
.context-menu {
|
||||
position: fixed;
|
||||
background: #fff;
|
||||
border: 1px solid #dcdfe6;
|
||||
border-radius: 4px;
|
||||
box-shadow: 0 2px 12px 0 rgba(0,0,0,.1);
|
||||
z-index: 3000;
|
||||
list-style: none;
|
||||
padding: 5px 0;
|
||||
margin: 0;
|
||||
font-size: 14px;
|
||||
}
|
||||
.context-menu li {
|
||||
padding: 7px 20px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.context-menu li:hover {
|
||||
background: #f2f6fc;
|
||||
}
|
||||
</style>
|
||||
<div id="app" v-cloak>
|
||||
<el-card shadow="never">
|
||||
@@ -52,17 +52,17 @@ layout("/layouts/platform.html"){
|
||||
</el-button>
|
||||
</table-tool>
|
||||
<el-table
|
||||
:data="tableData"
|
||||
:highlight-current-row="true"
|
||||
:key="tableKey"
|
||||
:load="loadChild"
|
||||
@row-contextmenu="openMenu"
|
||||
:expand-row-keys="expandedRowKeysRenew"
|
||||
@expand-change="handleExpandChange"
|
||||
ref="tableData"
|
||||
style="width: 100%"
|
||||
lazy
|
||||
row-key="id"
|
||||
:data="tableData"
|
||||
:highlight-current-row="true"
|
||||
:key="tableKey"
|
||||
:load="loadChild"
|
||||
@row-contextmenu="openMenu"
|
||||
:expand-row-keys="expandedRowKeysRenew"
|
||||
@expand-change="handleExpandChange"
|
||||
ref="tableData"
|
||||
style="width: 100%"
|
||||
lazy
|
||||
row-key="id"
|
||||
>
|
||||
<el-table-column align="left" header-align="left" label="菜单名称" prop="name" width="200"></el-table-column>
|
||||
<el-table-column align="center" header-align="center" label="菜单图标" prop="icon" width="100">
|
||||
@@ -124,13 +124,13 @@ layout("/layouts/platform.html"){
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<!-- 右键菜单 -->
|
||||
<ul v-show="menuVisible" class="context-menu" :style="{left: menuLeft + 'px', top: menuTop + 'px'}">
|
||||
<li @click="handleAddMenu(currentRow)">新建菜单</li>
|
||||
<li v-if="showAddMenu" @click="handleAddChildMenu(currentRow)">添加子菜单</li>
|
||||
<li @click="handleEdit(currentRow)">编辑</li>
|
||||
<li @click="handleDelete(currentRow)">删除</li>
|
||||
</ul>
|
||||
<!-- 右键菜单 -->
|
||||
<ul v-show="menuVisible" class="context-menu" :style="{left: menuLeft + 'px', top: menuTop + 'px'}">
|
||||
<li @click="handleAddMenu(currentRow)">新建菜单</li>
|
||||
<li v-if="showAddMenu" @click="handleAddChildMenu(currentRow)">添加子菜单</li>
|
||||
<li @click="handleEdit(currentRow)">编辑</li>
|
||||
<li @click="handleDelete(currentRow)">删除</li>
|
||||
</ul>
|
||||
|
||||
</el-card>
|
||||
|
||||
@@ -140,7 +140,7 @@ layout("/layouts/platform.html"){
|
||||
<sort ref="sortRef" @refresh="doSearch"></sort>
|
||||
<recommend-setting ref="recommendSettingRef" @refresh="doSearch"></recommend-setting>
|
||||
</div>
|
||||
<script>
|
||||
<script nonce="${cspNonce!}">
|
||||
<!--#include("permissionForm.js"){}#-->
|
||||
<!--#include("basicForm.js"){}#-->
|
||||
<!--#include("sort.js"){}#-->
|
||||
@@ -165,65 +165,65 @@ layout("/layouts/platform.html"){
|
||||
expandedRowKeysRenew: [],
|
||||
tableTreeRefreshTool: [],
|
||||
|
||||
// 右键打开菜单相关
|
||||
currentRow: null,
|
||||
menuVisible: false,
|
||||
menuLeft: 0,
|
||||
menuTop: 0,
|
||||
showAddMenu: false,
|
||||
// 右键打开菜单相关
|
||||
currentRow: null,
|
||||
menuVisible: false,
|
||||
menuLeft: 0,
|
||||
menuTop: 0,
|
||||
showAddMenu: false,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/* 右键行 */
|
||||
openMenu(row, column, event) {
|
||||
this.showAddMenu = row.type === 'menu';
|
||||
// 阻止浏览器默认菜单
|
||||
event.preventDefault();
|
||||
this.currentRow = row;
|
||||
/* 右键行 */
|
||||
openMenu(row, column, event) {
|
||||
this.showAddMenu = row.type === 'menu';
|
||||
// 阻止浏览器默认菜单
|
||||
event.preventDefault();
|
||||
this.currentRow = row;
|
||||
|
||||
this.menuVisible = true;
|
||||
this.$nextTick(() => {
|
||||
const menu = this.$el.querySelector('.context-menu');
|
||||
const h = menu.offsetHeight || 100;
|
||||
const sh = document.documentElement.clientHeight;
|
||||
let top = event.clientY;
|
||||
if (top + h > sh) top -= h;
|
||||
this.menuLeft = event.clientX;
|
||||
this.menuTop = top;
|
||||
});
|
||||
},
|
||||
// 新建菜单
|
||||
handleAddMenu(row) {
|
||||
console.log(row)
|
||||
this.$refs.basicFormRef.onOpen(null, this.pageForm.platform)
|
||||
},
|
||||
handleAddChildMenu(row) {
|
||||
this.$refs.basicFormRef.addChildMenu(row, this.pageForm.platform)
|
||||
},
|
||||
handleEdit(row) {
|
||||
// 判断子菜单的type是权限还是菜单
|
||||
if (row.type === 'menu') {
|
||||
this.$refs.basicFormRef.onOpen(row.id, this.pageForm.platform)
|
||||
} else {
|
||||
this.$refs.permissionFormRef.onOpen(row.id)
|
||||
}
|
||||
},
|
||||
handleDelete(row) {
|
||||
// 删除逻辑
|
||||
console.log(row)
|
||||
this.$confirm("此操作将删除 " + row.name, "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
this.$axios.post("/platform/sys/menu/delete/" + row.id).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success(res.msg)
|
||||
this.loadChildByExpandedKeys()
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
this.menuVisible = true;
|
||||
this.$nextTick(() => {
|
||||
const menu = this.$el.querySelector('.context-menu');
|
||||
const h = menu.offsetHeight || 100;
|
||||
const sh = document.documentElement.clientHeight;
|
||||
let top = event.clientY;
|
||||
if (top + h > sh) top -= h;
|
||||
this.menuLeft = event.clientX;
|
||||
this.menuTop = top;
|
||||
});
|
||||
},
|
||||
// 新建菜单
|
||||
handleAddMenu(row) {
|
||||
console.log(row)
|
||||
this.$refs.basicFormRef.onOpen(null, this.pageForm.platform)
|
||||
},
|
||||
handleAddChildMenu(row) {
|
||||
this.$refs.basicFormRef.addChildMenu(row, this.pageForm.platform)
|
||||
},
|
||||
handleEdit(row) {
|
||||
// 判断子菜单的type是权限还是菜单
|
||||
if (row.type === 'menu') {
|
||||
this.$refs.basicFormRef.onOpen(row.id, this.pageForm.platform)
|
||||
} else {
|
||||
this.$refs.permissionFormRef.onOpen(row.id)
|
||||
}
|
||||
},
|
||||
handleDelete(row) {
|
||||
// 删除逻辑
|
||||
console.log(row)
|
||||
this.$confirm("此操作将删除 " + row.name, "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
this.$axios.post("/platform/sys/menu/delete/" + row.id).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success(res.msg)
|
||||
this.loadChildByExpandedKeys()
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
doSearch() {
|
||||
this.initTreeTable()
|
||||
},
|
||||
@@ -327,13 +327,13 @@ layout("/layouts/platform.html"){
|
||||
})
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
// 点击任意处关闭菜单
|
||||
document.addEventListener('click', () => (this.menuVisible = false));
|
||||
},
|
||||
beforeDestroy() {
|
||||
document.removeEventListener('click', () => (this.menuVisible = false));
|
||||
},
|
||||
mounted() {
|
||||
// 点击任意处关闭菜单
|
||||
document.addEventListener('click', () => (this.menuVisible = false));
|
||||
},
|
||||
beforeDestroy() {
|
||||
document.removeEventListener('click', () => (this.menuVisible = false));
|
||||
},
|
||||
created() {
|
||||
setTimeout(() => {
|
||||
if (this.dict.type.SYS_MENU_PLATFORM) {
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1,50 +0,0 @@
|
||||
package com.budwk.app;
|
||||
|
||||
|
||||
import cn.hutool.core.codec.Base64;
|
||||
import cn.hutool.core.util.CharsetUtil;
|
||||
import cn.hutool.crypto.digest.DigestUtil;
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import cn.hutool.json.JSONArray;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.budwk.app.base.sms.impl.njupt.SmsNjuptServiceImpl;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.util.List;
|
||||
|
||||
public class Test {
|
||||
|
||||
public static void main(String[] args) {
|
||||
String appId = "1926887238437818370";
|
||||
String secret = "32df31fcf4fc43f9a647ee1f47134f36";
|
||||
long ts = System.currentTimeMillis();
|
||||
|
||||
String sign = Base64.encode(DigestUtil.md5Hex(appId + secret + ts, CharsetUtil.CHARSET_UTF_8));
|
||||
|
||||
HttpRequest httpRequest = HttpUtil.createPost("https://sjzcpt.nnu.edu.cn/cdsp/data-api/v2/DS0005");
|
||||
httpRequest.header("Content-Type", "application/json");
|
||||
httpRequest.header("appId", appId);
|
||||
httpRequest.header("timestamp", String.valueOf(ts));
|
||||
httpRequest.header("sign", sign);
|
||||
httpRequest.body("{}");
|
||||
String body = httpRequest.execute().body();
|
||||
System.out.println(body);
|
||||
|
||||
// JSONObject entries = JSONUtil.parseObj(body);
|
||||
// JSONArray value = entries.getJSONArray("value");
|
||||
//
|
||||
// for (Object o : value) {
|
||||
// JSONObject jsonObject = (JSONObject) o;
|
||||
// }
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user