fixed headers issues of offline meter file and knowledge file in admin UI

pull/19/MERGE
13621160019@163.com 2021-03-17 11:32:20 +08:00
parent 65a18aff97
commit b99d251e4c
3 changed files with 25 additions and 5 deletions

View File

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

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 = {