app.controller('licenseFormCtrl', ['$rootScope', '$scope', '$state', '$translate', '$localStorage', '$cookieStore', '$auth', '$window', '$document', '$timeout', '$filter', '$http', 'cfpLoadingBar', 'Restangular', 'api_login', 'SweetAlert', function($rootScope, $scope, $state, $translate, $localStorage, $cookieStore, $auth, $window, $document, $timeout, $filter, $http, cfpLoadingBar, Restangular, api_login, SweetAlert) { $scope.subLicensePass=function(){ var data={ "licenseCode":$scope.licensePass } api_login.license(data).then(function(res){ if(res.status==200){ SweetAlert.swal({ title: "恭喜您,激活成功!", type: "success", confirmButtonColor: "#007AFF" }, function() { $state.go('login.signin'); }); }else{ SweetAlert.swal({ title: "激活失败", text: "请输入正确的激活码!", type: "error", confirmButtonColor: "#DD6B55" }); } }) }; $scope.shiyong=false; $scope.featureCode=""; api_login.getLicense({}).then(function(res){ if(res.type==0){ $scope.shiyong=true; } $scope.featureCode=res.featureCode }) $scope.seeFeatureCode=false; $scope.cliUse=function(){ SweetAlert.swal({ title: "试用成功!", text: "请点击确定返回登录页重新输入账号密码!", type: "success", confirmButtonColor: "#007AFF" }, function() { $state.go('login.signin'); }); }; $scope.seeCode=function(){ $scope.seeFeatureCode=true }; } ]);