yuliang преди 5 години
родител
ревизия
1f28bbd86b

+ 1 - 1
whepi-doc/whepi.sql

@@ -20,7 +20,7 @@ create table tb_user
   place_id            BIGINT          not null default 0   comment '场地id',
   version             CHAR(19)        not null             comment 'token版本',
   login_count         INTEGER         not null default '0' comment '登录次数',
-  last_login_time     TIMESTAMP NOT NULL COMMENT '最后登录时间',
+  last_login_time     TIMESTAMP       NOT NULL             COMMENT '最后登录时间',
 
   be_active           CHAR(1)         not null default 'Y' comment '是否活动 Y=活动/N=禁用/D=删除',
   create_at TIMESTAMP NOT NULL COMMENT '建立时间',

+ 17 - 17
whepi-ui/templates/admin/head.ftl

@@ -227,23 +227,23 @@
         if (passwordDate.password && passwordDate.newPassword && passwordDate.newPassword.length<=20) {
 
             if (passwordDate.newPassword === passwordDate.repeatPassword) {
-                $.ajax({
-                    url:'/user/reset_password.json',
-                    contentType: "application/json; charset=utf-8",
-                    type:'post',
-                    data:JSON.stringify(passwordDate),
-                    success: function (data) {
-                        if (data.success) {
-                            layer.msg(data.msg);
-                            window.location.replace('/user/login.html');
-                        } else {
-                            layer.msg(data.msg);
-                        }
-                    },
-                    error: function () {
-                        layer.msg("网络异常");
-                    }
-                });
+                // $.ajax({
+                //     url:'/user/reset_password.json',
+                //     contentType: "application/json; charset=utf-8",
+                //     type:'post',
+                //     data:JSON.stringify(passwordDate),
+                //     success: function (data) {
+                //         if (data.success) {
+                //             layer.msg(data.msg);
+                //             window.location.replace('/user/login.html');
+                //         } else {
+                //             layer.msg(data.msg);
+                //         }
+                //     },
+                //     error: function () {
+                //         layer.msg("网络异常");
+                //     }
+                // });
 
             }else{
                 $.alert('两次密码不相等');

+ 187 - 187
whepi-ui/templates/admin/user.ftl

@@ -157,24 +157,24 @@
     }
 
     function openIdDelete(userId) {
-        $.ajax({
-            url: '/admin/deleteOpenId.json',
-            data: { userId: userId },
-            type: 'post',
-            success: function (data) {
-                if (data.success) {
-                    layer.msg("删除成功");
-                    initTable();
-                    $('#myModal').modal('toggle');
-
-                } else {
-                    layer.msg(data.msg);
-                }
-            },
-            error: function () {
-                layer.msg("网络异常");
-            }
-        });
+        // $.ajax({
+        //     url: '/admin/deleteOpenId.json',
+        //     data: { userId: userId },
+        //     type: 'post',
+        //     success: function (data) {
+        //         if (data.success) {
+        //             layer.msg("删除成功");
+        //             initTable();
+        //             $('#myModal').modal('toggle');
+        //
+        //         } else {
+        //             layer.msg(data.msg);
+        //         }
+        //     },
+        //     error: function () {
+        //         layer.msg("网络异常");
+        //     }
+        // });
     }
 
     function userBind() {
@@ -184,17 +184,17 @@
     }
 
     function choosedPlace() {
-        var data = $('#bindModal').find('form').formGet();
-        top.layer.open({
-            type: 2,
-            title: '绑定二维码',
-            shadeClose: false,
-            resize: true,
-            anim: 0,
-            skin: 'layer-class',
-            area: ['264px', '308px'],
-            content: '/admin/user_bind_qr_png?placeId=' + data.placeId1
-        });
+        // var data = $('#bindModal').find('form').formGet();
+        // top.layer.open({
+        //     type: 2,
+        //     title: '绑定二维码',
+        //     shadeClose: false,
+        //     resize: true,
+        //     anim: 0,
+        //     skin: 'layer-class',
+        //     area: ['264px', '308px'],
+        //     content: '/admin/user_bind_qr_png?placeId=' + data.placeId1
+        // });
     }
 
     function saveForm() {
@@ -224,25 +224,25 @@
             url = '/admin/user_addnew.json';
         }
 
-        $.ajax({
-            url: url,
-            contentType: "application/json; charset=utf-8",
-            data: JSON.stringify(data),
-            type: 'post',
-            success: function (data) {
-                if (data.success) {
-                    layer.msg("保存成功");
-                    initTable();
-                    $('#myModal').modal('toggle');
-
-                } else {
-                    layer.msg(data.msg);
-                }
-            },
-            error: function () {
-                layer.msg("网络异常");
-            }
-        });
+        // $.ajax({
+        //     url: url,
+        //     contentType: "application/json; charset=utf-8",
+        //     data: JSON.stringify(data),
+        //     type: 'post',
+        //     success: function (data) {
+        //         if (data.success) {
+        //             layer.msg("保存成功");
+        //             initTable();
+        //             $('#myModal').modal('toggle');
+        //
+        //         } else {
+        //             layer.msg(data.msg);
+        //         }
+        //     },
+        //     error: function () {
+        //         layer.msg("网络异常");
+        //     }
+        // });
     }
 
     function userEdit(row) {
@@ -265,154 +265,154 @@
                 data.beActive = 'Y';
             }
 
-            $.ajax({
-                url: '/admin/user_edit.json',
-                contentType: "application/json; charset=utf-8",
-                data: JSON.stringify(data),
-                type: 'post',
-                success: function (data) {
-                    if (data.success) {
-                        if (row.beActive === 'Y') {
-                            layer.msg('已启用当前角色');
-                        } else if (row.beActive === 'N') {
-                            layer.msg('已禁用当前角色');
-                        }
-                        initTable();
-
-                    } else {
-                        layer.msg(data.msg);
-                    }
-                },
-                error: function () {
-                    layer.msg("网络异常");
-                }
-            });
+            // $.ajax({
+            //     url: '/admin/user_edit.json',
+            //     contentType: "application/json; charset=utf-8",
+            //     data: JSON.stringify(data),
+            //     type: 'post',
+            //     success: function (data) {
+            //         if (data.success) {
+            //             if (row.beActive === 'Y') {
+            //                 layer.msg('已启用当前角色');
+            //             } else if (row.beActive === 'N') {
+            //                 layer.msg('已禁用当前角色');
+            //             }
+            //             initTable();
+            //
+            //         } else {
+            //             layer.msg(data.msg);
+            //         }
+            //     },
+            //     error: function () {
+            //         layer.msg("网络异常");
+            //     }
+            // });
 
         }
 
     }
 
     function initTable() {
-        $('#thetable').bootstrapTable('destroy').bootstrapTable({
-            url: '/admin/user.json',
-            method: 'get',
-            queryParams: function (params) {
-                $('#theform').serializeArray().forEach(function fn(v) {
-                    params[v.name] = v.value;
-                });
-                return params;
-            },
-            responseHandler: responseHandler,
-            idField: 'user_id',
-            exportDataType: 'all',
-            exportTypes: ['txt', 'excel'],
-            dataShowExport: true,
-            search: false,
-            sortStable: false,
-            sidePagination: 'server',
-            pagination: true,
-            columns: [
-                {
-                    field: 'userId',
-                    title: '操作',
-                    width: '50px',
-                    formatter: function (v, row) {
-                        row.sense_id = 'select';
-                        var ts = [];
-                        if (row.userType === 'A' || row.userType === 'C') {
-                            ts.push('<button class="btn btn-sm btn-default" onclick=\'userEdit(' + JSON.stringify(row) + ')\'>编辑</button>');
-
-                        } else {
-                            ts.push('<button class="btn btn-sm btn-dark" onclick="openIdDelete(\'' + row.userId + '\')">删除</button>');
-                        }
-                        return ts.join('\n');
-                    }
-                }, {
-                    field: 'loginName',
-                    title: '登录名'
-                }, {
-                    field: 'staffName',
-                    title: '员工姓名'
-                }, {
-                    field: 'phone',
-                    title: '手机'
-                }, {
-                    field: 'placeName',
-                    title: '场地名称'
-                }, {
-                    field: 'userType',
-                    title: '角色',
-                    formatter: function (v, row) {
-                        if (v === 'A') {
-                            return '管理员';
-                        } else if (v === 'C') {
-                            return '收银员';
-                        } else if (v === '1') {
-                            return '一级分销';
-                        } else if (v === '2') {
-                            return '二级分销';
-                        }
-                        return v;
-                    }
-                }, {
-                    field: 'beActive',
-                    title: '状态',
-                    formatter: function (v, row) {
-                        var ts = [];
-                        if (row.userType === 'A' || row.userType === 'C') {
-                            if (row.beActive === 'Y') {
-                                ts.push('<button class="btn btn-sm btn-default" onclick=\'userDisable(' + JSON.stringify(row) + ')\'>启用中</button>');
-                            } else if (row.beActive === 'N') {
-                                ts.push('<button class="btn btn-sm btn-dark" onclick=\'userDisable(' + JSON.stringify(row) + ')\'>已禁用</button>');
-                            }
-                            return ts.join('\n');
-                        }
-                        return '启用中';
-                    }
-                }, {
-                    field: 'loginCount',
-                    title: '登录次数'
-                }
-            ]
-        });
+        // $('#thetable').bootstrapTable('destroy').bootstrapTable({
+        //     url: '/admin/user.json',
+        //     method: 'get',
+        //     queryParams: function (params) {
+        //         $('#theform').serializeArray().forEach(function fn(v) {
+        //             params[v.name] = v.value;
+        //         });
+        //         return params;
+        //     },
+        //     responseHandler: responseHandler,
+        //     idField: 'user_id',
+        //     exportDataType: 'all',
+        //     exportTypes: ['txt', 'excel'],
+        //     dataShowExport: true,
+        //     search: false,
+        //     sortStable: false,
+        //     sidePagination: 'server',
+        //     pagination: true,
+        //     columns: [
+        //         {
+        //             field: 'userId',
+        //             title: '操作',
+        //             width: '50px',
+        //             formatter: function (v, row) {
+        //                 row.sense_id = 'select';
+        //                 var ts = [];
+        //                 if (row.userType === 'A' || row.userType === 'C') {
+        //                     ts.push('<button class="btn btn-sm btn-default" onclick=\'userEdit(' + JSON.stringify(row) + ')\'>编辑</button>');
+        //
+        //                 } else {
+        //                     ts.push('<button class="btn btn-sm btn-dark" onclick="openIdDelete(\'' + row.userId + '\')">删除</button>');
+        //                 }
+        //                 return ts.join('\n');
+        //             }
+        //         }, {
+        //             field: 'loginName',
+        //             title: '登录名'
+        //         }, {
+        //             field: 'staffName',
+        //             title: '员工姓名'
+        //         }, {
+        //             field: 'phone',
+        //             title: '手机'
+        //         }, {
+        //             field: 'placeName',
+        //             title: '场地名称'
+        //         }, {
+        //             field: 'userType',
+        //             title: '角色',
+        //             formatter: function (v, row) {
+        //                 if (v === 'A') {
+        //                     return '管理员';
+        //                 } else if (v === 'C') {
+        //                     return '收银员';
+        //                 } else if (v === '1') {
+        //                     return '一级分销';
+        //                 } else if (v === '2') {
+        //                     return '二级分销';
+        //                 }
+        //                 return v;
+        //             }
+        //         }, {
+        //             field: 'beActive',
+        //             title: '状态',
+        //             formatter: function (v, row) {
+        //                 var ts = [];
+        //                 if (row.userType === 'A' || row.userType === 'C') {
+        //                     if (row.beActive === 'Y') {
+        //                         ts.push('<button class="btn btn-sm btn-default" onclick=\'userDisable(' + JSON.stringify(row) + ')\'>启用中</button>');
+        //                     } else if (row.beActive === 'N') {
+        //                         ts.push('<button class="btn btn-sm btn-dark" onclick=\'userDisable(' + JSON.stringify(row) + ')\'>已禁用</button>');
+        //                     }
+        //                     return ts.join('\n');
+        //                 }
+        //                 return '启用中';
+        //             }
+        //         }, {
+        //             field: 'loginCount',
+        //             title: '登录次数'
+        //         }
+        //     ]
+        // });
     }
 
     function getPlaceAndRole() {
-        $.ajax({
-            url: '/admin/get_place_role.json',
-            contentType: "application/json; charset=utf-8",
-            type: 'get',
-            success: function (data) {
-                if (data.success) {
-
-                    $('#placeId').empty();
-                    $('#placeId').append($('<option value="">请选择</option>'));
-
-                    data.data.place.forEach(function (p) {
-                        $('#placeId').append($('<option value="' + p.placeId + '">' + p.placeName + '</option>'));
-                    });
-
-                    $('#placeId1').empty();
-                    $('#placeId1').append($('<option value="">请选择</option>'));
-
-                    data.data.place.forEach(function (p) {
-                        $('#placeId1').append($('<option value="' + p.placeId + '">' + p.placeName + '</option>'));
-                    });
-
-                    $('#userType').empty();
-                    $('#userType').append($('<option value="">请选择</option>'));
-                    data.data.role.forEach(function (p) {
-                        $('#userType').append($('<option value="' + p.role + '">' + p.roleName + '</option>'));
-                    });
-
-                } else {
-                    layer.msg(data.msg);
-                }
-            },
-            error: function () {
-                layer.msg("网络异常");
-            }
-        });
+        // $.ajax({
+        //     url: '/admin/get_place_role.json',
+        //     contentType: "application/json; charset=utf-8",
+        //     type: 'get',
+        //     success: function (data) {
+        //         if (data.success) {
+        //
+        //             $('#placeId').empty();
+        //             $('#placeId').append($('<option value="">请选择</option>'));
+        //
+        //             data.data.place.forEach(function (p) {
+        //                 $('#placeId').append($('<option value="' + p.placeId + '">' + p.placeName + '</option>'));
+        //             });
+        //
+        //             $('#placeId1').empty();
+        //             $('#placeId1').append($('<option value="">请选择</option>'));
+        //
+        //             data.data.place.forEach(function (p) {
+        //                 $('#placeId1').append($('<option value="' + p.placeId + '">' + p.placeName + '</option>'));
+        //             });
+        //
+        //             $('#userType').empty();
+        //             $('#userType').append($('<option value="">请选择</option>'));
+        //             data.data.role.forEach(function (p) {
+        //                 $('#userType').append($('<option value="' + p.role + '">' + p.roleName + '</option>'));
+        //             });
+        //
+        //         } else {
+        //             layer.msg(data.msg);
+        //         }
+        //     },
+        //     error: function () {
+        //         layer.msg("网络异常");
+        //     }
+        // });
     }
 
 

+ 32 - 32
whepi-ui/templates/cust/account.ftl

@@ -67,23 +67,23 @@
                 'userId': userId
             };
 
-            $.ajax({
-                url: '/cust/update_account.json',
-                contentType: "application/json; charset=utf-8",
-                data: JSON.stringify(data),
-                type: 'post',
-                success: function (data) {
-                    if (data.success) {
-                        window.location.replace('/prompt/prompt.html?title=修改成功&message=');
-                        // window.location.reload();
-                    } else {
-                        $.alert(data.msg);
-                    }
-                },
-                error: function () {
-                    $.alert("网络异常");
-                }
-            });
+            // $.ajax({
+            //     url: '/cust/update_account.json',
+            //     contentType: "application/json; charset=utf-8",
+            //     data: JSON.stringify(data),
+            //     type: 'post',
+            //     success: function (data) {
+            //         if (data.success) {
+            //             window.location.replace('/prompt/prompt.html?title=修改成功&message=');
+            //             // window.location.reload();
+            //         } else {
+            //             $.alert(data.msg);
+            //         }
+            //     },
+            //     error: function () {
+            //         $.alert("网络异常");
+            //     }
+            // });
 
         });
 
@@ -99,21 +99,21 @@
     }
 
     function modifyBind(v) {
-        $.ajax({
-            url: '/cust/modify_bind.json?userId='+userId + '&placeId=' + v,
-            type: 'get',
-            success: function (data) {
-                if (data.success) {
-                    window.location.replace('/prompt/prompt.html?title=解绑成功&message=');
-                    // window.location.reload();
-                } else {
-                    $.alert(data.msg);
-                }
-            },
-            error: function () {
-                $.alert("网络异常");
-            }
-        });
+        // $.ajax({
+        //     url: '/cust/modify_bind.json?userId='+userId + '&placeId=' + v,
+        //     type: 'get',
+        //     success: function (data) {
+        //         if (data.success) {
+        //             window.location.replace('/prompt/prompt.html?title=解绑成功&message=');
+        //             // window.location.reload();
+        //         } else {
+        //             $.alert(data.msg);
+        //         }
+        //     },
+        //     error: function () {
+        //         $.alert("网络异常");
+        //     }
+        // });
     }
 
 </script>

+ 16 - 16
whepi-web/src/main/java/com/bofeng/wx/controller/CustAccountController.java

@@ -28,26 +28,26 @@ public class CustAccountController {
     @GetMapping("/cust/account.html")
     public ModelAndView market(ModelMap model) throws WxErrorException {
 
-        ParseCurrentOpenId wxToken = userService.currentWxUser();
-        if (wxToken.isError()) return wxToken.getErrorResult();
+//        ParseCurrentOpenId wxToken = userService.currentWxUser();
+//        if (wxToken.isError()) return wxToken.getErrorResult();
 
-        val user = wxToken.getUser();
-        val wxMpUser = wxToken.getWxMpUser();
+//        val user = wxToken.getUser();
+//        val wxMpUser = wxToken.getWxMpUser();
+//
+//        model.put("user", user);
+//        model.put("openId", wxMpUser.getOpenId());
+//        model.put("nickName", wxMpUser.getNickname());
+//        model.put("sexDesc", wxMpUser.getSexDesc());
+//        model.put("sex", wxMpUser.getSex());
+//        model.put("city", wxMpUser.getCity());
+//        model.put("province", wxMpUser.getProvince());
+//        model.put("country", wxMpUser.getCountry());
+//        model.put("headImgUrl", wxMpUser.getHeadImgUrl());
 
-        model.put("user", user);
-        model.put("openId", wxMpUser.getOpenId());
-        model.put("nickName", wxMpUser.getNickname());
-        model.put("sexDesc", wxMpUser.getSexDesc());
-        model.put("sex", wxMpUser.getSex());
-        model.put("city", wxMpUser.getCity());
-        model.put("province", wxMpUser.getProvince());
-        model.put("country", wxMpUser.getCountry());
-        model.put("headImgUrl", wxMpUser.getHeadImgUrl());
-
-        List<UserPlace> userPlaceList = userPlaceService.getByUserId(user.getUserId());
+//        List<UserPlace> userPlaceList = userPlaceService.getByUserId(user.getUserId());
 
         JsonWapper jw = new JsonWapper();
-        jw.set("userPlaceList", userPlaceList);
+//        jw.set("userPlaceList", userPlaceList);
         model.put("userPlaceList", jw);
 
         return new ModelAndView("/cust/account.ftl", model);

+ 4 - 4
whepi-web/src/main/resources/application-dev.yml

@@ -22,9 +22,9 @@ yvan:
   upload_domain: /static
   wechat:
     #测试帐号
-    token: luoyifan
-    appID: wx81b852a5a49ab57d
-    appsecret: 40410a13cf71fdc91919232fb0226893
+    token: yuliang
+    appID: wxa3991865de920847
+    appsecret: 4ac7ffba92e934f944a9d78ecc1807b5
 
 #    token: yuliang
 #    appID: wx1b020f76b18f0294
@@ -46,7 +46,7 @@ yvan:
 
     ##domain: http://wx.good5you.com/
 #    domain: http://bofeng.ng.good5you.com
-    domain: http://lyf.ng.yvanui.com/
+    domain: http://yuliang.ng.yvanui.com/
 #    domain: http://yyc21fmd42.hkhttp.cn
 #    tmpTicketExpireSeconds: 10800
     templates: