|
@@ -246,7 +246,7 @@
|
|
|
});
|
|
|
};
|
|
|
$loading.hide();
|
|
|
- }]).controller("loginECtrl", ['$scope', '$state', '$http', '$loading', '$alert', '$desData', 'AuthUser', function ($scope, $state, $http, $loading, $alert, $desData, AuthUser) {
|
|
|
+ }]).controller("loginECtrl", ['$scope', '$state', '$http', '$loading', '$alert', '$desData', 'AuthUser', '$bsRouterState', function ($scope, $state, $http, $loading, $alert, $desData, AuthUser, $bsRouterState) {
|
|
|
$scope.loginuser = {uid: '', pwd: ''};
|
|
|
$scope.sysName = window.sysCompanyName;
|
|
|
|
|
@@ -255,22 +255,69 @@
|
|
|
$scope.loginuser.pwd = '';
|
|
|
};
|
|
|
|
|
|
- $scope.login = function () {
|
|
|
+ //站点ID
|
|
|
+ $scope.menudatas = {
|
|
|
+ appkey: "appId",
|
|
|
+ defrolekey: "DefaultRoleId",
|
|
|
+ getMenuUrl: '../../api/user/getmenubyuid',
|
|
|
+ toggle: true
|
|
|
+ };
|
|
|
+
|
|
|
+ $scope.userOnlineActivityFun = function () {
|
|
|
+ //判断是否已经退出登陆
|
|
|
+ if ($scope.userOnlineIsOut) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (AuthUser.getUser().Id) {
|
|
|
+ $http.post("../../api/home/setOnlineUser", {
|
|
|
+ uid: AuthUser.getUser().Id
|
|
|
+ }).then(function (res) {
|
|
|
+ if (res.data.success) {
|
|
|
+ $timeout($scope.userOnlineActivityFun, 60 * 1000);
|
|
|
+ } else {
|
|
|
+ $scope.loginOutCookie();
|
|
|
+ }
|
|
|
|
|
|
+ });
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ $scope.login = async function () {
|
|
|
var tk = $scope.loginuser.uid + '|' + $scope.loginuser.pwd;
|
|
|
$loading.show();
|
|
|
AuthUser.clearUser();
|
|
|
- $http.post('../../api/home/locallogin', $desData.GetToken(tk)).then(function (req) {
|
|
|
+ await $http.post('../../api/home/locallogin', $desData.GetToken(tk)).then(function (req) {
|
|
|
$loading.hide();
|
|
|
if (req.data.success) {
|
|
|
- window.location.href = '../main/index-kbdsj.html#!/kb/showDjdsj';
|
|
|
+ $http.get("../../api/user/curloginuser", {params: {appkey: $scope.menudatas.appkey}}).then(function (res) {
|
|
|
+ if (res.data.success) {
|
|
|
+ if (res.data.item) {
|
|
|
+ angular.extend(res.data.item, {gddwdm: res.data.extdata.gddwdm});
|
|
|
+ angular.extend(res.data.item, {userType: res.data.extdata.userType});
|
|
|
+ angular.extend(res.data.item, {dwId: res.data.extdata.dwId});
|
|
|
+ angular.extend(res.data.item, {dwName: res.data.extdata.dwName});
|
|
|
+ angular.extend(res.data.item, {oaUserId: res.data.extdata.oaUserId});
|
|
|
+ angular.extend(res.data.item, {oaIdCard: res.data.extdata.oaIdCard});
|
|
|
+ angular.extend(res.data.item, {generalPartyCode: res.data.extdata.generalPartyCode});
|
|
|
+
|
|
|
+ $bsRouterState.loadTabMenu();
|
|
|
+ AuthUser.clearExtData();
|
|
|
+ $scope.User = res.data.item;
|
|
|
+ $scope.User.isServerMan = res.data.extdata != null ? res.data.extdata.isServerMan : false;
|
|
|
+ AuthUser.setUser($scope.User);
|
|
|
+ //开始心跳查询是否超时
|
|
|
+ $scope.userOnlineActivityFun();
|
|
|
+
|
|
|
+ window.location.href = '../main/index-kbdsj.html#!/kb/showDjdsj';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
} else {
|
|
|
$scope.errorMsg = req.data.msg;
|
|
|
}
|
|
|
}, function (reason) {
|
|
|
$loading.hide();
|
|
|
});
|
|
|
-
|
|
|
};
|
|
|
|
|
|
$scope.apply = function () {
|