更新密码找回uniapp
This commit is contained in:
1 parent
7f9a66da0f
commit
3fdda89833
1304 files changed
+3503
-26132
No files matched your search
@@ -32,8 +32,6 @@ func normalizeStorageType(v string) string {
|
||||
}
|
||||
}
|
||||
|
||||
// GetStorageConfig 获取存储配置
|
||||
// GET /platform/storageConfig
|
||||
func (c *StorageConfigController) GetStorageConfig() {
|
||||
cfg, err := models.GetStorageConfig()
|
||||
if err != nil {
|
||||
@@ -56,8 +54,6 @@ func (c *StorageConfigController) GetStorageConfig() {
|
||||
_ = c.ServeJSON()
|
||||
}
|
||||
|
||||
// SaveStorageConfig 保存存储配置
|
||||
// POST /platform/saveStorageConfig
|
||||
func (c *StorageConfigController) SaveStorageConfig() {
|
||||
var p storageConfigPayload
|
||||
raw, _ := io.ReadAll(c.Ctx.Request.Body)
|
||||
@@ -69,7 +65,6 @@ func (c *StorageConfigController) SaveStorageConfig() {
|
||||
|
||||
storageType := normalizeStorageType(p.StorageType)
|
||||
|
||||
// 如果选择七牛云,验证必填字段
|
||||
if storageType == "qiniu" {
|
||||
if p.QiniuAccessKey == nil || strings.TrimSpace(*p.QiniuAccessKey) == "" {
|
||||
c.Data["json"] = map[string]interface{}{"code": 400, "msg": "七牛云 AccessKey 不能为空"}
|
||||
@@ -96,7 +91,6 @@ func (c *StorageConfigController) SaveStorageConfig() {
|
||||
var existed models.StorageConfig
|
||||
err := models.Orm.QueryTable(new(models.StorageConfig)).OrderBy("-id").One(&existed)
|
||||
if err == nil {
|
||||
// 更新现有配置
|
||||
update := map[string]interface{}{
|
||||
"storage_type": storageType,
|
||||
"qiniu_access_key": p.QiniuAccessKey,
|
||||
@@ -112,7 +106,6 @@ func (c *StorageConfigController) SaveStorageConfig() {
|
||||
return
|
||||
}
|
||||
} else {
|
||||
// 创建新配置
|
||||
row := &models.StorageConfig{
|
||||
StorageType: storageType,
|
||||
QiniuAccessKey: getStringValue(p.QiniuAccessKey),
|
||||
|
||||
Reference in new issue
Block a user