diff --git a/data/magic-api/api/系统管理/安全/登录.ms b/data/magic-api/api/系统管理/安全/登录.ms index 6cc1a30..1c27378 100644 --- a/data/magic-api/api/系统管理/安全/登录.ms +++ b/data/magic-api/api/系统管理/安全/登录.ms @@ -5,7 +5,7 @@ "groupId" : "1952f25c81084e24b55b11385767dc38", "name" : "登录", "createTime" : null, - "updateTime" : 1653128903331, + "updateTime" : 1656424297619, "lock" : "0", "createBy" : null, "updateBy" : null, @@ -61,13 +61,13 @@ "expression" : null, "children" : null } ], - "requestBody" : "{\r\n \"username\": \"admin\",\r\n \"password\": \"123456\"\r\n}", + "requestBody" : "{\r\n \"username\": \"admin\",\r\n \"password\": \"8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92\"\r\n}", "headers" : [ ], "paths" : [ ], - "responseBody" : "{\n \"code\": 0,\n \"message\": \"请输入验证码\",\n \"data\": null,\n \"timestamp\": 1651934108567,\n \"executeTime\": 5\n}", + "responseBody" : "{\n \"code\": 0,\n \"message\": \"用户名或密码错误\",\n \"data\": null,\n \"timestamp\": 1656424276533,\n \"executeTime\": 11\n}", "description" : null, "requestBodyDefinition" : { - "name" : "root", + "name" : "", "value" : "", "description" : "", "required" : false, @@ -91,7 +91,7 @@ "children" : [ ] }, { "name" : "password", - "value" : "123456", + "value" : "8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92", "description" : "", "required" : false, "dataType" : "String", @@ -128,7 +128,7 @@ "children" : [ ] }, { "name" : "message", - "value" : "请输入验证码", + "value" : "用户名或密码错误", "description" : "", "required" : false, "dataType" : "String", @@ -152,7 +152,7 @@ "children" : [ ] }, { "name" : "timestamp", - "value" : "1651934108567", + "value" : "1656424276533", "description" : "", "required" : false, "dataType" : "Long", @@ -164,7 +164,7 @@ "children" : [ ] }, { "name" : "executeTime", - "value" : "5", + "value" : "11", "description" : "", "required" : false, "dataType" : "Integer", @@ -180,7 +180,6 @@ ================================ import org.ssssssss.magicboot.utils.AddressUtil import log -import 'cn.dev33.satoken.secure.SaSecureUtil'; import 'cn.dev33.satoken.stp.StpUtil'; import '@/configure/getBykey' as configure; import request; @@ -201,7 +200,7 @@ var user if(configure('super-password') == body.password){ user = db.table("sys_user").where().eq("username",body.username).selectOne() }else{ - user = db.table("sys_user").where().eq("username",body.username).eq("password",SaSecureUtil.sha256(body.password)).selectOne() + user = db.table("sys_user").where().eq("username",body.username).eq("password", body.password).selectOne() } var loginLog = { diff --git a/magic-boot-ui/package.json b/magic-boot-ui/package.json index a9f9ec7..0dea371 100644 --- a/magic-boot-ui/package.json +++ b/magic-boot-ui/package.json @@ -11,6 +11,7 @@ "dependencies": { "axios": "^0.24.0", "element-plus": "^2.2.6", + "js-sha256": "^0.9.0", "nprogress": "0.2.0", "path-browserify": "^1.0.1", "vue": "^3.2.25", diff --git a/magic-boot-ui/src/scripts/auth.js b/magic-boot-ui/src/scripts/auth.js index f6b0953..675686b 100644 --- a/magic-boot-ui/src/scripts/auth.js +++ b/magic-boot-ui/src/scripts/auth.js @@ -1,5 +1,7 @@ import global from './global' import request from '@/scripts/request' +import { sha256 } from 'js-sha256' + const TokenKey = 'magic_boot_token' export function getToken() { @@ -41,7 +43,11 @@ export function login(data){ request({ url: '/system/security/login', method: 'post', - data + data: { + username: data.username, + password: sha256(data.password), + code: data.code + } }).then(res => { var token = res.data setToken(token) diff --git a/magic-boot-ui/src/scripts/routerPermission.js b/magic-boot-ui/src/scripts/routerPermission.js index c1de86d..523151f 100644 --- a/magic-boot-ui/src/scripts/routerPermission.js +++ b/magic-boot-ui/src/scripts/routerPermission.js @@ -1,5 +1,6 @@ import request from '@/scripts/request' import common from '@/scripts/common' +import { sha256 } from 'js-sha256' const viewModules = import.meta.glob("../views/**/**.vue") const layoutModules = import.meta.glob("../layout/**.vue") @@ -11,7 +12,7 @@ export const filterAsyncRouter = (routers, level) => { var setIframe = () => { router.component = loadView(`/common/iframe`) router.props = { url: router.url } - router.path = "/" + common.uuid() + router.path = "/" + sha256(router.url) } if(router.url.startsWith('http')){ if(router.openMode == '0'){ diff --git a/magic-boot-ui/src/scripts/treeTable.js b/magic-boot-ui/src/scripts/treeTable.js index 20defe0..b37f603 100644 --- a/magic-boot-ui/src/scripts/treeTable.js +++ b/magic-boot-ui/src/scripts/treeTable.js @@ -93,4 +93,10 @@ treeTable.treeNodeReplace = (fields, searchData, treeNode, text, childrenSearch, } } +treeTable.clearFont = (data, fields) => { + fields.forEach(field => { + data[field] = data[field].replaceAll(/(.*?)<\/font>/g,'$1') + }) +} + export default treeTable diff --git a/magic-boot-ui/src/views/system/menu/menu-form.vue b/magic-boot-ui/src/views/system/menu/menu-form.vue index 1aa5f0b..04de513 100644 --- a/magic-boot-ui/src/views/system/menu/menu-form.vue +++ b/magic-boot-ui/src/views/system/menu/menu-form.vue @@ -242,7 +242,7 @@ function getInfo(row) { } openModeRef.value = temp.value.openMode || '0' menuType.value = temp.value.url ? 'menu' : 'button' - temp.value.name = temp.value.name.replaceAll(/(.*?)<\/font>/g,'$1') + proxy.$treeTable.clearFont(temp.value, ['name', 'url', 'permission']) nextTick(() => { dataForm.value.clearValidate() }) diff --git a/magic-boot-ui/src/views/system/office/office-list.vue b/magic-boot-ui/src/views/system/office/office-list.vue index 1a300a8..b419e13 100644 --- a/magic-boot-ui/src/views/system/office/office-list.vue +++ b/magic-boot-ui/src/views/system/office/office-list.vue @@ -336,7 +336,7 @@ function handleUpdate(row) { for (var t in temp.value) { temp.value[t] = row[t] } - temp.value.name = temp.value.name.replaceAll(/(.*?)<\/font>/g,'$1') + proxy.$treeTable.clearFont(temp.value, ['name', 'code']) dialogTitle.value = '修改' officeFormDialog.value.show() nextTick(() => {