|
@@ -53,14 +53,14 @@ function downFile(blob, fileName) {
|
|
|
export default {
|
|
|
getJson: function (url, data, success, failed, err) {
|
|
|
let ProjectId = store.state.layout.projectId ? store.state.layout.projectId : localStorage.getItem("projectId");
|
|
|
- let userName = storage.get("user_name")
|
|
|
- let group_code = localStorage.getItem("group_code")
|
|
|
+ let userName = store.state.layout.userInfo.userName ? store.state.layout.userInfo.userName : storage.get("user_name");
|
|
|
+ let group_code = store.state.layout.group_code ? store.state.layout.group_code : localStorage.getItem("group_code");
|
|
|
let vm = this;
|
|
|
fetch({
|
|
|
url: url,
|
|
|
method: 'get',
|
|
|
params: data,
|
|
|
- headers: {'ProjectId': ProjectId, 'Comming': 'adm', 'Account': userName, 'group_code': group_code}
|
|
|
+ headers: {'projectId': ProjectId, 'appId': 'adm', 'userId': userName, 'groupCode': group_code}
|
|
|
}).then((response) => {
|
|
|
successResponse(vm, response, success, failed)
|
|
|
}).catch(error => {
|
|
@@ -69,15 +69,15 @@ export default {
|
|
|
},
|
|
|
postJson: function (url, data, success, failed, err) {
|
|
|
let ProjectId = store.state.layout.projectId ? store.state.layout.projectId : localStorage.getItem("projectId");
|
|
|
- let userName = storage.get("user_name")
|
|
|
- let group_code = localStorage.getItem("group_code")
|
|
|
+ let userName = store.state.layout.userInfo.userName ? store.state.layout.userInfo.userName : storage.get("user_name");
|
|
|
+ let group_code = store.state.layout.group_code ? store.state.layout.group_code : localStorage.getItem("group_code");
|
|
|
|
|
|
let vm = this;
|
|
|
fetch({
|
|
|
url: url,
|
|
|
method: 'post',
|
|
|
data: data,
|
|
|
- headers: {'ProjectId': ProjectId, 'Comming': 'adm', 'Account': userName, 'group_code': group_code}
|
|
|
+ headers: {'projectId': ProjectId, 'appId': 'adm', 'userId': userName, 'groupCode': group_code}
|
|
|
}).then((response) => {
|
|
|
successResponse(vm, response, success, failed)
|
|
|
}).catch(error => {
|