| | |
| | | export function findAllList (data) { |
| | | return request.post('/visitsAdmin/cloudService/system/user/findAllList', data) |
| | | } |
| | | |
| | | export function updUserProhibitStatus (data) { |
| | | return request.post('/visitsAdmin/cloudService/system/user/updUserProhibitStatus', data) |
| | | } |
| | | // 新建 |
| | | export function create (data) { |
| | | return request.post('/visitsAdmin/cloudService/system/user/create', data, { |
| | |
| | | show-password></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="新密码" prop="newPwd" required> |
| | | <el-input v-model="changePwdData.form.newPwd" type="password" placeholder="请输入新密码,密码需包含字母、数字及特殊字符中的至少两种" |
| | | <el-input v-model="changePwdData.form.newPwd" type="password" placeholder="请输入新密码,至少包括数字、大写字母、小写字母、特殊字符中的三种字符,且至少8位数" |
| | | maxlength="20" show-password></el-input> |
| | | </el-form-item> |
| | | <!-- <div style="font-size: 12px;color:#999999">密码需包含字母、数字及特殊字符中的至少两种</div> --> |
| | |
| | | if (!value) { |
| | | callback(new Error('请输入密码')) |
| | | } else { |
| | | const lengthValid = /^.{6,20}$/.test(value) |
| | | const hasLetter = /[a-zA-Z]/.test(value) |
| | | const hasNumber = /[0-9]/.test(value) |
| | | const hasSpecial = /[!@#$%^&*(),.?":{}|<>]/.test(value) |
| | | |
| | | const typesCount = [hasLetter, hasNumber, hasSpecial].filter(Boolean).length |
| | | |
| | | if (!lengthValid) { |
| | | callback(new Error('密码长度需为6到20个字符')) |
| | | } else if (typesCount < 2) { |
| | | callback(new Error('密码需包含字母、数字及特殊字符中的至少两种')) |
| | | // const lengthValid = /^.{6,20}$/.test(value) |
| | | // const hasLetter = /[a-zA-Z]/.test(value) |
| | | // const hasNumber = /[0-9]/.test(value) |
| | | // const hasSpecial = /[!@#$%^&*(),.?":{}|<>]/.test(value) |
| | | // |
| | | // const typesCount = [hasLetter, hasNumber, hasSpecial].filter(Boolean).length |
| | | // |
| | | // if (!lengthValid) { |
| | | // callback(new Error('密码长度需为6到20个字符')) |
| | | // } else if (typesCount < 2) { |
| | | // callback(new Error('密码需包含字母、数字及特殊字符中的至少两种')) |
| | | // } else { |
| | | // callback() // 验证通过 |
| | | // } |
| | | let typeCount = 0; |
| | | if (/[a-z]/.test(value)) typeCount++; // 小写字母 |
| | | if (/[A-Z]/.test(value)) typeCount++; // 大写字母 |
| | | if (/\d/.test(value)) typeCount++; // 数字 |
| | | if (/[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]/.test(value)) typeCount++; // 特殊字符 |
| | | if (typeCount >= 3) { |
| | | callback() |
| | | } else { |
| | | callback() // 验证通过 |
| | | callback(new Error('至少包括数字、大写字母、小写字母、特殊字符中的三种字符,且至少8位数')) |
| | | } |
| | | } |
| | | }, |
| | |
| | | <p class="tip" v-if="user != null">为用户 <em>{{user.realname}}</em> 重置密码</p> |
| | | <el-form :model="form" ref="form" :rules="rules"> |
| | | <el-form-item label="新密码" prop="password" required> |
| | | <el-input v-model="form.password" type="password" placeholder="请输入新密码" maxlength="30" show-password></el-input> |
| | | <el-input v-model="form.password" type="password" placeholder="至少包括数字、大写字母、小写字母、特殊字符中的三种字符,且至少8位数" maxlength="30" show-password></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | </GlobalWindow> |
| | |
| | | }, |
| | | rules: { |
| | | password: [ |
| | | { required: true, message: '请输入密码' } |
| | | { validator: this.validatePassword, trigger: 'blur' } |
| | | ] |
| | | } |
| | | } |
| | |
| | | this.$refs.form.resetFields() |
| | | }) |
| | | }, |
| | | validatePassword (rule, value, callback) { |
| | | if (!value) { |
| | | callback(new Error('请输入密码')) |
| | | } else { |
| | | let typeCount = 0; |
| | | if (/[a-z]/.test(value)) typeCount++; // 小写字母 |
| | | if (/[A-Z]/.test(value)) typeCount++; // 大写字母 |
| | | if (/\d/.test(value)) typeCount++; // 数字 |
| | | if (/[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]/.test(value)) typeCount++; // 特殊字符 |
| | | if (typeCount >= 3) { |
| | | callback() |
| | | } else { |
| | | callback(new Error('至少包括数字、大写字母、小写字母、特殊字符中的三种字符,且至少8位数')) |
| | | } |
| | | } |
| | | }, |
| | | // 确认重置密码 |
| | | confirm () { |
| | | if (this.isWorking) { |
| | |
| | | <!-- 表格和分页 --> |
| | | <template v-slot:table-wrap> |
| | | <ul class="toolbar" v-permissions="['business:company:create', 'business:company:sync']"> |
| | | <!-- <li><el-button type="primary" v-permissions="['business:company:create']"--> |
| | | <!-- @click="$refs.OperaInternalCompanyWindow.open('新建企业', null, null)">新建</el-button></li>--> |
| | | <li><el-button type="primary" v-permissions="['business:company:create']" |
| | | @click="$refs.OperaInternalCompanyWindow.open('新建组织', null, null)">新建</el-button></li> |
| | | <li><el-button @click="sort('top')" :loading="sorting" icon="el-icon-sort-up" |
| | | v-permissions="['business:company:sort']">上移</el-button></li> |
| | | <li><el-button @click="sort('bottom')" :loading="sorting" icon="el-icon-sort-down" |
| | |
| | | @click="synchronous()">同步</el-button></li> |
| | | <li><el-button type="primary" v-permissions="['business:member:create']" :loading="loading" |
| | | @click="synchronousDingding()">同步钉钉</el-button></li> |
| | | <!-- <li><el-button type="primary" |
| | | <li><el-button type="primary" |
| | | @click="add" icon="el-icon-plus" |
| | | v-permissions="['business:member:create']">新建员工</el-button></li> |
| | | <li><el-button type="primary" @click="$refs.OperaMemberImportWindow.open('人员导入', searchForm.companyType)" |
| | | icon="el-icon-plus" v-permissions="['business:member:create']">人员导入</el-button></li> |
| | | <li><el-button type="danger" @click="deleteByIdInBatch" icon="el-icon-delete" |
| | | v-permissions="['business:member:delete']">批量删除</el-button></li>--> |
| | | <!-- <li><el-button type="primary" @click="$refs.OperaMemberImportWindow.open('人员导入', searchForm.companyType)"--> |
| | | <!-- icon="el-icon-plus" v-permissions="['business:member:create']">人员导入</el-button></li>--> |
| | | <!-- <li><el-button type="danger" @click="deleteByIdInBatch" icon="el-icon-delete"--> |
| | | <!-- v-permissions="['business:member:delete']">批量删除</el-button></li>--> |
| | | <li><el-button type="primary" v-permissions="['business:empower:create']" |
| | | @click="startEmpowerBatch()">下发授权</el-button></li> |
| | | <li style="float: right"> |
| | |
| | | </ul> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="prohibitStatus" label="禁止登录" min-width="160px" class-name="table-column-strings"> |
| | | <template slot-scope="{row}"> |
| | | <el-switch |
| | | v-model="row.prohibitStatus" |
| | | @change="changeStatus($event, row.id)" |
| | | active-color="#13ce66" |
| | | inactive-color="#ff4949" |
| | | :active-value="0" |
| | | :inactive-value="1"> |
| | | </el-switch> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="prohibitRemark" label="禁用备注" min-width="100px"></el-table-column> |
| | | <el-table-column label="初始化密码" min-width="100px"> |
| | | <template slot-scope="{row}"> |
| | | <span v-if="row.needChangePwd === 0">{{row.firstPassword}}</span> |
| | | <span v-else>-</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="createUser" label="创建人" min-width="100px"> |
| | | <template slot-scope="{row}">{{row.createUserInfo == null ? '' : row.createUserInfo.username}}</template> |
| | | </el-table-column> |
| | |
| | | import DepartmentSelect from '@/components/common/DepartmentSelect' |
| | | import PositionSelect from '@/components/common/PositionSelect' |
| | | import { fetchAll as fetchAllRoles, fetchAll } from '@/api/system/role' |
| | | import { updUserProhibitStatus } from '@/api/system/user' |
| | | export default { |
| | | name: 'SystemUser', |
| | | extends: BaseTable, |
| | |
| | | .catch(e => { |
| | | this.$tip.apiFailed(e) |
| | | }) |
| | | }, |
| | | methods: { |
| | | changeStatus(prohibitStatus, id) { |
| | | console.log(id) |
| | | console.log(prohibitStatus) |
| | | updUserProhibitStatus({ |
| | | prohibitStatus, |
| | | id |
| | | }).then(res => { |
| | | this.search() |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | </script> |