浏览代码

增加域用户登录

jwyu 1 年之前
父节点
当前提交
9bbf8a2349

+ 8 - 1
src/api/modules/setApi.js

@@ -337,7 +337,14 @@ const departInterence = {
 	 */
 	getPhoneAreaCode:params=>{
 		return http.get('/user_login/area_code/list',params)
-	}
+	},
+
+	// 判断用户是否为域用户
+	checkUserIsLdap:params=>{
+		return http.post('/user_login/ldap/user_check',params)
+	},
+
+
 
 }
 

+ 7 - 2
src/views/Login.vue

@@ -353,14 +353,18 @@ export default {
                 }
             })
         },
-        ordinaryModelLogin(){
+        async ordinaryModelLogin(){
             const {account,checkPass,checked} = this.$refs.ordinaryModel.form
             const t=new Date().getTime()
             const md5key='MiQM9yusNA9T2uIH'
+            // 校验一下是不是域用户
+            let IsLdap=false
+            const checkRes=await departInterence.checkUserIsLdap({UserName:account})
+            if(checkRes.Ret===200&&checkRes.Data) IsLdap=true
             departInterence.userLogin({
                 LoginType:1,
                 Username:account,
-                Password: `${md5.hex_md5(md5.hex_md5(checkPass)+md5key+t)}`,
+                Password: IsLdap?this.b.encode(checkPass+md5key):`${md5.hex_md5(md5.hex_md5(checkPass)+md5key+t)}`,
                 ReqTime:`${t}`
             }).then(res=>{
                 //this.logining = false
@@ -399,6 +403,7 @@ export default {
             departInterence.userLogin({
                 LoginType:2,
                 Mobile:mobile,
+                TelAreaCode:this.$refs[model].areaCodeSelect,
                 VerifyCode:checkCode
             }).then(res=>{
                 if(res.Ret!==200){

+ 6 - 0
src/views/system_manage/components/addUserDialog.vue

@@ -28,6 +28,12 @@
                         :label="item.Name" :value="item.Value" />
                 </el-select>
             </el-form-item>
+            <el-form-item label="用户类型" prop="IsLdap">
+                <el-select v-model="userForm.IsLdap" placeholder="请选择用户类型">
+                    <el-option label="系统用户" :value="0"></el-option>
+                    <el-option label="域用户" :value="1"></el-option>
+                </el-select>
+            </el-form-item>
             <el-form-item label="所属部门" prop="depart" v-if="userForm.title == '添加用户'">
                 <el-cascader :options="departArr" v-model="userForm.depart" :props="form_departProp"
                     placeholder="请选择部门分组" :disabled="userForm.disabledForm" clearable>

+ 15 - 7
src/views/system_manage/departManage.vue

@@ -493,6 +493,7 @@ export default {
 				disabledForm:false,//是否禁用表单的某些选项
 				disabledStatus:false,//是否禁用表单的状态项
 				departmentName:'',//所属一级部门名称
+				IsLdap:0,//用户类型
 			},//用户弹框表单
 			// 是否有工号
 			hasEmployeeNo:false,
@@ -986,7 +987,8 @@ export default {
 				email:'',
 				areacode:'86',
 				auth:0,
-				status:1
+				status:1,
+				IsLdap:0,
 			}
 		},
 		// 同步每刻
@@ -1041,7 +1043,8 @@ export default {
 							Province:this.userForm.province,
 							City:this.userForm.city,
 							Email:this.userForm.email,
-							TelAreaCode:this.userForm.areacode
+							TelAreaCode:this.userForm.areacode,
+							IsLdap:this.userForm.IsLdap
 						}
 						//console.log('testAdd',params)
 						departInterence.addUser(params).then(res => {
@@ -1064,7 +1067,8 @@ export default {
 									email:'',
 									areacode:'86',
 									auth:0,
-									status:1
+									status:1,
+									IsLdap:0
 								}
 								this.getTableUser();
 							}
@@ -1093,7 +1097,8 @@ export default {
 							Province:this.userForm.province,
 							City:this.userForm.city,
 							Email:this.userForm.email,
-							TelAreaCode:this.userForm.areacode
+							TelAreaCode:this.userForm.areacode,
+							IsLdap:this.userForm.IsLdap
 						}
 						//console.log('testEdit',params)
 						departInterence.editUser(params).then(res => {
@@ -1116,7 +1121,8 @@ export default {
 									email:'',
 									areacode:'86',
 									auth:0,
-									status:1
+									status:1,
+									IsLdap:0
 								}
 								this.getTableUser();
 							}
@@ -1158,7 +1164,8 @@ export default {
 					email:'',
 					areacode:'86',
 					auth:'无',
-					status:1
+					status:1,
+					IsLdap:0
 				},
 				this.$refs.addUserDialog.$refs.userForm.resetFields();//重置校验
 				this.isAddUser = false;
@@ -1255,7 +1262,8 @@ export default {
         disabledForm:false,
 				disabledStatus:false,
 				email:item.Email,
-				areacode:item.TelAreaCode
+				areacode:item.TelAreaCode,
+				IsLdap:item.IsLdap||0
 			}
 			this.hasEmployeeNo=!!item.EmployeeId
 			this.isAddUser = true;