add author support
This commit is contained in:
1 parent
6df9472cf7
commit
a05249329e
5 files changed
+15
-8
No files matched your search
@@ -2,5 +2,6 @@ export default {
|
||||
setup: '配置',
|
||||
edit: '编辑',
|
||||
login: '登录',
|
||||
logout: '退出登录'
|
||||
logout: '退出登录',
|
||||
new: '新建'
|
||||
};
|
||||
@@ -17,6 +17,7 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-button @click="onCreate"> {{ $t('common.button.new') }}</el-button>
|
||||
</el-card>
|
||||
</div>
|
||||
</el-col>
|
||||
@@ -26,7 +27,7 @@
|
||||
<script lang="ts">
|
||||
import { Breadcrumb } from '@/components/common/index';
|
||||
import ArticleService from '@/services/content/article/service';
|
||||
import { IArticle, IArticleListResponse } from '@/services/content/article/types';
|
||||
import { IArticle, IArticleListResponse, IArticleDetailResponse } from '@/services/content/article/types';
|
||||
import { defineComponent } from 'vue';
|
||||
|
||||
interface IData {
|
||||
@@ -60,6 +61,11 @@ export default defineComponent({
|
||||
id: row.id
|
||||
}
|
||||
});
|
||||
},
|
||||
onCreate() {
|
||||
ArticleService.create({}).then(({ data: data }: { data: IArticleDetailResponse }): void => {
|
||||
console.log('data', data);
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -6,13 +6,13 @@ class WechatService {
|
||||
key = 'wechat';
|
||||
|
||||
async createQRCode4Login(): Promise<AxiosResponse<IWechatQRCodeResponse>> {
|
||||
return await httpClient.post(`/${this.key}/qrcode`, {
|
||||
return await httpClient.post(`/${this.key}/qrcode/`, {
|
||||
scene: 'login'
|
||||
});
|
||||
}
|
||||
|
||||
async getLoginStatus(ticket: string): Promise<AxiosResponse<IWechatLoginStatusResponse>> {
|
||||
return httpClient.post(`/${this.key}/auth`, {
|
||||
return httpClient.post(`/${this.key}/auth/`, {
|
||||
ticket: ticket
|
||||
});
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ class ArticleService {
|
||||
key = 'articles';
|
||||
|
||||
async getAll(): Promise<AxiosResponse<IArticleListResponse>> {
|
||||
return await httpClient.get(`/${this.key}`);
|
||||
return await httpClient.get(`/${this.key}/`);
|
||||
}
|
||||
|
||||
async get(id: string | string[]): Promise<AxiosResponse<IArticleDetailResponse>> {
|
||||
@@ -14,7 +14,7 @@ class ArticleService {
|
||||
}
|
||||
|
||||
async create(data: IArticle): Promise<AxiosResponse<IArticleDetailResponse>> {
|
||||
return httpClient.post(`/${this.key}`, data);
|
||||
return httpClient.post(`/${this.key}/`, data);
|
||||
}
|
||||
|
||||
async update(id: string | string[], data: IArticle): Promise<AxiosResponse<IArticleDetailResponse>> {
|
||||
|
||||
@@ -6,7 +6,7 @@ class PlatformService {
|
||||
key = 'platforms';
|
||||
|
||||
async getAll(): Promise<AxiosResponse<IPlatformListResponse>> {
|
||||
return await httpClient.get(`/${this.key}`);
|
||||
return await httpClient.get(`/${this.key}/`);
|
||||
}
|
||||
|
||||
async get(id: number): Promise<AxiosResponse<IPlatformDetailResponse>> {
|
||||
@@ -14,7 +14,7 @@ class PlatformService {
|
||||
}
|
||||
|
||||
async create(data: IPlatform): Promise<AxiosResponse<IPlatformDetailResponse>> {
|
||||
return await httpClient.post(`/${this.key}`, data);
|
||||
return await httpClient.post(`/${this.key}/`, data);
|
||||
}
|
||||
|
||||
async update(id: number, data: IPlatform): Promise<AxiosResponse<IPlatformDetailResponse>> {
|
||||
|
||||
Reference in new issue
Block a user