+
管理员存储,您配置的存储将决定其他用户配置的默认存储,请谨慎修改
@@ -73,8 +73,8 @@
-
-
+
+
@@ -169,7 +169,7 @@
-
+
+ width="180">
+ width="130">
+ width="200">
+ >
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
校验并保存
+
+
-
+
diff --git a/fir_client/src/router/index.js b/fir_client/src/router/index.js
index 27c9537..e462092 100644
--- a/fir_client/src/router/index.js
+++ b/fir_client/src/router/index.js
@@ -132,13 +132,7 @@ const router = new VueRouter({
// component: FirUserProfileChangePwd
component: () => import("@/components/FirUserProfileChangePwd"),
- }, {
- path: 'storage',
- name: 'FirUserProfileStorage',
- // component: FirUserProfileStorage
- component: () => import("@/components/FirUserProfileStorage"),
-
- }
+ },
]
}
@@ -166,6 +160,21 @@ const router = new VueRouter({
}
]
},
+ {
+ path: '/storage',
+ // component: FirAppBase,
+ component: () => import("@/components/FirAppBase"),
+
+ children: [
+ {
+ path: ':act',
+ name: 'FirUserStorage',
+ // component: FirUserProfileStorage
+ component: () => import("@/components/FirUserStorage"),
+
+ }
+ ]
+ },
{
path: '/register',
name: 'FirRegist',
diff --git a/fir_ser/api/utils/utils.py b/fir_ser/api/utils/utils.py
index 9cc7678..aa4f499 100644
--- a/fir_ser/api/utils/utils.py
+++ b/fir_ser/api/utils/utils.py
@@ -279,6 +279,10 @@ def migrating_storage_file_data(user_obj, filename, new_storage_obj, clean_old_d
else:
new_storage_obj = Storage(user_obj, new_storage_obj)
+ if old_storage_obj.get_storage_type() == new_storage_obj.get_storage_type():
+ # 同一个存储,无需迁移数据
+ return True
+
if old_storage_obj.get_storage_type() == 3:
if new_storage_obj.get_storage_type() == 3:
# 都是本地存储,无需操作
diff --git a/fir_ser/api/views/storage.py b/fir_ser/api/views/storage.py
index 4612409..f08ef8d 100644
--- a/fir_ser/api/views/storage.py
+++ b/fir_ser/api/views/storage.py
@@ -24,6 +24,16 @@ class StorageView(APIView):
def get(self, request):
res = BaseResponse()
+ res.storage_list = []
+ storage_org_list = list(AppStorage.storage_choices)
+ for storage_t in storage_org_list:
+ if storage_t[0] in [0, 3]: continue
+ res.storage_list.append({'id': storage_t[0], 'name': storage_t[1]})
+
+ act = request.query_params.get("act", None)
+ if act == 'storage_type':
+ return Response(res.dict)
+
# [1,2] 表示七牛存储和阿里云存储
storage_obj = AppStorage.objects.filter(user_id=request.user, storage_type__in=[1, 2])
if storage_obj:
@@ -43,12 +53,6 @@ class StorageView(APIView):
else:
res.storage = -1 # 默认存储
- res.storage_list = []
- storage_org_list = list(AppStorage.storage_choices)
- for storage_t in storage_org_list:
- if storage_t[0] in [0, 3]: continue
- res.storage_list.append({'id': storage_t[0], 'name': storage_t[1]})
-
admin_storage = UserInfo.objects.filter(is_superuser=True).order_by('pk').first()
res.is_admin_storage = False
if admin_storage and admin_storage.uid == request.user.uid: