feat: 1.1.0
修改gaea包
修改权限接口
修复build.gradle打包问题
修改状态名
This commit is contained in:
12
build.gradle
12
build.gradle
@@ -4,7 +4,7 @@ buildscript {
|
|||||||
ext {
|
ext {
|
||||||
jvm_version = '21'
|
jvm_version = '21'
|
||||||
kotlin_version = '2.0.0'
|
kotlin_version = '2.0.0'
|
||||||
gaea_version = '1.7.0'
|
gaea_version = '1.7.1'
|
||||||
spring_version = "3.3.0"
|
spring_version = "3.3.0"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -26,7 +26,7 @@ subprojects {
|
|||||||
version version
|
version version
|
||||||
|
|
||||||
ext {
|
ext {
|
||||||
version '1.0.0'
|
version '1.1.0'
|
||||||
}
|
}
|
||||||
|
|
||||||
buildscript {
|
buildscript {
|
||||||
@@ -68,4 +68,12 @@ subprojects {
|
|||||||
jvmTarget = JvmTarget.valueOf("JVM_$jvm_version")
|
jvmTarget = JvmTarget.valueOf("JVM_$jvm_version")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
publishing {
|
||||||
|
publications {
|
||||||
|
mavenJava(MavenPublication) {
|
||||||
|
from components.java
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,25 +39,16 @@ db.system.insertOne({
|
|||||||
})
|
})
|
||||||
|
|
||||||
db.page.insertMany([
|
db.page.insertMany([
|
||||||
{ "_id": "1", "name": "groups", "uri": "/groups", "parent": "0", "system": "1", "order": 5, "icon": "group" },
|
{ "_id": "1", "name": "groups", "uri": "/groups", "parent": "0", "system": "1", "order": 1, "icon": "group" },
|
||||||
{ "_id": "2", "name": "roles", "uri": "/roles", "parent": "0", "system": "1", "order": 6, "icon": "manual" },
|
{ "_id": "2", "name": "roles", "uri": "/roles", "parent": "0", "system": "1", "order": 2, "icon": "manual" },
|
||||||
{ "_id": "3", "name": "users", "uri": "/users", "parent": "0", "system": "1", "order": 7, "icon": "user" },
|
{ "_id": "3", "name": "users", "uri": "/users", "parent": "0", "system": "1", "order": 3, "icon": "user" },
|
||||||
{ "_id": "4", "name": "sheet", "uri": "/repair/sheets/all", "parent": "0", "system": "1", "order": 1, "icon": "sheet" },
|
{ "_id": "4", "name": "pages", "uri": "/pages", "parent": "0", "system": "1", "order": 4, "icon": "page" }})
|
||||||
{ "_id": "5", "name": "sheet", "uri": "/repair/sheets/permission", "parent": "1", "system": "1", "order": 2, "icon": "sheet" },
|
|
||||||
{ "_id": "6", "name": "spare", "uri": "/repair/spares/all", "parent": "1", "system": "1", "order": 3, "icon": "setting" },
|
|
||||||
{ "_id": "7", "name": "spare", "uri": "/repair/spares/permission", "parent": "1", "system": "1", "order": 4, "icon": "setting" },
|
|
||||||
{ "_id": "8", "name": "manual", "uri": "/manual", "parent": "0", "system": "1", "order": 8, "icon": "manual" }
|
|
||||||
])
|
])
|
||||||
|
|
||||||
db.authority.insertMany([
|
db.authority.insertMany([
|
||||||
{ "role": "admin", "resource": "1", "type": "System", "authority": "Allow", "avalible": true, "_class": "com.synebula.zeus.domain.model.rbac.Authority" },
|
{ "role": "admin", "resource": "1", "type": "System", "authority": "Allow", "avalible": true, "_class": "com.synebula.zeus.domain.model.rbac.Authority" },
|
||||||
{ "role": "admin", "resource": "1", "type": "Page", "authority": "Allow", "avalible": true, "_class": "com.synebula.zeus.domain.model.rbac.Authority" },
|
{ "role": "admin", "resource": "1", "type": "Page", "authority": "Allow", "avalible": true, "_class": "com.synebula.zeus.domain.model.rbac.Authority" },
|
||||||
{ "role": "admin", "resource": "2", "type": "Page", "authority": "Allow", "avalible": true, "_class": "com.synebula.zeus.domain.model.rbac.Authority" },
|
{ "role": "admin", "resource": "2", "type": "Page", "authority": "Allow", "avalible": true, "_class": "com.synebula.zeus.domain.model.rbac.Authority" },
|
||||||
{ "role": "admin", "resource": "3", "type": "Page", "authority": "Allow", "avalible": true, "_class": "com.synebula.zeus.domain.model.rbac.Authority" },
|
{ "role": "admin", "resource": "67595cfcbbef24782f95a325", "type": "Page", "authority": "Allow", "avalible": true, "_class": "com.synebula.zeus.domain.model.rbac.Authority" },
|
||||||
{ "role": "admin", "resource": "4", "type": "Page", "authority": "Allow", "avalible": true, "_class": "com.synebula.zeus.domain.model.rbac.Authority" },
|
|
||||||
{ "role": "admin", "resource": "5", "type": "Page", "authority": "Allow", "avalible": true, "_class": "com.synebula.zeus.domain.model.rbac.Authority" },
|
|
||||||
{ "role": "admin", "resource": "6", "type": "Page", "authority": "Allow", "avalible": true, "_class": "com.synebula.zeus.domain.model.rbac.Authority" },
|
|
||||||
{ "role": "admin", "resource": "7", "type": "Page", "authority": "Allow", "avalible": true, "_class": "com.synebula.zeus.domain.model.rbac.Authority" },
|
|
||||||
{ "role": "admin", "resource": "8", "type": "Page", "authority": "Allow", "avalible": true, "_class": "com.synebula.zeus.domain.model.rbac.Authority" },
|
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|||||||
@@ -19,15 +19,3 @@ dependencies {
|
|||||||
api "com.synebula:gaea.mongodb:$gaea_version"
|
api "com.synebula:gaea.mongodb:$gaea_version"
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
publishing {
|
|
||||||
publications {
|
|
||||||
publish(MavenPublication) {
|
|
||||||
group 'com.synebula'
|
|
||||||
artifactId 'zeus.app'
|
|
||||||
version "$version"
|
|
||||||
from components.java
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|||||||
@@ -66,12 +66,12 @@ class SignInOutApp(override var logger: ILogger) : IApplication {
|
|||||||
@Method("用户登出")
|
@Method("用户登出")
|
||||||
@PostMapping("/out")
|
@PostMapping("/out")
|
||||||
fun signOut(): HttpMessage {
|
fun signOut(): HttpMessage {
|
||||||
val token = this.userSession()?.token
|
val token = this.session()?.token
|
||||||
return if (token != null) {
|
return if (token != null) {
|
||||||
userSessionManager.signOut(token)
|
userSessionManager.signOut(token)
|
||||||
this.httpMessageFactory.create(token)
|
this.httpMessageFactory.create(token)
|
||||||
} else
|
} else
|
||||||
this.httpMessageFactory.create(Status.Unauthorized, "")
|
this.httpMessageFactory.create(Status.UNAUTHORIZED, "")
|
||||||
}
|
}
|
||||||
|
|
||||||
@Method("用户注册")
|
@Method("用户注册")
|
||||||
@@ -83,7 +83,7 @@ class SignInOutApp(override var logger: ILogger) : IApplication {
|
|||||||
val message = userService.add(command)
|
val message = userService.add(command)
|
||||||
it.data = message.data
|
it.data = message.data
|
||||||
} else {
|
} else {
|
||||||
it.status = Status.Failure
|
it.status = Status.FAILURE
|
||||||
it.message = "系统中已存在该用户"
|
it.message = "系统中已存在该用户"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ class UserApp(
|
|||||||
if (list.isEmpty())
|
if (list.isEmpty())
|
||||||
it.from(super.add(command))
|
it.from(super.add(command))
|
||||||
else {
|
else {
|
||||||
it.status = Status.Failure
|
it.status = Status.FAILURE
|
||||||
it.message = "系统中已存在该用户"
|
it.message = "系统中已存在该用户"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -58,7 +58,7 @@ class UserApp(
|
|||||||
it.load((this.service as IUserService).forgotPassword(users[0].id))
|
it.load((this.service as IUserService).forgotPassword(users[0].id))
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
it.status = Status.Failure
|
it.status = Status.FAILURE
|
||||||
it.message = "找不到该用户信息"
|
it.message = "找不到该用户信息"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import com.synebula.gaea.spring.aop.annotation.Module
|
|||||||
import com.synebula.zeus.domain.service.cmd.rbac.resource.PageCmd
|
import com.synebula.zeus.domain.service.cmd.rbac.resource.PageCmd
|
||||||
import com.synebula.zeus.domain.service.contr.rbac.resource.IPageService
|
import com.synebula.zeus.domain.service.contr.rbac.resource.IPageService
|
||||||
import com.synebula.zeus.query.contr.resouce.IPageQuery
|
import com.synebula.zeus.query.contr.resouce.IPageQuery
|
||||||
|
import com.synebula.zeus.query.view.SignUserView
|
||||||
import com.synebula.zeus.query.view.resource.PageView
|
import com.synebula.zeus.query.view.resource.PageView
|
||||||
import org.springframework.web.bind.annotation.GetMapping
|
import org.springframework.web.bind.annotation.GetMapping
|
||||||
import org.springframework.web.bind.annotation.PathVariable
|
import org.springframework.web.bind.annotation.PathVariable
|
||||||
@@ -26,11 +27,11 @@ class PageApp(
|
|||||||
) {
|
) {
|
||||||
|
|
||||||
@Method("获取角色系统下有权页面")
|
@Method("获取角色系统下有权页面")
|
||||||
@GetMapping("/in-system/{system}/authorized/{role}")
|
@GetMapping("/by-system/{system}/authorized/{role}")
|
||||||
fun authorized(@PathVariable system: String, @PathVariable role: String): HttpMessage {
|
fun authorized(@PathVariable system: String, @PathVariable role: String): HttpMessage {
|
||||||
val msg = this.httpMessageFactory.create()
|
return this.safeExecute("获取有权资源列表失败") { msg ->
|
||||||
msg.data = this.pageQuery.authorized(role, system)
|
msg.data = this.pageQuery.authorized(role, system)
|
||||||
return msg
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Method("获取角色全部有权页面")
|
@Method("获取角色全部有权页面")
|
||||||
@@ -42,20 +43,22 @@ class PageApp(
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Method("验证角色页面权限")
|
@Method("验证角色页面权限")
|
||||||
@GetMapping("/{page}/authorize/{role}")
|
@GetMapping("/{page}/authorize")
|
||||||
fun authorize(@PathVariable page: String, @PathVariable role: String): HttpMessage {
|
fun authorize(@PathVariable page: String): HttpMessage {
|
||||||
|
val session = this.session()
|
||||||
|
val rid = session?.user<SignUserView>()?.rid ?: ""
|
||||||
return this.safeExecute("获取权限信息失败") { msg ->
|
return this.safeExecute("获取权限信息失败") { msg ->
|
||||||
msg.data = this.pageQuery.authorize(page, role)
|
msg.data = this.pageQuery.authorize(page, rid)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Method("验证角色URL权限")
|
@Method("验证角色URL权限")
|
||||||
@GetMapping("/authorize/{role}")
|
@GetMapping("/authorize")
|
||||||
fun uriAuthorize(@PathVariable role: String, uri: String): HttpMessage {
|
fun uriAuthorize(uri: String): HttpMessage {
|
||||||
|
val session = this.session()
|
||||||
|
val rid = session?.user<SignUserView>()?.rid ?: ""
|
||||||
return this.safeExecute("获取权限信息失败") { msg ->
|
return this.safeExecute("获取权限信息失败") { msg ->
|
||||||
msg.data = this.pageQuery.uriAuthorize(uri, role)
|
msg.data = this.pageQuery.uriAuthorize(uri, rid)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -7,6 +7,7 @@ import com.synebula.gaea.spring.aop.annotation.Method
|
|||||||
import com.synebula.zeus.domain.service.cmd.rbac.resource.SystemCmd
|
import com.synebula.zeus.domain.service.cmd.rbac.resource.SystemCmd
|
||||||
import com.synebula.zeus.domain.service.contr.rbac.resource.ISystemService
|
import com.synebula.zeus.domain.service.contr.rbac.resource.ISystemService
|
||||||
import com.synebula.zeus.query.contr.resouce.ISystemQuery
|
import com.synebula.zeus.query.contr.resouce.ISystemQuery
|
||||||
|
import com.synebula.zeus.query.view.SignUserView
|
||||||
import com.synebula.zeus.query.view.resource.SystemView
|
import com.synebula.zeus.query.view.resource.SystemView
|
||||||
import org.springframework.web.bind.annotation.GetMapping
|
import org.springframework.web.bind.annotation.GetMapping
|
||||||
import org.springframework.web.bind.annotation.PathVariable
|
import org.springframework.web.bind.annotation.PathVariable
|
||||||
@@ -31,10 +32,12 @@ class SystemApp(
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Method("验证角色系统权限")
|
@Method("验证角色系统权限")
|
||||||
@GetMapping("/{system}/authorize/{role}")
|
@GetMapping("/{system}/authorize")
|
||||||
fun authorize(@PathVariable system: String, @PathVariable role: String): HttpMessage {
|
fun authorize(@PathVariable system: String): HttpMessage {
|
||||||
|
val session = this.session()
|
||||||
|
val rid = session?.user<SignUserView>()?.rid ?: ""
|
||||||
return this.safeExecute("获取权限信息失败") { msg ->
|
return this.safeExecute("获取权限信息失败") { msg ->
|
||||||
msg.data = this.systemQuery.authorize(system, role)
|
msg.data = this.systemQuery.authorize(system, rid)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,11 +1,14 @@
|
|||||||
server:
|
server:
|
||||||
port: 80
|
port: 80
|
||||||
|
error:
|
||||||
|
whitelabel:
|
||||||
|
enabled: false
|
||||||
spring:
|
spring:
|
||||||
application:
|
application:
|
||||||
name: gaea.app
|
name: gaea.app
|
||||||
sign-in-url: /sign/in
|
sign-in-url: /sign/in
|
||||||
allow-multi-sign: ${ALLOW_MULTI_SIGN:false}
|
allow-multi-sign: ${ALLOW_MULTI_SIGN:true}
|
||||||
|
token-salt: ${TOKEN_SALT:7d25b8e5}
|
||||||
data:
|
data:
|
||||||
mongodb:
|
mongodb:
|
||||||
uri: ${DB_URL:mongodb://root:LcY221815@127.0.0.1/zeus}
|
uri: ${DB_URL:mongodb://root:LcY221815@127.0.0.1/zeus}
|
||||||
|
|||||||
@@ -2,15 +2,3 @@ dependencies {
|
|||||||
api project(":src:zeus.env")
|
api project(":src:zeus.env")
|
||||||
api "com.synebula:gaea:$gaea_version"
|
api "com.synebula:gaea:$gaea_version"
|
||||||
}
|
}
|
||||||
|
|
||||||
publishing {
|
|
||||||
publications {
|
|
||||||
publish(MavenPublication) {
|
|
||||||
group 'com.synebula'
|
|
||||||
artifactId 'zeus.domain'
|
|
||||||
version "$version"
|
|
||||||
from components.java
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|||||||
@@ -61,10 +61,10 @@ class UserService(
|
|||||||
user.avalible = true
|
user.avalible = true
|
||||||
user.token = null
|
user.token = null
|
||||||
this.repository.update(user)
|
this.repository.update(user)
|
||||||
DataMessage(Status.Success, "用户${user.name}激活成功")
|
DataMessage(Status.SUCCESS, "用户${user.name}激活成功")
|
||||||
} else {
|
} else {
|
||||||
logger.warn(this, "用户${user.name}激活失败, {key: ${key}, token: $token")
|
logger.warn(this, "用户${user.name}激活失败, {key: ${key}, token: $token")
|
||||||
DataMessage(Status.Failure, "用户${user.name}激活失败, 请从系统发送的邮件链接激活用户")
|
DataMessage(Status.FAILURE, "用户${user.name}激活失败, 请从系统发送的邮件链接激活用户")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -78,7 +78,7 @@ class UserService(
|
|||||||
DataMessage()
|
DataMessage()
|
||||||
} else {
|
} else {
|
||||||
logger.warn(this, "用户修改${user.name}密码失败, 旧密码验证不通过")
|
logger.warn(this, "用户修改${user.name}密码失败, 旧密码验证不通过")
|
||||||
DataMessage(Status.Failure, "用户修改密码失败, 旧密码验证不通过")
|
DataMessage(Status.FAILURE, "用户修改密码失败, 旧密码验证不通过")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -95,7 +95,7 @@ class UserService(
|
|||||||
this,
|
this,
|
||||||
"用户重置${user.name}密码失败, 系统密码修改令牌:${user.token}, {key: $key , token: $token"
|
"用户重置${user.name}密码失败, 系统密码修改令牌:${user.token}, {key: $key , token: $token"
|
||||||
)
|
)
|
||||||
DataMessage(Status.Failure, "用户重置密码失败, 如需重置密码请从系统发送的邮件链接中重置")
|
DataMessage(Status.FAILURE, "用户重置密码失败, 如需重置密码请从系统发送的邮件链接中重置")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -107,6 +107,6 @@ class UserService(
|
|||||||
userNotifier?.forgot(user.id!!, user.name, user.token!!)
|
userNotifier?.forgot(user.id!!, user.name, user.token!!)
|
||||||
DataMessage()
|
DataMessage()
|
||||||
} else
|
} else
|
||||||
DataMessage(Status.Failure, "用户还未激活, 请先激活用户")
|
DataMessage(Status.FAILURE, "用户还未激活, 请先激活用户")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,15 +1,3 @@
|
|||||||
dependencies {
|
dependencies {
|
||||||
api "com.synebula:gaea:$gaea_version"
|
api "com.synebula:gaea:$gaea_version"
|
||||||
}
|
}
|
||||||
|
|
||||||
publishing {
|
|
||||||
publications {
|
|
||||||
publish(MavenPublication) {
|
|
||||||
group 'com.synebula'
|
|
||||||
artifactId 'zeus.env'
|
|
||||||
version "$version"
|
|
||||||
from components.java
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|||||||
@@ -2,15 +2,3 @@ dependencies {
|
|||||||
api project(":src:zeus.env")
|
api project(":src:zeus.env")
|
||||||
api "com.synebula:gaea.mongodb:$gaea_version"
|
api "com.synebula:gaea.mongodb:$gaea_version"
|
||||||
}
|
}
|
||||||
|
|
||||||
publishing {
|
|
||||||
publications {
|
|
||||||
publish(MavenPublication) {
|
|
||||||
group 'com.synebula'
|
|
||||||
artifactId 'zeus.query'
|
|
||||||
version "$version"
|
|
||||||
from components.java
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ class UserQuery(template: MongoTemplate) :
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
} else
|
} else
|
||||||
DataMessage(Status.Failure, "用户名或密码错误")
|
DataMessage(Status.FAILURE, "用户名或密码错误")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,15 +3,3 @@ dependencies {
|
|||||||
api project(":src:zeus.domain")
|
api project(":src:zeus.domain")
|
||||||
api "com.synebula:gaea.mongodb:$gaea_version"
|
api "com.synebula:gaea.mongodb:$gaea_version"
|
||||||
}
|
}
|
||||||
|
|
||||||
publishing {
|
|
||||||
publications {
|
|
||||||
publish(MavenPublication) {
|
|
||||||
group 'com.synebula'
|
|
||||||
artifactId 'zeus.repository'
|
|
||||||
version "$version"
|
|
||||||
from components.java
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user