|
@@ -2,8 +2,6 @@ import { Message } from 'element-ui';
|
|
|
import fetch from './fetch'
|
|
|
import storage from '@/framework/utils/storage'
|
|
|
|
|
|
-let ProjectId = storage.get("global_project_selected")
|
|
|
-
|
|
|
function successResponse(vm, response, success, failed) {
|
|
|
let resp = response.data;
|
|
|
let result = resp.result ? resp.result : resp.Result;
|
|
@@ -35,16 +33,18 @@ function errorResponse(vm, response, err) {
|
|
|
|
|
|
export default {
|
|
|
getJson: function(url, data, success, failed, err) {
|
|
|
+ let ProjectId = storage.get("global_project_selected")
|
|
|
let vm = this;
|
|
|
- fetch({ url: url, method: 'get', params: data, headers: {'ProjectId': ProjectId}}).then((response) => {
|
|
|
+ fetch({ url: url, method: 'get', params: data, headers: { 'ProjectId': ProjectId } }).then((response) => {
|
|
|
successResponse(vm, response, success, failed)
|
|
|
}).catch(error => {
|
|
|
errorResponse(vm, error, err);
|
|
|
});
|
|
|
},
|
|
|
postJson: function(url, data, success, failed, err) {
|
|
|
+ let ProjectId = storage.get("global_project_selected")
|
|
|
let vm = this;
|
|
|
- fetch({ url: url, method: 'post', data: data, headers: {'ProjectId': ProjectId} }).then((response) => {
|
|
|
+ fetch({ url: url, method: 'post', data: data, headers: { 'ProjectId': ProjectId } }).then((response) => {
|
|
|
successResponse(vm, response, success, failed)
|
|
|
}).catch(error => {
|
|
|
errorResponse(vm, error, err);
|