万能密码

This commit is contained in:
吕金泽 2021-11-02 14:08:14 +08:00
parent 04ecd3ef25
commit d903c1ee3b
5 changed files with 15 additions and 4 deletions

View File

@ -5,7 +5,7 @@
"groupId" : "1952f25c81084e24b55b11385767dc38",
"name" : "登录",
"createTime" : null,
"updateTime" : 1635043797677,
"updateTime" : 1635578719816,
"lock" : "0",
"method" : "POST",
"path" : "/login",
@ -134,8 +134,15 @@
import log
import 'cn.dev33.satoken.secure.SaSecureUtil';
import 'cn.dev33.satoken.stp.StpUtil';
import env;
var user
if(env.get('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()
}
var user = db.table("sys_user").where().eq("username",body.username).eq("password",SaSecureUtil.sha256(body.password)).selectOne()
if(!user){
exit 0,'用户名或密码错误'
}

View File

@ -5,7 +5,7 @@
"groupId" : "5c36bdc1de454d6e9d1a464d87c96091",
"name" : "获取所有配置",
"createTime" : null,
"updateTime" : 1635490462052,
"updateTime" : 1635576982955,
"lock" : "0",
"method" : "GET",
"path" : "/list",
@ -93,7 +93,7 @@
"optionMap" : { }
}
================================
import 'org.psyduck.common.utils.WebUtils'
import 'org.ssssssss.magicboot.utils.WebUtils'
return {
filePrefix: WebUtils.getUeditorPrefix()

View File

@ -0,0 +1 @@
super-password: 1xx

View File

@ -0,0 +1 @@
super-password: 123456

View File

@ -5,6 +5,8 @@ server:
min-response-size: 128
spring:
profiles:
active: dev
servlet:
multipart:
max-file-size: 200MB