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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
(function(){
angular.module("app.home")
.controller("homeCtrl",["$scope","OptionService","UtilService","$interval","HttpService","$rootScope","ToolService","$interval",homeCtrl]);
function homeCtrl($scope,OptionService,UtilService,$interval,HttpService,$rootScope,ToolService,$interval){
//loading加载
$scope.showLoading = function(){
document.getElementById("sysLoad").style.display = "block";
}
$scope.hideLoading = function(){
document.getElementById("sysLoad").style.display = "none";
}
var Uuser = UtilService.getUser();
$scope.Homename = Uuser.email;
if($scope.Homename == undefined || $scope.Homename == null){
$scope.Homename = "";
}
$scope.HomeId = UtilService.getUser().id;
if($scope.HomeId == undefined || $scope.HomeId == null){
$scope.HomeId = "";
}
$scope.Logout = function(){
HttpService.logOutCookie();
window.location.href = "home.html";
}
$scope.goSet = function(){
UtilService.setCookie("ryioHome",true);
window.location.href = "index.html#/manage/userinfo";
}
$scope.HomeDemo = function(){
UtilService.setCookie("ryioDemoapk",'e31caee07ebedf8c172267e73204802f',7);
window.location.href = "demo.html";
}
$scope.channelMoreType = true;
$scope.clickMore = function(){
$scope.channelMoreType = false;
}
$scope.isSuper = UtilService.getCookie("ryioIsSuper")=='true' || UtilService.getCookie("ryioIsSuper")==true;
var ryioRole = Uuser.roleCategory;
if(ryioRole && ryioRole == 1){ //管理员
$scope.isManage = true;
}
$scope.companyMoreType = true;
$scope.companyMore = function(){
$scope.companyMoreType = false;
}
$scope.UserEmail= Uuser.email;
$scope.userNow = function(){
var status = Uuser.status;
var statusPM = HttpService.getInfo("reged/findbyemail?email="+$scope.UserEmail);
ToolService.showLoading();
statusPM.then(function(data){
ToolService.hideLoading();
if(data.status == 1){
if(data.appSize == 0 && data.isChannelPerson == true){
ToolService.showTips("没有控制权限");
$scope.time= 2000;
$one_minute = $interval(function(){
$scope.time -= 1000;
if($scope.time == 0){
window.location.href = "login.html";
}
},1000);
}else{
UUser.status = data.status;
UUser.pastDate = data.pastDate;
ToolService.setUser(UUser);
window.location.href = "index.html#/manage/app";
}
}else{
UUser.status = data.status;
UUser.pastDate = data.pastDate;
ToolService.setUser(UUser);
window.location.href = "index.html#/active/product";
}
});
}
$scope.goApp = function(){
window.location.href = "index.html#/manage/app";
}
}
})();