Browse Source

修改姓名

XMLWAN 4 years ago
parent
commit
548e6c61b7

+ 5 - 1
controllers/org_controller.go View File

5
 	"SSO/models"
5
 	"SSO/models"
6
 	"SSO/service"
6
 	"SSO/service"
7
 	"SSO/utils"
7
 	"SSO/utils"
8
+	"fmt"
8
 	"time"
9
 	"time"
9
 
10
 
10
 	"github.com/astaxie/beego"
11
 	"github.com/astaxie/beego"
124
 	openCDM, _ := this.GetBool("open_cdm")
125
 	openCDM, _ := this.GetBool("open_cdm")
125
 	openSCRM, _ := this.GetBool("open_scrm")
126
 	openSCRM, _ := this.GetBool("open_scrm")
126
 	openMall, _ := this.GetBool("open_mall")
127
 	openMall, _ := this.GetBool("open_mall")
128
+	user_name := this.GetString("user_name")
127
 	if len(name) == 0 || len(shortName) == 0 || len(contactName) == 0 || len(address) == 0 || province <= 0 || city <= 0 || district <= 0 || category <= 0 || (!openXT && !openCDM && !openSCRM && !openMall) {
129
 	if len(name) == 0 || len(shortName) == 0 || len(contactName) == 0 || len(address) == 0 || province <= 0 || city <= 0 || district <= 0 || category <= 0 || (!openXT && !openCDM && !openSCRM && !openMall) {
128
 		this.Data["json"] = enums.MakeFailResponseJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
130
 		this.Data["json"] = enums.MakeFailResponseJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
129
 		this.ServeJSON()
131
 		this.ServeJSON()
172
 		ModifyTime:      time.Now().Unix(),
174
 		ModifyTime:      time.Now().Unix(),
173
 	}
175
 	}
174
 
176
 
175
-	createErr := service.CreateOrg(&org, adminUser.Mobile, openXT, openCDM, openSCRM, openMall) // 创建机构以及所有类型的 app,如果有新类型的平台,则需要在这个方法里面把创建这一新类型的 app 的代码加上
177
+	fmt.Print("user_name ------------------------------------------------------------------", user_name)
178
+
179
+	createErr := service.CreateOrg(&org, user_name, openXT, openCDM, openSCRM, openMall) // 创建机构以及所有类型的 app,如果有新类型的平台,则需要在这个方法里面把创建这一新类型的 app 的代码加上
176
 	if createErr != nil {
180
 	if createErr != nil {
177
 		utils.ErrorLog("mobile=%v的超级管理员创建机构失败:%v", adminUser.Mobile, createErr)
181
 		utils.ErrorLog("mobile=%v的超级管理员创建机构失败:%v", adminUser.Mobile, createErr)
178
 		this.Data["json"] = enums.MakeFailResponseJSONWithSGJErrorCode(enums.ErrorCodeDBCreate)
182
 		this.Data["json"] = enums.MakeFailResponseJSONWithSGJErrorCode(enums.ErrorCodeDBCreate)

+ 25 - 0
models/org_models.go View File

88
 func (OrgGallery) TableName() string {
88
 func (OrgGallery) TableName() string {
89
 	return "sgj_user_org_gallery"
89
 	return "sgj_user_org_gallery"
90
 }
90
 }
91
+
92
+type SgjUserAdminRole struct {
93
+	ID            int64  `gorm:"column:id" json:"id" form:"id"`
94
+	AdminUserId   int64  `gorm:"column:admin_user_id" json:"admin_user_id" form:"admin_user_id"`
95
+	OrgId         int64  `gorm:"column:org_id" json:"org_id" form:"org_id"`
96
+	AppId         int64  `gorm:"column:app_id" json:"app_id" form:"app_id"`
97
+	RoleId        int64  `gorm:"column:role_id" json:"role_id" form:"role_id"`
98
+	UserName      string `gorm:"column:user_name" json:"user_name" form:"user_name"`
99
+	Avatar        string `gorm:"column:avatar" json:"avatar" form:"avatar"`
100
+	UserType      int64  `gorm:"column:user_type" json:"user_type" form:"user_type"`
101
+	UserTitle     int64  `gorm:"column:user_title" json:"user_title" form:"user_title"`
102
+	Intro         string `gorm:"column:intro" json:"intro" form:"intro"`
103
+	Status        int64  `gorm:"column:status" json:"status" form:"status"`
104
+	Ctime         int64  `gorm:"column:ctime" json:"ctime" form:"ctime"`
105
+	Mtime         int64  `gorm:"column:mtime" json:"mtime" form:"mtime"`
106
+	UserTitleName string `gorm:"column:user_title_name" json:"user_title_name" form:"user_title_name"`
107
+	RoleIds       string `gorm:"column:role_ids" json:"role_ids" form:"role_ids"`
108
+	Message       string `gorm:"column:message" json:"message" form:"message"`
109
+	Sex           int64  `gorm:"column:sex" json:"sex" form:"sex"`
110
+	Birthday      int64  `gorm:"column:birthday" json:"birthday" form:"birthday"`
111
+}
112
+
113
+func (SgjUserAdminRole) TableName() string {
114
+	return "sgj_user_admin_role"
115
+}

+ 1 - 1
routers/router.go View File

41
 	beego.Router("/getcode", &controllers.CodeController{}, "*:Post")
41
 	beego.Router("/getcode", &controllers.CodeController{}, "*:Post")
42
 	beego.Router("/getregistcode", &controllers.CodeController{}, "*:RegistCode")
42
 	beego.Router("/getregistcode", &controllers.CodeController{}, "*:RegistCode")
43
 
43
 
44
-	beego.Router("/org/create", &controllers.OrgController{}, "get:Create")
44
+	beego.Router("/org/create", &controllers.OrgController{}, "get:c")
45
 	beego.Router("/org/create/submit", &controllers.OrgController{}, "post:CreateSubmit")
45
 	beego.Router("/org/create/submit", &controllers.OrgController{}, "post:CreateSubmit")
46
 	beego.Router("/org/admin/apps", &controllers.OrgController{}, "get:ViewApps")
46
 	beego.Router("/org/admin/apps", &controllers.OrgController{}, "get:ViewApps")
47
 	beego.Router("/org/app/create", &controllers.OrgController{}, "get:CreateApp")
47
 	beego.Router("/org/app/create", &controllers.OrgController{}, "get:CreateApp")

+ 6 - 0
service/org_service.go View File

86
 	return nil
86
 	return nil
87
 }
87
 }
88
 
88
 
89
+func GetLastName(creator int64) (models.Org, error) {
90
+	org := models.Org{}
91
+	err := readUserDb.Model(&org).Where("creator = ? and status = 1").Last(&org).Error
92
+	return org, err
93
+}
94
+
89
 func GetOrgWithAdminUserID(adminUserID int) (*models.Org, error) {
95
 func GetOrgWithAdminUserID(adminUserID int) (*models.Org, error) {
90
 	var org models.Org
96
 	var org models.Org
91
 	err := readUserDb.Where("creator = ? AND status <> 0", adminUserID).First(&org).Error
97
 	err := readUserDb.Where("creator = ? AND status <> 0", adminUserID).First(&org).Error

BIN
static/images/logo5.png View File


BIN
static/images/newBackground.png View File


+ 4 - 3
static/js/create_org.js View File

1
 $(function() {
1
 $(function() {
2
     $("#open_3").attr("checked", "checked");
2
     $("#open_3").attr("checked", "checked");
3
-    
3
+
4
     $("#province_select").change(function() {
4
     $("#province_select").change(function() {
5
         $("#city_select option").remove();
5
         $("#city_select option").remove();
6
         $("#district_select option").remove();
6
         $("#district_select option").remove();
36
     });
36
     });
37
 
37
 
38
     $("#city_select").change(function() {
38
     $("#city_select").change(function() {
39
-        
39
+
40
         $("#district_select option").remove();
40
         $("#district_select option").remove();
41
         $("#district_select").append("<option value='0'>区/县</option>");
41
         $("#district_select").append("<option value='0'>区/县</option>");
42
         var city = $("#city_select option:selected").val();
42
         var city = $("#city_select option:selected").val();
154
             open_cdm: open_cdm,
154
             open_cdm: open_cdm,
155
             open_scrm: open_scrm,
155
             open_scrm: open_scrm,
156
             open_mall: open_mall,
156
             open_mall: open_mall,
157
+            user_name:$("#user_name").val()
157
         }
158
         }
158
         postRequest("/org/create/submit", postData, doSuccess, doFail);
159
         postRequest("/org/create/submit", postData, doSuccess, doFail);
159
 
160
 
203
 
204
 
204
 function doFail(res) {
205
 function doFail(res) {
205
     serverErrorMsg(res);
206
     serverErrorMsg(res);
206
-}
207
+}

+ 9 - 8
static/js/create_org_old.js View File

128
     }
128
     }
129
 
129
 
130
     $("#province_select").change(function() {
130
     $("#province_select").change(function() {
131
-        
131
+
132
         $("#city_select option").remove();
132
         $("#city_select option").remove();
133
         $("#district_select option").remove();
133
         $("#district_select option").remove();
134
         $("#city_select").append("<option value='0'>市</option>");
134
         $("#city_select").append("<option value='0'>市</option>");
163
     });
163
     });
164
 
164
 
165
     $("#city_select").change(function() {
165
     $("#city_select").change(function() {
166
-        
166
+
167
         $("#district_select option").remove();
167
         $("#district_select option").remove();
168
         $("#district_select").append("<option value='0'>区/县</option>");
168
         $("#district_select").append("<option value='0'>区/县</option>");
169
         var city = $("#city_select option:selected").val();
169
         var city = $("#city_select option:selected").val();
247
         }
247
         }
248
 
248
 
249
         var ills = new Array();
249
         var ills = new Array();
250
-        $("input[name='ill_checkbox']:checkbox:checked").each(function(){ 
250
+        $("input[name='ill_checkbox']:checkbox:checked").each(function(){
251
             ills.push($(this).val());
251
             ills.push($(this).val());
252
         });
252
         });
253
         var illstr = ills.join(",");
253
         var illstr = ills.join(",");
273
             business_time: $("#org_business_time").val(),
273
             business_time: $("#org_business_time").val(),
274
             business_state: $("input[name='org_business_state']:checked").val(),
274
             business_state: $("input[name='org_business_state']:checked").val(),
275
             org_pics: picsStr,
275
             org_pics: picsStr,
276
+            user_name:$("#user_name").val()
276
         }
277
         }
277
         postRequest("/org/create/submit", postData, doSuccess, doFail);
278
         postRequest("/org/create/submit", postData, doSuccess, doFail);
278
 
279
 
293
             var wname = $(this).attr('data-name');
294
             var wname = $(this).attr('data-name');
294
             business_week.push({ "id": wid, "name": wname });
295
             business_week.push({ "id": wid, "name": wname });
295
         });
296
         });
296
-  
297
+
297
         if (business_week.length == 0) {
298
         if (business_week.length == 0) {
298
             $("#org_business_week").val('');
299
             $("#org_business_week").val('');
299
         } else if (business_week.length == 1) {
300
         } else if (business_week.length == 1) {
311
                     break;
312
                     break;
312
                 }
313
                 }
313
             }
314
             }
314
-  
315
+
315
             if (btrue) {
316
             if (btrue) {
316
                 var week_show = business_week[0]["name"] + ' — ' + business_week[lastindex]["name"];
317
                 var week_show = business_week[0]["name"] + ' — ' + business_week[lastindex]["name"];
317
                 $("#org_business_week").val(week_show);
318
                 $("#org_business_week").val(week_show);
327
             }
328
             }
328
         }
329
         }
329
     });
330
     });
330
-  
331
+
331
     $('input[name=time_checkbox_s], input[name=time_checkbox_x]').change(function () {
332
     $('input[name=time_checkbox_s], input[name=time_checkbox_x]').change(function () {
332
         if ($("input[name='time_checkbox_s']:checked").length == 0 || $("input[name='time_checkbox_x']:checked").length == 0) {
333
         if ($("input[name='time_checkbox_s']:checked").length == 0 || $("input[name='time_checkbox_x']:checked").length == 0) {
333
             return;
334
             return;
414
         return "请填写地址";
415
         return "请填写地址";
415
     }
416
     }
416
     var selectIll = false;
417
     var selectIll = false;
417
-    $("input[name='ill_checkbox']:checkbox:checked").each(function(){ 
418
+    $("input[name='ill_checkbox']:checkbox:checked").each(function(){
418
         selectIll = true;
419
         selectIll = true;
419
         return false;
420
         return false;
420
     });
421
     });
434
 
435
 
435
 function doFail(res) {
436
 function doFail(res) {
436
     serverErrorMsg(res);
437
     serverErrorMsg(res);
437
-}
438
+}

+ 8 - 8
static/js/login_by_code.js View File

6
 
6
 
7
     //获取验证码
7
     //获取验证码
8
     $("#get_code").click(function() {
8
     $("#get_code").click(function() {
9
-        
9
+
10
         var phone = $("#phone").val();
10
         var phone = $("#phone").val();
11
         var aespass = $('#aespass').val();
11
         var aespass = $('#aespass').val();
12
 
12
 
18
             phone: phone,
18
             phone: phone,
19
             aespass: aespass,
19
             aespass: aespass,
20
         }
20
         }
21
-        $("#get_code").attr("disabled", true);
21
+        $("#get_code").attr("disabled", false);
22
         changeNum(60);
22
         changeNum(60);
23
 
23
 
24
         postRequest("/getcode", postData, doSuccess, doFail);
24
         postRequest("/getcode", postData, doSuccess, doFail);
25
 
25
 
26
         function doSuccess(res) {
26
         function doSuccess(res) {
27
-            
27
+
28
             if (res.state == 0) {
28
             if (res.state == 0) {
29
                 serverErrorMsg(res);
29
                 serverErrorMsg(res);
30
                 return;
30
                 return;
35
 
35
 
36
     //确定
36
     //确定
37
     $("#submit").click(function() {
37
     $("#submit").click(function() {
38
-        
38
+
39
         var code = $("#code").val();
39
         var code = $("#code").val();
40
         if (code != null && code != undefined && code != "") {
40
         if (code != null && code != undefined && code != "") {
41
             var mobile = $("#phone").val();
41
             var mobile = $("#phone").val();
48
                     returnurl: $("#return_url").val(),
48
                     returnurl: $("#return_url").val(),
49
                     app_type: $("#app_type").val(),
49
                     app_type: $("#app_type").val(),
50
                 }
50
                 }
51
-                
51
+
52
                 setCookie("login_mobile", mobile);
52
                 setCookie("login_mobile", mobile);
53
 
53
 
54
                 postRequest("/login/code/submit", postData, doSuccess, doFail);
54
                 postRequest("/login/code/submit", postData, doSuccess, doFail);
109
 
109
 
110
 function getCookie(name){
110
 function getCookie(name){
111
     var arr = document.cookie.match(new RegExp("(^| )" + name + "=([^;]*)(;|$)"));
111
     var arr = document.cookie.match(new RegExp("(^| )" + name + "=([^;]*)(;|$)"));
112
-    if (arr != null) 
113
-        return unescape(arr[2]); 
112
+    if (arr != null)
113
+        return unescape(arr[2]);
114
     return null;
114
     return null;
115
-}
115
+}

+ 10 - 8
static/js/register.js View File

1
 $(function() {
1
 $(function() {
2
     //获取验证码
2
     //获取验证码
3
     $("#get_code").click(function() {
3
     $("#get_code").click(function() {
4
-        
4
+
5
         var phone = $("#phone").val();
5
         var phone = $("#phone").val();
6
         var aespass = $('#aespass').val();
6
         var aespass = $('#aespass').val();
7
 
7
 
14
             aespass: aespass,
14
             aespass: aespass,
15
         }
15
         }
16
         $("#get_code").attr("disabled", true);
16
         $("#get_code").attr("disabled", true);
17
-        changeNum(60);
17
+
18
 
18
 
19
         postRequest("/getregistcode", postData, doSuccess, doFail);
19
         postRequest("/getregistcode", postData, doSuccess, doFail);
20
 
20
 
21
         function doSuccess(res) {
21
         function doSuccess(res) {
22
-            
23
-            if (res.state == 0) {
24
-                serverErrorMsg(res);
25
-                return;
22
+            if (res.state == 1) {
23
+               changeNum(60);
24
+
25
+            }else{
26
+              serverErrorMsg(res);
27
+              return;
26
             }
28
             }
27
             layer.msg(res.data.msg);
29
             layer.msg(res.data.msg);
28
         }
30
         }
113
             changeNum(num);
115
             changeNum(num);
114
         } else {
116
         } else {
115
             $('#get_code').html("发送验证码");
117
             $('#get_code').html("发送验证码");
116
-            $("#get_code").attr("disabled", false);
118
+            $("#get_code").attr("disabled", true);
117
         }
119
         }
118
     }, 1000);
120
     }, 1000);
119
-}
121
+}

+ 2 - 2
views/home/manage_app.html View File

19
         <div class="head white-bg clearfix">
19
         <div class="head white-bg clearfix">
20
             <div class="logo fl">
20
             <div class="logo fl">
21
                 <a href="/">
21
                 <a href="/">
22
-                    <img src="/static/images/logo.png" alt="" />
22
+                    <img src="/static/images/logo5.png" alt="" />
23
                     <!-- <span>酷医</span> -->
23
                     <!-- <span>酷医</span> -->
24
                 </a>
24
                 </a>
25
             </div>
25
             </div>
226
     </script> -->
226
     </script> -->
227
 </body>
227
 </body>
228
 
228
 
229
-</html>
229
+</html>

+ 3 - 3
views/home/register.html View File

12
     <link href="/static/font-awesome/css/font-awesome.css?v=4.3.0" rel="stylesheet">
12
     <link href="/static/font-awesome/css/font-awesome.css?v=4.3.0" rel="stylesheet">
13
     <link href="/static/css/style.css?v=2.4.2" rel="stylesheet">
13
     <link href="/static/css/style.css?v=2.4.2" rel="stylesheet">
14
     <link href="/static/iconfont/iconfont.css" rel="stylesheet">
14
     <link href="/static/iconfont/iconfont.css" rel="stylesheet">
15
-    
15
+
16
 </head>
16
 </head>
17
 
17
 
18
 <body>
18
 <body>
59
     <script src="/static/js/layer.js"></script>
59
     <script src="/static/js/layer.js"></script>
60
     <script src="/static/js/md5.js"></script>
60
     <script src="/static/js/md5.js"></script>
61
     <script src="/static/js/common.js"></script>
61
     <script src="/static/js/common.js"></script>
62
-    <script src="/static/js/register.js?v=0.1.0"></script>
62
+    <script src="/static/js/register.js?v=0.2.0"></script>
63
 </body>
63
 </body>
64
 
64
 
65
-</html>
65
+</html>

+ 9 - 4
views/new_main/create_org.html View File

12
     <link href="/static/font-awesome/css/font-awesome.css?v=4.3.0" rel="stylesheet" />
12
     <link href="/static/font-awesome/css/font-awesome.css?v=4.3.0" rel="stylesheet" />
13
     <link href="/static/css/old_style.css?v=1.0.0" rel="stylesheet">
13
     <link href="/static/css/old_style.css?v=1.0.0" rel="stylesheet">
14
     <link href="/static/iconfont/iconfont.css?v=4.0.0" rel="stylesheet">
14
     <link href="/static/iconfont/iconfont.css?v=4.0.0" rel="stylesheet">
15
-    
15
+
16
 </head>
16
 </head>
17
 
17
 
18
 <body>
18
 <body>
20
         <div class="head white-bg clearfix">
20
         <div class="head white-bg clearfix">
21
             <div class="logo fl">
21
             <div class="logo fl">
22
                 <a href="/">
22
                 <a href="/">
23
-                    <img src="/static/images/logo.png" alt="" />
23
+                    <img src="/static/images/logo5.png" alt="" />
24
                 </a>
24
                 </a>
25
             </div>
25
             </div>
26
-            
26
+
27
             <div class="TheUser fr ">
27
             <div class="TheUser fr ">
28
                 <div class="userData fl">
28
                 <div class="userData fl">
29
                     <img src="{{.avatar}}" alt="头像" />
29
                     <img src="{{.avatar}}" alt="头像" />
40
             <h2 class="stewardMsg_tit">机构信息</h2>
40
             <h2 class="stewardMsg_tit">机构信息</h2>
41
             <div class="steward_content">
41
             <div class="steward_content">
42
                 <p class="tips">请正确填写以下信息,后续可在账号设置中修改</p>
42
                 <p class="tips">请正确填写以下信息,后续可在账号设置中修改</p>
43
+                <div class="cell clearfix">
44
+                  <label class="cell_tit fl">您的姓名</label>
45
+                  <input id="user_name" type="text" class="cell_input" maxlength="10" />
46
+                </div>
43
                 <div class="cell clearfix">
47
                 <div class="cell clearfix">
44
                     <label class="cell_tit fl">机构名称</label>
48
                     <label class="cell_tit fl">机构名称</label>
45
                     <input id="org_name" type="text" class="cell_input" maxlength="50" />
49
                     <input id="org_name" type="text" class="cell_input" maxlength="50" />
48
                     <label class="cell_tit fl">机构简称</label>
52
                     <label class="cell_tit fl">机构简称</label>
49
                     <input id="org_short_name" type="text" class="cell_input" maxlength="50" />
53
                     <input id="org_short_name" type="text" class="cell_input" maxlength="50" />
50
                 </div> -->
54
                 </div> -->
55
+
51
                 <div class="cell clearfix">
56
                 <div class="cell clearfix">
52
                     <label class="cell_tit fl">机构类型</label>
57
                     <label class="cell_tit fl">机构类型</label>
53
                     <div class="city fl">
58
                     <div class="city fl">
144
     <script src="/static/js/create_org.js?v=0.2.6"></script>
149
     <script src="/static/js/create_org.js?v=0.2.6"></script>
145
 </body>
150
 </body>
146
 
151
 
147
-</html>
152
+</html>

+ 3 - 3
views/new_main/register.html View File

15
             <div class="eis-login-bg" id="login-bgImg" style="background-image: url(/static/images/login_bg02.jpg);">
15
             <div class="eis-login-bg" id="login-bgImg" style="background-image: url(/static/images/login_bg02.jpg);">
16
             </div>
16
             </div>
17
             <div class="eis-login-right">
17
             <div class="eis-login-right">
18
-                <div class="eis-login-form  eis-login-center"> 
18
+                <div class="eis-login-form  eis-login-center">
19
                     <div class="eis-logo"><p>注册账户</p></div>
19
                     <div class="eis-logo"><p>注册账户</p></div>
20
                     <div class="eis-login-info">
20
                     <div class="eis-login-info">
21
                         <div class="eis-form" style="display:block;">
21
                         <div class="eis-form" style="display:block;">
31
                                     <input name="password" type="password" id="password" autocomplete="off" placeholder="密码" class="eis-form-control">
31
                                     <input name="password" type="password" id="password" autocomplete="off" placeholder="密码" class="eis-form-control">
32
                                 </div>
32
                                 </div>
33
                             </div>
33
                             </div>
34
-                            
34
+
35
                             <div class="eis-login-button" id="forget_panel">
35
                             <div class="eis-login-button" id="forget_panel">
36
                                 <input name="submit" type="button" id="submit" style="letter-spacing: 0px;" class="submit" value="即刻开始">
36
                                 <input name="submit" type="button" id="submit" style="letter-spacing: 0px;" class="submit" value="即刻开始">
37
                             </div>
37
                             </div>
61
     <script src="/static/js/common.js"></script>
61
     <script src="/static/js/common.js"></script>
62
     <script src="/static/js/register.js?v=0.1.2"></script>
62
     <script src="/static/js/register.js?v=0.1.2"></script>
63
 </body>
63
 </body>
64
-</html>
64
+</html>