吴学文 лет назад: 7
Родитель
Сommit
694cd35a4b

+ 3 - 2
WebService/src/main/java/com/java110/web/smo/impl/LoginServiceSMOImpl.java

@@ -81,7 +81,7 @@ public class LoginServiceSMOImpl extends BaseComponentSMO implements ILoginServi
             verifyCodeImage = new ResponseEntity<>(ValidateCodeFactory.outputImage(200, 80, verifyCode), HttpStatus.OK);
             verifyCodeImage = new ResponseEntity<>(ValidateCodeFactory.outputImage(200, 80, verifyCode), HttpStatus.OK);
 
 
             //将验证码存入Redis中
             //将验证码存入Redis中
-            CommonCache.setValue(pd.getSessionId()+"_validateCode",verifyCode,CommonCache.defaultExpireTime);
+            CommonCache.setValue(pd.getSessionId()+"_validateCode",verifyCode.toLowerCase(),CommonCache.defaultExpireTime);
 
 
         }catch (Exception e){
         }catch (Exception e){
             logger.error("生成验证码失败,",e);
             logger.error("生成验证码失败,",e);
@@ -103,9 +103,10 @@ public class LoginServiceSMOImpl extends BaseComponentSMO implements ILoginServi
 
 
         String code = CommonCache.getValue(pd.getSessionId()+"_validateCode");
         String code = CommonCache.getValue(pd.getSessionId()+"_validateCode");
 
 
-        if(JSONObject.parseObject(pd.getReqData()).getString("validateCode").equals(code)){
+        if(JSONObject.parseObject(pd.getReqData()).getString("validateCode").toLowerCase().equals(code)){
             verifyResult = new ResponseEntity<>("成功", HttpStatus.OK);
             verifyResult = new ResponseEntity<>("成功", HttpStatus.OK);
         }else{
         }else{
+            pd.setToken("");
             verifyResult = new ResponseEntity<>("验证码错误", HttpStatus.INTERNAL_SERVER_ERROR);
             verifyResult = new ResponseEntity<>("验证码错误", HttpStatus.INTERNAL_SERVER_ERROR);
         }
         }
 
 

+ 1 - 1
WebService/src/main/resources/components/login/login.js

@@ -25,7 +25,7 @@
         },
         },
         methods:{
         methods:{
             doLogin(){
             doLogin(){
-                vc.http.call(
+                vc.http.post(
                             'login',
                             'login',
                             'doLogin',
                             'doLogin',
                             JSON.stringify(vc.component.loginInfo),
                             JSON.stringify(vc.component.loginInfo),

+ 7 - 6
WebService/src/main/resources/components/menu/menu.js

@@ -13,17 +13,18 @@
        methods:{
        methods:{
            getMenus:function(){
            getMenus:function(){
                var param = {
                var param = {
-                   msg:this.message
+                    params:{
+                        msg:this.message
+                    }
+
                }
                }
                //发送get请求
                //发送get请求
-               vc.http.call('menu',
+               vc.http.get('menu',
                             'getMenus',
                             'getMenus',
                              param,
                              param,
-                             {
-                                emulateJSON:true
-                             },function(json){
+                             function(json,res){
                                 vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
                                 vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
-                             },function(){
+                             },function(errInfo,error){
                                 console.log('请求失败处理');
                                 console.log('请求失败处理');
                              }
                              }
                            );
                            );

+ 2 - 4
WebService/src/main/resources/components/nav/nav.js

@@ -17,12 +17,10 @@
                 };
                 };
 
 
                 //发送get请求
                 //发送get请求
-               vc.http.call('nav',
+               vc.http.get('nav',
                             'getNavData',
                             'getNavData',
                              param,
                              param,
-                             {
-                                emulateJSON:true
-                             },function(json){
+                             function(json){
                                 vm.nav = JSON.parse(json);
                                 vm.nav = JSON.parse(json);
                              },function(){
                              },function(){
                                 console.log('请求失败处理');
                                 console.log('请求失败处理');

+ 2 - 4
WebService/src/main/resources/components/test/vue_test.js

@@ -14,12 +14,10 @@
                            msg:this.message
                            msg:this.message
                        }
                        }
                        //发送get请求
                        //发送get请求
-                       vc.http.call('vue_test',
+                       vc.http.get('vue_test',
                                        'getTestVersion',
                                        'getTestVersion',
                                        param,
                                        param,
-                                       {
-                                           emulateJSON:true
-                                       },function(json){
+                                       function(json){
                                            vm.version = json;
                                            vm.version = json;
                                        },function(){
                                        },function(){
                                            console.log('请求失败处理');
                                            console.log('请求失败处理');

+ 9 - 7
WebService/src/main/resources/components/validate_code/validate-code.js

@@ -2,9 +2,10 @@
     vc.extends({
     vc.extends({
             data:{
             data:{
                validateCode:'',
                validateCode:'',
-               codeImage:'/callComponent/validate-code/generateValidateCode',
+               codeImage:'',
             },
             },
             _initMethod:function(){
             _initMethod:function(){
+                console.log("validate-code _initMethod 方法调用");
                  vc.component.generateCode();
                  vc.component.generateCode();
 
 
             },
             },
@@ -22,12 +23,13 @@
             methods:{
             methods:{
                 generateCode(){
                 generateCode(){
                     var param = {
                     var param = {
-                        _uId:'123'
-                    }
-                    vc.http.call('validate-code','generateValidateCode',param,
-                                {
-                                    emulateJSON:true
-                                 },
+                        params:{
+                            _uId:'123'
+                        }
+                    };
+                    console.log("validate-code generateCode",param);
+                    vc.http.get('validate-code','generateValidateCode',
+                                 param,
                                  function(json,res){
                                  function(json,res){
                                     //vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
                                     //vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
                                     if(res.status == 200){
                                     if(res.status == 200){

+ 10 - 3
WebService/src/main/resources/static/js/core.js

@@ -41,15 +41,22 @@
 **/
 **/
 (function(vc){
 (function(vc){
     vc.http = {
     vc.http = {
-        call:function(componentCode,componentMethod,param,options,successCallback,errorCallback){
-        console.log(successCallback);
+        post:function(componentCode,componentMethod,param,options,successCallback,errorCallback){
                 Vue.http.post('/callComponent/'+componentCode +"/"+componentMethod, param, options)
                 Vue.http.post('/callComponent/'+componentCode +"/"+componentMethod, param, options)
                 .then(function(res){
                 .then(function(res){
                     successCallback(res.bodyText,res);
                     successCallback(res.bodyText,res);
                 }, function(error){
                 }, function(error){
                     errorCallback(error.bodyText,error);
                     errorCallback(error.bodyText,error);
                 });
                 });
-            }
+        },
+        get:function(componentCode,componentMethod,param,successCallback,errorCallback){
+                Vue.http.get('/callComponent/'+componentCode +"/"+componentMethod, param)
+                .then(function(res){
+                    successCallback(res.bodyText,res);
+                }, function(error){
+                    errorCallback(error.bodyText,error);
+                });
+        }
 
 
     };
     };
 
 

Разница между файлами не показана из-за своего большого размера
+ 11912 - 0
WebService/src/main/resources/static/js/vue/vue.js


+ 4 - 0
WebService/src/main/resources/views/index.html

@@ -18,6 +18,10 @@
             <vc:create name="nav"></vc:create>
             <vc:create name="nav"></vc:create>
         </div>
         </div>
 
 
+        <div id="component">
+
+        </div>
+
 
 
         <vc:create name="copyright"></vc:create>
         <vc:create name="copyright"></vc:create>