Add config page (#49)
This commit is contained in:
1 parent
87e83f3432
commit
bf01192bd2
786 files changed
+30678
-24247
No files matched your search
@@ -1,10 +1,10 @@
|
||||
import store from '@/store';
|
||||
import { getBaseUrlData } from '@/utils';
|
||||
import { getBaseUrlPlatform } from '@/utils';
|
||||
import axios, { AxiosInstance } from 'axios';
|
||||
import qs from 'qs';
|
||||
|
||||
const httpClient: AxiosInstance = axios.create({
|
||||
baseURL: `${getBaseUrlData()}/api/v1`,
|
||||
baseURL: `${getBaseUrlPlatform()}/api/v1`,
|
||||
headers: {
|
||||
'Content-type': 'application/json',
|
||||
Accept: 'application/json'
|
||||
|
||||
@@ -12,3 +12,4 @@ export * from './auth';
|
||||
export * from './service';
|
||||
export * from './credential';
|
||||
export * from './qrart';
|
||||
export * from './site';
|
||||
@@ -0,0 +1,32 @@
|
||||
import { AxiosResponse } from 'axios';
|
||||
import { httpClient } from './common';
|
||||
import { ISite, ISiteDetailResponse } from '@/models';
|
||||
|
||||
export interface ISiteQuery {
|
||||
user_id?: string;
|
||||
package_id?: string;
|
||||
offset?: number;
|
||||
limit?: number;
|
||||
}
|
||||
|
||||
class SiteService {
|
||||
key = 'sites';
|
||||
|
||||
async initialize(data: ISite): Promise<AxiosResponse<ISiteDetailResponse>> {
|
||||
return await httpClient.post(`/${this.key}/initialize/`, data);
|
||||
}
|
||||
|
||||
async get(id: string): Promise<AxiosResponse<ISiteDetailResponse>> {
|
||||
return await httpClient.get(`/${this.key}/${id}`);
|
||||
}
|
||||
|
||||
async create(data: ISite): Promise<AxiosResponse<ISiteDetailResponse>> {
|
||||
return await httpClient.post(`/${this.key}/`, data);
|
||||
}
|
||||
|
||||
async update(id: string, data: ISite): Promise<AxiosResponse<ISiteDetailResponse>> {
|
||||
return await httpClient.put(`/${this.key}/${id}`, data);
|
||||
}
|
||||
}
|
||||
|
||||
export const siteOperator = new SiteService();
|
||||
Reference in new issue
Block a user