ソースを参照

Merge branch 'master' of http://8.136.199.33:3000/eta_front/eta_front

Karsa 8 ヶ月 前
コミット
5c3f2ce97f

+ 7 - 0
src/api/modules/setApi.js

@@ -338,6 +338,13 @@ const departInterence = {
 	getPhoneAreaCode:params=>{
 		return http.get('/user_login/area_code/list',params)
 	},
+
+	// 判断用户是否为域用户
+	checkUserIsLdap:params=>{
+		return http.post('/user_login/ldap/user_check',params)
+	},
+
+
 	/**
 	 * 获取登录页的信息 
 	 * @returns ETATitle登录标题 Icp备案信息

+ 7 - 2
src/views/Login.vue

@@ -467,14 +467,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
@@ -513,6 +517,7 @@ export default {
             departInterence.userLogin({
                 LoginType:2,
                 Mobile:mobile,
+                TelAreaCode:this.$refs[model].areaCodeSelect,
                 VerifyCode:checkCode
             }).then(res=>{
                 if(res.Ret!==200){

+ 10 - 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>
@@ -116,6 +122,10 @@ import {patternEmail,isMobileNo,checkPassWord} from '@/utils/commonOptions';
                 userRule: {
                     account:[{required: true, message: '登录账号不能为空', trigger: 'blur'}],
                     pwd:[{validator:(rule,value,callback)=>{
+                        if(this.userForm.IsLdap==1){
+                            callback()
+                            return
+                        }
                         if(value===''){
                             callback(new Error('请输入新密码'))
                         }

+ 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;