forked from mrwill84/DOClever
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadmin.js
More file actions
executable file
·111 lines (103 loc) · 2.62 KB
/
admin.js
File metadata and controls
executable file
·111 lines (103 loc) · 2.62 KB
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
var mainNav=require("./component/mainNav.vue")
var user=require("./component/user.vue")
var project=require("./component/project.vue")
var team=require("./component/team.vue")
var inter=require("./component/interface.vue")
var setting=require("./component/setting.vue")
var statistic=require("./component/statistic.vue")
var store=require("./store")
if(!sessionStorage.getItem("admin"))
{
location.href="/"
}
var vue=new Vue({
el: "#app",
data: {
tab:"user"
},
components:{
"mainnav":mainNav,
"project":project,
"team":team,
"user":user,
"interface":inter,
"setting":setting,
"statistic":statistic
},
store:store,
methods:{
},
created:function () {
var _this=this;
Promise.all([
net.get("/admin/userstatistics"),
net.get("/admin/projectstatistics"),
net.get("/admin/teamstatistics"),
net.get("/admin/interfacestatistics"),
net.get("/admin/setting")
]).then(function (data) {
var obj1=data[0];
var obj2=data[1];
var obj3=data[2];
var obj4=data[3];
var obj5=data[4];
if(obj1.code==200)
{
store.commit("setUserInfo",obj1.data)
}
else
{
throw obj1.msg;
}
if(obj2.code==200)
{
store.commit("setProjectInfo",obj2.data)
}
else
{
throw obj2.msg;
}
if(obj3.code==200)
{
store.commit("setTeamInfo",obj3.data)
}
else
{
throw obj3.msg;
}
if(obj4.code==200)
{
store.commit("setInterfaceInfo",obj4.data)
}
else
{
throw obj4.msg;
}
if(obj5.code==200)
{
store.commit("setSettingInfo",obj5.data)
}
else
{
throw obj5.msg;
}
$.stopLoading();
}).catch(function (err) {
$.stopLoading();
if(typeof(err)=="string")
{
$.notify(err,0);
}
else
{
$.notify("获取失败",0);
}
})
}
})
$.ready(function () {
$.startLoading();
})
if (module.hot) {
module.hot.accept();
}