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
| (function(vc){
| vc.extends({
| data:{
| loginInfo:{
| username:'',
| passwd:'',
| errorInfo:''
| }
| },
| _initMethod:function(){
| vc.component.clearCacheData();
| },
| _initEvent:function(){
| vc.component.$on('errorInfoEvent',function(_errorInfo){
| vc.component.loginInfo.errorInfo = _errorInfo;
| console.log('errorInfoEvent 事件被监听',_errorInfo)
| });
|
| vc.component.$on('validate_code_component_param_change_event',function(params){
| for(var tmpAttr in params){
| vc.component.loginInfo[tmpAttr] = params[tmpAttr];
| }
| console.log('errorInfoEvent 事件被监听',params)
| });
| },
| methods:{
| clearCacheData:function(){
| vc.clearCacheData();
| },
| doLogin:function(){
| vc.http.post(
| 'login',
| 'doLogin',
| JSON.stringify(vc.component.loginInfo),
| {
| emulateJSON:true
| },
| function(json,res){
| //vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
| if(res.status == 200){
| vc.jumpToPage("/");
| return ;
| }
| vc.component.loginInfo.errorInfo = json;
| },
| function(errInfo,error){
| console.log('请求失败处理');
|
| vc.component.loginInfo.errorInfo = errInfo;
| });
|
| }
| },
| _destroyedMethod:function(){
| console.log("登录页面销毁调用");
| }
| });
|
|
| })(window.vc);
|
|