XMLWAN преди 4 години
родител
ревизия
548e6c61b7

+ 5 - 1
controllers/org_controller.go Целия файл

@@ -5,6 +5,7 @@ import (
5 5
 	"SSO/models"
6 6
 	"SSO/service"
7 7
 	"SSO/utils"
8
+	"fmt"
8 9
 	"time"
9 10
 
10 11
 	"github.com/astaxie/beego"
@@ -124,6 +125,7 @@ func (this *OrgController) CreateSubmit() {
124 125
 	openCDM, _ := this.GetBool("open_cdm")
125 126
 	openSCRM, _ := this.GetBool("open_scrm")
126 127
 	openMall, _ := this.GetBool("open_mall")
128
+	user_name := this.GetString("user_name")
127 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 130
 		this.Data["json"] = enums.MakeFailResponseJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
129 131
 		this.ServeJSON()
@@ -172,7 +174,9 @@ func (this *OrgController) CreateSubmit() {
172 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 180
 	if createErr != nil {
177 181
 		utils.ErrorLog("mobile=%v的超级管理员创建机构失败:%v", adminUser.Mobile, createErr)
178 182
 		this.Data["json"] = enums.MakeFailResponseJSONWithSGJErrorCode(enums.ErrorCodeDBCreate)

+ 25 - 0
models/org_models.go Целия файл

@@ -88,3 +88,28 @@ type OrgGallery struct {
88 88
 func (OrgGallery) TableName() string {
89 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 Целия файл

@@ -41,7 +41,7 @@ func init() {
41 41
 	beego.Router("/getcode", &controllers.CodeController{}, "*:Post")
42 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 45
 	beego.Router("/org/create/submit", &controllers.OrgController{}, "post:CreateSubmit")
46 46
 	beego.Router("/org/admin/apps", &controllers.OrgController{}, "get:ViewApps")
47 47
 	beego.Router("/org/app/create", &controllers.OrgController{}, "get:CreateApp")

+ 6 - 0
service/org_service.go Целия файл

@@ -86,6 +86,12 @@ func CreateOrg(org *models.Org, mobile string, openXT bool, openCDM bool, openSC
86 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 95
 func GetOrgWithAdminUserID(adminUserID int) (*models.Org, error) {
90 96
 	var org models.Org
91 97
 	err := readUserDb.Where("creator = ? AND status <> 0", adminUserID).First(&org).Error

BIN
static/images/logo5.png Целия файл


BIN
static/images/newBackground.png Целия файл


+ 4 - 3
static/js/create_org.js Целия файл

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

+ 9 - 8
static/js/create_org_old.js Целия файл

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

+ 8 - 8
static/js/login_by_code.js Целия файл

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

+ 10 - 8
static/js/register.js Целия файл

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

+ 2 - 2
views/home/manage_app.html Целия файл

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

+ 3 - 3
views/home/register.html Целия файл

@@ -12,7 +12,7 @@
12 12
     <link href="/static/font-awesome/css/font-awesome.css?v=4.3.0" rel="stylesheet">
13 13
     <link href="/static/css/style.css?v=2.4.2" rel="stylesheet">
14 14
     <link href="/static/iconfont/iconfont.css" rel="stylesheet">
15
-    
15
+
16 16
 </head>
17 17
 
18 18
 <body>
@@ -59,7 +59,7 @@
59 59
     <script src="/static/js/layer.js"></script>
60 60
     <script src="/static/js/md5.js"></script>
61 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 63
 </body>
64 64
 
65
-</html>
65
+</html>

+ 9 - 4
views/new_main/create_org.html Целия файл

@@ -12,7 +12,7 @@
12 12
     <link href="/static/font-awesome/css/font-awesome.css?v=4.3.0" rel="stylesheet" />
13 13
     <link href="/static/css/old_style.css?v=1.0.0" rel="stylesheet">
14 14
     <link href="/static/iconfont/iconfont.css?v=4.0.0" rel="stylesheet">
15
-    
15
+
16 16
 </head>
17 17
 
18 18
 <body>
@@ -20,10 +20,10 @@
20 20
         <div class="head white-bg clearfix">
21 21
             <div class="logo fl">
22 22
                 <a href="/">
23
-                    <img src="/static/images/logo.png" alt="" />
23
+                    <img src="/static/images/logo5.png" alt="" />
24 24
                 </a>
25 25
             </div>
26
-            
26
+
27 27
             <div class="TheUser fr ">
28 28
                 <div class="userData fl">
29 29
                     <img src="{{.avatar}}" alt="头像" />
@@ -40,6 +40,10 @@
40 40
             <h2 class="stewardMsg_tit">机构信息</h2>
41 41
             <div class="steward_content">
42 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 47
                 <div class="cell clearfix">
44 48
                     <label class="cell_tit fl">机构名称</label>
45 49
                     <input id="org_name" type="text" class="cell_input" maxlength="50" />
@@ -48,6 +52,7 @@
48 52
                     <label class="cell_tit fl">机构简称</label>
49 53
                     <input id="org_short_name" type="text" class="cell_input" maxlength="50" />
50 54
                 </div> -->
55
+
51 56
                 <div class="cell clearfix">
52 57
                     <label class="cell_tit fl">机构类型</label>
53 58
                     <div class="city fl">
@@ -144,4 +149,4 @@
144 149
     <script src="/static/js/create_org.js?v=0.2.6"></script>
145 150
 </body>
146 151
 
147
-</html>
152
+</html>

+ 3 - 3
views/new_main/register.html Целия файл

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