OWL ITS + 탐지시스템(인터넷 진흥원)
wyu
2022-01-06 2f24bfe3555d921b9a525cca682635688ece1fc5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/**
 * Created by wisestone on 2018-04-02.
 */
'use strict';
 
define([
        'app',
        'angular'
    ],
    function (app) {
        app.controller('userPasswordController', ['$scope', '$rootScope', '$log', '$resourceProvider', 'User', '$uibModalInstance', 'SweetAlert', '$filter',
            function ($scope, $rootScope, $log, $resourceProvider, User, $uibModalInstance, SweetAlert, $filter) {
 
                $scope.fn = {
                    cancel : cancel,    //  팝업창 닫기
                    formCheck : formCheck,  //  폼 체크
                    formSubmit : formSubmit //  폼 전송
                };
 
                $scope.vm = {
                    form : {
                        account : ""
                    }
                };
 
                //  폼 체크
                function formCheck(formInvalid) {
                    if (formInvalid) {
                        return true;
                    }
 
                    return false;
                }
 
                //  폼 전송
                function formSubmit() {
                    $rootScope.spinner = true;
 
                    var content = {
                        account : $rootScope.encryption($scope.vm.form.account)
                    };
 
                    User.returnEmailPassword($resourceProvider.getContent(
                        content,
                        $resourceProvider.getPageContent(0, 10))).then(function (result) {
 
                        if (result.data.message.status === "success") {
                            SweetAlert.success($filter("translate")("users.temporaryPasswordIssue"), result.data.message.message); // "임시 비밀번호 발급"
                            $scope.fn.cancel();
                        }
                        else {
                            SweetAlert.error($filter("translate")("users.failedRequestFindPassword"), result.data.message.message); // "비밀번호 찾기 요청 실패"
                        }
 
                        $rootScope.spinner = false;
                    });
                }
 
                function cancel() {
                    $rootScope.$broadcast("closeLayer");    //  팝업이 열리고 나서 js-multi, js-single 등에서 body 이벤트가 날아가는 현상 수정
                    $uibModalInstance.dismiss('cancel');
                    $(document).unbind("keydown");  //  단축키 이벤트 제거
                }
 
            }]);
    });