|
@@ -278,5 +278,44 @@
|
|
|
};
|
|
|
|
|
|
$loading.hide();
|
|
|
+
|
|
|
+ // 单点登录设置
|
|
|
+ $scope.toLogin = function () {
|
|
|
+ $http.get("../../api/oauth/getOAuthUrl", {}).then(function (res) {
|
|
|
+ if (res.data.success && res.data.item) {
|
|
|
+ window.location.href = res.data.item;
|
|
|
+ } else {
|
|
|
+ if (res.data.msg)
|
|
|
+ $scope.showMsg('提示', res.data.msg);
|
|
|
+ $state.go('login');
|
|
|
+ }
|
|
|
+ }, () => {
|
|
|
+ $state.go('login');
|
|
|
+ });
|
|
|
+ };
|
|
|
+ $scope.showMsg = function (title, content) {
|
|
|
+ $alert({
|
|
|
+ title: title + ':',
|
|
|
+ content: content,
|
|
|
+ placement: 'top',
|
|
|
+ type: 'info',
|
|
|
+ show: true,
|
|
|
+ duration: 5
|
|
|
+ });
|
|
|
+ };
|
|
|
+ //判断登录情况
|
|
|
+ if (AuthUser && AuthUser.getUser().Id && AuthUser.getUser().Id != 'null') {
|
|
|
+ $http.get("../../api/user/curloginuser", {params: {appkey: "appId"}}).then(function (res) {
|
|
|
+ if (res.data.success && res.data.item) {
|
|
|
+ $state.go('homeTabs');
|
|
|
+ } else {
|
|
|
+ $scope.toLogin();
|
|
|
+ }
|
|
|
+ }, () => {
|
|
|
+ $scope.toLogin();
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ $scope.toLogin();
|
|
|
+ }
|
|
|
}]);
|
|
|
})(angular, this);
|