parent
f2c43ebaf1
commit
ac32a232e9
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"/js/vue/Authentication/app.js": "/js/vue/Authentication/app.js?id=e11c94b631fa8e23411d",
|
"/js/vue/Authentication/app.js": "/js/vue/Authentication/app.js?id=ada36e14123738cce4a1",
|
||||||
"/js/vue/Home/app.js": "/js/vue/Home/app.js?id=8a41fb4476589b3a6cff",
|
"/js/vue/Home/app.js": "/js/vue/Home/app.js?id=4389447314d810908e49",
|
||||||
"/js/vue/Modules/CRM/app.js": "/js/vue/Modules/CRM/app.js?id=26118082661767a7bdc6",
|
"/js/vue/Modules/CRM/app.js": "/js/vue/Modules/CRM/app.js?id=24bffeddf17eab24a833",
|
||||||
"/js/vue/User/app.js": "/js/vue/User/app.js?id=4d34a4ac917830fbaa36"
|
"/js/vue/User/app.js": "/js/vue/User/app.js?id=32e40e7920eba25a4bb2"
|
||||||
}
|
}
|
||||||
|
@ -1,7 +0,0 @@
|
|||||||
export default class apiHandler {
|
|
||||||
|
|
||||||
request(apiMethod) {
|
|
||||||
return apiMethod.Handle();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -1,18 +0,0 @@
|
|||||||
import { ApolloClient } from 'apollo-client'
|
|
||||||
import { HttpLink } from 'apollo-link-http'
|
|
||||||
import { InMemoryCache } from 'apollo-cache-inmemory'
|
|
||||||
import VueApollo from 'vue-apollo'
|
|
||||||
|
|
||||||
const httpLink = new HttpLink({
|
|
||||||
// URL to graphql server, you should use an absolute URL here
|
|
||||||
uri: '/graphql'
|
|
||||||
})
|
|
||||||
|
|
||||||
// create the apollo client
|
|
||||||
const apolloClient = new ApolloClient({
|
|
||||||
link: httpLink,
|
|
||||||
cache: new InMemoryCache()
|
|
||||||
})
|
|
||||||
|
|
||||||
// install the vue plugin
|
|
||||||
Vue.use(VueApollo)
|
|
@ -1,7 +0,0 @@
|
|||||||
export default class apiFactory {
|
|
||||||
|
|
||||||
Handle() {
|
|
||||||
return this.init();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -0,0 +1,7 @@
|
|||||||
|
import ApolloClient from 'apollo-boost'
|
||||||
|
import { InMemoryCache } from "apollo-cache-inmemory";
|
||||||
|
|
||||||
|
export default new ApolloClient({
|
||||||
|
uri: '/graphql',
|
||||||
|
cache: new InMemoryCache()
|
||||||
|
});
|
@ -1,18 +1,19 @@
|
|||||||
import apiFactory from "../apiFactory";
|
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
|
|
||||||
export default class axiosApi extends apiFactory {
|
export default class axiosApi {
|
||||||
|
|
||||||
constructor(urlObj) {
|
constructor(urlObj) {
|
||||||
super();
|
|
||||||
this.staticMethods = ["get", "post", "put", "delete"];
|
this.staticMethods = ["get", "post", "put", "delete"];
|
||||||
|
this.baseURL = '/';
|
||||||
|
|
||||||
this.method = urlObj.method;
|
this.method = urlObj.method;
|
||||||
this.url = urlObj.url;
|
this.url = urlObj.url;
|
||||||
this.data = urlObj.data;
|
this.data = urlObj.data;
|
||||||
}
|
}
|
||||||
|
|
||||||
init() {
|
init() {
|
||||||
|
axios.defaults.baseURL = this.baseURL;
|
||||||
|
|
||||||
if (this.checkMethod()) {
|
if (this.checkMethod()) {
|
||||||
return this[this.method]();
|
return this[this.method]();
|
||||||
}
|
}
|
Loading…
Reference in new issue