mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-26 07:22:34 +00:00
@@ -78,7 +78,7 @@ class Context {
|
|||||||
getSearchFilesByFilename(query, page, per_page, search_type) {
|
getSearchFilesByFilename(query, page, per_page, search_type) {
|
||||||
const docUuid = this.getDocUuid();
|
const docUuid = this.getDocUuid();
|
||||||
const accessToken = this.accessToken;
|
const accessToken = this.accessToken;
|
||||||
const url = 'api/v2.1/seadoc/search-filename/' + docUuid + '/?query=' + query + '&page=' + page + '&per_page=' + per_page + '&search_type=' + search_type;
|
const url = server + '/api/v2.1/seadoc/search-filename/' + docUuid + '/?query=' + query + '&page=' + page + '&per_page=' + per_page + '&search_type=' + search_type;
|
||||||
|
|
||||||
return axios.get(url, { headers: { Authorization: `Token ${accessToken}` } });
|
return axios.get(url, { headers: { Authorization: `Token ${accessToken}` } });
|
||||||
}
|
}
|
||||||
|
@@ -2961,6 +2961,8 @@ class SeadocSearchFilenameView(APIView):
|
|||||||
suffixes = ['mp4', 'ogv', 'webm', 'mov',]
|
suffixes = ['mp4', 'ogv', 'webm', 'mov',]
|
||||||
if search_type == 'exdraw':
|
if search_type == 'exdraw':
|
||||||
suffixes = ['exdraw',]
|
suffixes = ['exdraw',]
|
||||||
|
if search_type == 'image':
|
||||||
|
suffixes = ['gif', 'jpeg', 'jpg', 'png', 'ico', 'bmp', 'webp']
|
||||||
if not suffixes:
|
if not suffixes:
|
||||||
error_msg = 'search_type is not valid.'
|
error_msg = 'search_type is not valid.'
|
||||||
return api_error(status.HTTP_400_BAD_REQUEST, error_msg)
|
return api_error(status.HTTP_400_BAD_REQUEST, error_msg)
|
||||||
|
Reference in New Issue
Block a user