fixed http headers issues of offlinemeterfile, knowledgefile and costfile in admin UI

Merge branch 'develop'
pull/35/head^2
13621160019@163.com 2021-03-17 11:35:29 +08:00
commit 182cbeaddb
4 changed files with 38 additions and 7 deletions

View File

@ -7,7 +7,6 @@ app.controller('LoginController', function ($rootScope,
$window,
$common,
$uibModal,
$cookies,
$scope,
$interval,
LoginService,

View File

@ -1,6 +1,17 @@
'use strict';
app.controller('CostFileController', function ($scope, $common, $cookies, $translate, $uibModal, $interval, CostFileService, toaster, SweetAlert) {
app.controller('CostFileController', function (
$scope,
$window,
$common,
$translate,
$uibModal,
$interval,
CostFileService,
toaster,
SweetAlert) {
$scope.cur_user = JSON.parse($window.localStorage.getItem("currentUser"));
$scope.getAllCostFiles = function () {
CostFileService.getAllCostFiles(function (error, data) {
@ -18,7 +29,7 @@ app.controller('CostFileController', function ($scope, $common, $cookies, $trans
acceptedFiles: '.xlsx',
dictDefaultMessage: 'Click(or Drop) to add files',
maxFilesize: '100',
headers: { "User-UUID": $cookies.get("user_uuid"), "Token": $cookies.get("token") }
headers: { "User-UUID": $scope.cur_user.uuid, "Token": $scope.cur_user.token }
};
$scope.dzCallbacks = {

View File

@ -1,6 +1,16 @@
'use strict';
app.controller('KnowledgeFileController', function ($scope, $common, $cookies, $translate, $uibModal, KnowledgeFileService, toaster, SweetAlert) {
app.controller('KnowledgeFileController', function (
$scope,
$window,
$common,
$translate,
$uibModal,
KnowledgeFileService,
toaster,
SweetAlert) {
$scope.cur_user = JSON.parse($window.localStorage.getItem("currentUser"));
$scope.getAllKnowledgeFiles = function () {
KnowledgeFileService.getAllKnowledgeFiles(function (error, data) {
@ -18,7 +28,7 @@ app.controller('KnowledgeFileController', function ($scope, $common, $cookies, $
acceptedFiles: '.xlsx,.xls,.pdf,.docx,.doc,.dwg,.jpg,.png,.csv',
dictDefaultMessage: 'Click(or Drop) to add files',
maxFilesize: '100',
headers: { "User-UUID": $cookies.get("user_uuid"), "Token": $cookies.get("token") }
headers: { "User-UUID": $scope.cur_user.uuid, "Token": $scope.cur_user.token }
};
$scope.dzCallbacks = {

View File

@ -1,6 +1,17 @@
'use strict';
app.controller('OfflineMeterFileController', function($scope, $common, $cookies, $translate,$uibModal,$interval, OfflineMeterFileService, toaster, SweetAlert) {
app.controller('OfflineMeterFileController', function(
$scope,
$window,
$common,
$translate,
$uibModal,
$interval,
OfflineMeterFileService,
toaster,
SweetAlert) {
$scope.cur_user = JSON.parse($window.localStorage.getItem("currentUser"));
$scope.getAllOfflineMeterFiles = function() {
OfflineMeterFileService.getAllOfflineMeterFiles(function(error, data) {
@ -18,7 +29,7 @@ app.controller('OfflineMeterFileController', function($scope, $common, $cookies
acceptedFiles: '.xlsx',
dictDefaultMessage: 'Click(or Drop) to add files',
maxFilesize: '100',
headers: { "User-UUID": $cookies.get("user_uuid"), "Token": $cookies.get("token") }
headers: { "User-UUID": $scope.cur_user.uuid, "Token": $scope.cur_user.token }
};
$scope.dzCallbacks = {