starter.controller('AuthUserCtrl', function ($scope, $state, $ionicSlideBoxDelegate, $rootScope, $ionicHistory, $window, showPopup, global, User) { global.fetch_user().then(function (data) { $scope.authuser = {"imid": global.user.im_usrid}; $scope.title = global.user.compname; }); $scope.commit = function () { showPopup.showLoading(1, '正在提交', false); User.user("PostUser").save("'" + JSON.stringify($scope.authuser) + "'", function (res) { console.log(res); showPopup.hideLoading(); }, function (err) { if (err.status == 400) showPopup.PopupWindow(0, err.data.ExceptionMessage, false, 4000); else showPopup.hideLoading(); }) } })