改进
This commit is contained in:
parent
bf01c8680e
commit
b4ae8d70c0
7
api/openapitools.json
Normal file
7
api/openapitools.json
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json",
|
||||
"spaces": 2,
|
||||
"generator-cli": {
|
||||
"version": "7.1.0"
|
||||
}
|
||||
}
|
@ -306,6 +306,20 @@
|
||||
"name": "DocumentId",
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "标题",
|
||||
"name": "Title",
|
||||
"in": "query",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "内容",
|
||||
"name": "Content",
|
||||
"in": "query",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
|
@ -1,9 +1,7 @@
|
||||
<template>
|
||||
<v-main>
|
||||
<v-container>
|
||||
<v-responsive class="pa-2">
|
||||
<router-view />
|
||||
</v-responsive>
|
||||
<router-view />
|
||||
</v-container>
|
||||
</v-main>
|
||||
</template>
|
||||
|
@ -296,14 +296,20 @@ export const DocumentsApiAxiosParamCreator = function (configuration?: Configura
|
||||
* @summary 更新文档
|
||||
* @param {string} libraryId 资料库 ID
|
||||
* @param {string} documentId 文档 ID
|
||||
* @param {string} title 标题
|
||||
* @param {string} content 内容
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
libraryLibraryIdDocumentDocumentIdPut: async (libraryId: string, documentId: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||
libraryLibraryIdDocumentDocumentIdPut: async (libraryId: string, documentId: string, title: string, content: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||
// verify required parameter 'libraryId' is not null or undefined
|
||||
assertParamExists('libraryLibraryIdDocumentDocumentIdPut', 'libraryId', libraryId)
|
||||
// verify required parameter 'documentId' is not null or undefined
|
||||
assertParamExists('libraryLibraryIdDocumentDocumentIdPut', 'documentId', documentId)
|
||||
// verify required parameter 'title' is not null or undefined
|
||||
assertParamExists('libraryLibraryIdDocumentDocumentIdPut', 'title', title)
|
||||
// verify required parameter 'content' is not null or undefined
|
||||
assertParamExists('libraryLibraryIdDocumentDocumentIdPut', 'content', content)
|
||||
const localVarPath = `/library/{LibraryId}/document/{DocumentId}`
|
||||
.replace(`{${"LibraryId"}}`, encodeURIComponent(String(libraryId)))
|
||||
.replace(`{${"DocumentId"}}`, encodeURIComponent(String(documentId)));
|
||||
@ -321,6 +327,14 @@ export const DocumentsApiAxiosParamCreator = function (configuration?: Configura
|
||||
// authentication BearerToken required
|
||||
await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)
|
||||
|
||||
if (title !== undefined) {
|
||||
localVarQueryParameter['Title'] = title;
|
||||
}
|
||||
|
||||
if (content !== undefined) {
|
||||
localVarQueryParameter['Content'] = content;
|
||||
}
|
||||
|
||||
|
||||
|
||||
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||
@ -517,11 +531,13 @@ export const DocumentsApiFp = function(configuration?: Configuration) {
|
||||
* @summary 更新文档
|
||||
* @param {string} libraryId 资料库 ID
|
||||
* @param {string} documentId 文档 ID
|
||||
* @param {string} title 标题
|
||||
* @param {string} content 内容
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async libraryLibraryIdDocumentDocumentIdPut(libraryId: string, documentId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ModelDocument>> {
|
||||
const localVarAxiosArgs = await localVarAxiosParamCreator.libraryLibraryIdDocumentDocumentIdPut(libraryId, documentId, options);
|
||||
async libraryLibraryIdDocumentDocumentIdPut(libraryId: string, documentId: string, title: string, content: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ModelDocument>> {
|
||||
const localVarAxiosArgs = await localVarAxiosParamCreator.libraryLibraryIdDocumentDocumentIdPut(libraryId, documentId, title, content, options);
|
||||
const index = configuration?.serverIndex ?? 0;
|
||||
const operationBasePath = operationServerMap['DocumentsApi.libraryLibraryIdDocumentDocumentIdPut']?.[index]?.url;
|
||||
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath);
|
||||
@ -607,11 +623,13 @@ export const DocumentsApiFactory = function (configuration?: Configuration, base
|
||||
* @summary 更新文档
|
||||
* @param {string} libraryId 资料库 ID
|
||||
* @param {string} documentId 文档 ID
|
||||
* @param {string} title 标题
|
||||
* @param {string} content 内容
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
libraryLibraryIdDocumentDocumentIdPut(libraryId: string, documentId: string, options?: any): AxiosPromise<ModelDocument> {
|
||||
return localVarFp.libraryLibraryIdDocumentDocumentIdPut(libraryId, documentId, options).then((request) => request(axios, basePath));
|
||||
libraryLibraryIdDocumentDocumentIdPut(libraryId: string, documentId: string, title: string, content: string, options?: any): AxiosPromise<ModelDocument> {
|
||||
return localVarFp.libraryLibraryIdDocumentDocumentIdPut(libraryId, documentId, title, content, options).then((request) => request(axios, basePath));
|
||||
},
|
||||
/**
|
||||
* 获取当前账号的文档列表
|
||||
@ -689,12 +707,14 @@ export class DocumentsApi extends BaseAPI {
|
||||
* @summary 更新文档
|
||||
* @param {string} libraryId 资料库 ID
|
||||
* @param {string} documentId 文档 ID
|
||||
* @param {string} title 标题
|
||||
* @param {string} content 内容
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
* @memberof DocumentsApi
|
||||
*/
|
||||
public libraryLibraryIdDocumentDocumentIdPut(libraryId: string, documentId: string, options?: AxiosRequestConfig) {
|
||||
return DocumentsApiFp(this.configuration).libraryLibraryIdDocumentDocumentIdPut(libraryId, documentId, options).then((request) => request(this.axios, this.basePath));
|
||||
public libraryLibraryIdDocumentDocumentIdPut(libraryId: string, documentId: string, title: string, content: string, options?: AxiosRequestConfig) {
|
||||
return DocumentsApiFp(this.configuration).libraryLibraryIdDocumentDocumentIdPut(libraryId, documentId, title, content, options).then((request) => request(this.axios, this.basePath));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -57,7 +57,7 @@ import { document } from "@/plugins/api";
|
||||
import getTheme from "@/plugins/getTheme";
|
||||
import LoadingComponent from "@/components/Loading.vue";
|
||||
|
||||
const loading = ref(true)
|
||||
const loading = ref(true);
|
||||
const libraryIdInt = parseInt(router.currentRoute.value.params.LibraryId);
|
||||
const documentIdInt = parseInt(router.currentRoute.value.params.DocumentId);
|
||||
|
||||
@ -80,6 +80,15 @@ document
|
||||
const show_created_failed = ref(false);
|
||||
const show_title_is_not_filled = ref(false);
|
||||
|
||||
function goto_document() {
|
||||
router.push({
|
||||
name: "library.documents.view",
|
||||
params: {
|
||||
DocumentId: documentIdInt,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
function updateDocument() {
|
||||
if (docu.value.Title == "") {
|
||||
show_title_is_not_filled.value = true;
|
||||
@ -90,13 +99,11 @@ function updateDocument() {
|
||||
.libraryLibraryIdDocumentDocumentIdPut(
|
||||
libraryIdInt,
|
||||
documentIdInt,
|
||||
{
|
||||
Title: "a",
|
||||
Content: "a",
|
||||
}
|
||||
docu.value.Title,
|
||||
docu.value.Content
|
||||
)
|
||||
.then((r) => {
|
||||
console.log(r);
|
||||
goto_document()
|
||||
})
|
||||
.catch(() => {
|
||||
show_created_failed.value = true;
|
||||
|
Loading…
Reference in New Issue
Block a user