mirror of
https://gitee.com/dromara/mayfly-go
synced 2025-11-02 07:20:24 +08:00
fix: 新版本问题修复
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
"countup.js": "^2.8.0",
|
||||
"cropperjs": "^1.6.1",
|
||||
"echarts": "^5.5.0",
|
||||
"element-plus": "^2.6.2",
|
||||
"element-plus": "^2.7.0",
|
||||
"js-base64": "^3.7.7",
|
||||
"jsencrypt": "^3.3.2",
|
||||
"lodash": "^4.17.21",
|
||||
|
||||
@@ -252,7 +252,7 @@ const columns = ref([
|
||||
TableColumn.new('type', '类型').isSlot().setAddWidth(-15).alignCenter(),
|
||||
TableColumn.new('instanceName', '实例名'),
|
||||
TableColumn.new('host', 'ip:port').isSlot().setAddWidth(40),
|
||||
TableColumn.new('username', 'username'),
|
||||
TableColumn.new('authCertName', '授权凭证'),
|
||||
TableColumn.new('flowProcdefKey', '关联流程'),
|
||||
TableColumn.new('remark', '备注'),
|
||||
]);
|
||||
|
||||
@@ -27,8 +27,8 @@
|
||||
<el-descriptions-item label="数据库版本">
|
||||
<span v-loading="loadingServerInfo"> {{ `${dbServerInfo?.version}` }}</span>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="user">
|
||||
{{ data.params.username }}
|
||||
<el-descriptions-item label="授权凭证">
|
||||
{{ data.params.authCertName }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="备注">
|
||||
{{ data.params.remark }}
|
||||
|
||||
@@ -619,6 +619,7 @@ const getDirSize = async (data: any) => {
|
||||
fileId: props.fileId,
|
||||
path: data.path,
|
||||
protocol: props.protocol,
|
||||
authCertName: props.authCertName,
|
||||
});
|
||||
data.dirSize = res;
|
||||
} finally {
|
||||
|
||||
@@ -16,7 +16,6 @@ type DbListVO struct {
|
||||
|
||||
InstanceId *int64 `json:"instanceId"`
|
||||
AuthCertName string `json:"authCertName"`
|
||||
Username string `json:"username"`
|
||||
InstanceName *string `json:"instanceName"`
|
||||
InstanceType *string `json:"type"`
|
||||
Host string `json:"host"`
|
||||
|
||||
@@ -19,8 +19,8 @@ func newDbRepo() repository.Db {
|
||||
// 分页获取数据库信息列表
|
||||
func (d *dbRepoImpl) GetDbList(condition *entity.DbQuery, pageParam *model.PageParam, toEntity any, orderBy ...string) (*model.PageResult[any], error) {
|
||||
qd := gormx.NewQueryWithTableName("t_db db").
|
||||
Select("db.*, inst.name instance_name, inst.type instance_type, inst.host, inst.port, rac.username ").
|
||||
Joins("JOIN t_db_instance inst ON db.instance_id = inst.id JOIN t_resource_auth_cert rac ON inst.code = rac.resource_code AND rac.resource_type = 2").
|
||||
Select("db.*, inst.name instance_name, inst.type instance_type, inst.host, inst.port ").
|
||||
Joins("JOIN t_db_instance inst ON db.instance_id = inst.id").
|
||||
Eq("db.instance_id", condition.InstanceId).
|
||||
Eq("db.id", condition.Id).
|
||||
Like("db.database", condition.Database).
|
||||
|
||||
@@ -327,7 +327,7 @@ func (r *resourceAuthCertAppImpl) addAuthCert(ctx context.Context, rac *entity.R
|
||||
if rac.Type == entity.AuthCertTypePublic {
|
||||
rac.ResourceCode = "-"
|
||||
rac.CiphertextEncrypt()
|
||||
rac.Type = -2
|
||||
rac.ResourceType = -2
|
||||
return r.Insert(ctx, rac)
|
||||
}
|
||||
|
||||
@@ -428,21 +428,17 @@ func (r *resourceAuthCertAppImpl) updateAuthCertTagName(ctx context.Context, aut
|
||||
// 解密授权凭证信息
|
||||
func (r *resourceAuthCertAppImpl) decryptAuthCert(authCert *entity.ResourceAuthCert) (*entity.ResourceAuthCert, error) {
|
||||
if authCert.CiphertextType == entity.AuthCertCiphertextTypePublic {
|
||||
// 需要维持资源关联信息
|
||||
resourceCode := authCert.ResourceCode
|
||||
resourceType := authCert.ResourceType
|
||||
authCertType := authCert.Type
|
||||
|
||||
// 如果是公共授权凭证,则密文为公共授权凭证名称,需要使用该名称再去获取对应的授权凭证
|
||||
authCert = &entity.ResourceAuthCert{Name: authCert.Ciphertext}
|
||||
if err := r.GetBy(authCert); err != nil {
|
||||
realAuthCert := &entity.ResourceAuthCert{Name: authCert.Ciphertext}
|
||||
if err := r.GetBy(realAuthCert); err != nil {
|
||||
return nil, errorx.NewBiz("该公共授权凭证[%s]不存在", authCert.Ciphertext)
|
||||
}
|
||||
|
||||
// 使用资源关联的凭证类型
|
||||
authCert.ResourceCode = resourceCode
|
||||
authCert.ResourceType = resourceType
|
||||
authCert.Type = authCertType
|
||||
// 使用该凭证关联的公共凭证进行密文等内容覆盖
|
||||
authCert.Username = realAuthCert.Username
|
||||
authCert.Ciphertext = realAuthCert.Ciphertext
|
||||
authCert.CiphertextType = realAuthCert.CiphertextType
|
||||
authCert.Extra = realAuthCert.Extra
|
||||
}
|
||||
|
||||
if err := authCert.CiphertextDecrypt(); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user