UNPKG

mobileoa-common-modules

Version:

移动办公平台前端公共功能模块

43 lines (33 loc) 1.17 kB
'use strict'; var angular = require('angular'); require('../modules'); require('../services/GesturePasswordService'); var module = angular.module('gesturepassword.controller'); module.controller('configGesturePasswordController', function($scope, GesturePasswordService, $state, appFlowConfigService) { $scope.configChange = configChange; $scope.setGesturePassword = setGesturePassword; init(); function init() { $scope.config = { start: appFlowConfigService.needGesturePassword() }; } function configChange() { var value = $scope.config.start; if (value === false) { appFlowConfigService.setNeedGesturePassword(value); GesturePasswordService.clear(); } else if (value === true) { setGesturePassword(); } } function setGesturePassword() { GesturePasswordService.transferGesturePassword().then(function(gesturePassword) { if (gesturePassword) { $state.go('gesturepassword.modifyGesturepassword'); } else { $state.go('gesturepassword.setGesturePwd2CanBack'); } }); } });