admin权限加个重置密码

main
吕天方 1 month ago
parent 09ed99871b
commit 2b87c3fc70

@ -5,7 +5,7 @@ VUE_APP_TITLE = 太仓资产管理系统
ENV = 'development'
# 若依管理系统/开发环境
VUE_APP_BASE_API = 'http://192.168.0.105:9115'
VUE_APP_BASE_API = 'http://192.168.0.115:9115'
# VUE_APP_BASE_API = 'http://39.101.188.84:9115'
# 路由懒加载

@ -224,3 +224,12 @@ export function deleteAssetApp(id) {
method: 'delete',
})
}
// 领导端admin修改密码
export function editPassword(id) {
return request({
url:"/tc/unit/edit/" + id,
method:"get"
})
}

@ -254,7 +254,7 @@
<el-table-column label="单位名称" align="center" key="nickName" prop="nickName">
<template slot-scope="scope">{{ scope.row.nickName }}</template>
</el-table-column>
<el-table-column label="单位类型" align="center" key="dwlx" prop="dwlx">
<el-table-column label="单位类型" width="100" align="center" key="dwlx" prop="dwlx">
<template slot-scope="scope">
<dict-tag :options="dict.type.dwlx" :value="scope.row.dwlx"/>
</template>
@ -265,7 +265,7 @@
<!-- <el-table-column label="所属区域" align="center" key="ssqycounty" prop="ssqycounty">
<template slot-scope="scope">{{ getSsqu(scope.row) }}</template>
</el-table-column> -->
<el-table-column label="所属行业" align="center" key="sshy" prop="sshy">
<el-table-column label="所属行业" width="80" align="center" key="sshy" prop="sshy">
<template slot-scope="scope">
<dict-tag :options="dict.type.sshy" :value="scope.row.sshy"/>
<!-- {{ scope.row.sshy }} -->
@ -285,6 +285,11 @@
<img src="@/assets/images/edit.png" alt="" style="width: 15px;margin-right: 5px;">
<span class="look-info" style="color: #1485EF;">编辑</span>
</div>
<div v-if="roles.includes('admin')" style="display: flex;align-items: center;cursor: pointer; margin-left: 10px;" @click="changePassword(scope.row)">
<!-- <img src="@/assets/images/del.png" alt="" style="width: 20px;margin-right: 5px;"> -->
<i class="el-icon-refresh-right" style="width: 20px;margin-right: 5px;color: #1485EF;font-size: 20px;"></i>
<span class="look-info" style="color: #1485EF;">重置密码</span>
</div>
<div style="display: flex;align-items: center;cursor: pointer; margin-left: 10px;" @click="handleDelete(scope.row)">
<img src="@/assets/images/del.png" alt="" style="width: 20px;margin-right: 5px;">
<span class="look-info" style="color: #F50C0C;">删除</span>
@ -338,19 +343,20 @@
</template>
<script>
import { listUser, getUser, delUser, addUser, updateUser, resetUserPwd, changeUserStatus, deptTreeSelect } from "@/api/system/user";
import { listUnit, delUnit } from "@/api/auditPagesApi/index";
import { deptTreeSelect } from "@/api/system/user";
import { listUnit, delUnit, editPassword } from "@/api/auditPagesApi/index";
import { getToken } from "@/utils/auth";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import myPagination from "@/views/components/Pagination/index.vue"
import { MessageBox } from 'element-ui'
export default {
name: "User",
dicts: ['dwlx','sshy'],
components: { Treeselect, myPagination },
data() {
return {
roles: this.$store.state.user.roles,
//
loading: true,
//
@ -586,6 +592,38 @@ export default {
submitFileForm() {
this.$refs.upload.submit();
},
// admin
changePassword(row){
editPassword(row.id).then(res=>{
if(res.code == 200 && res.msg) {
let msg = res.msg
MessageBox.confirm(`${msg}`, '重置密码', {
confirmButtonText: '确定',
showClose:false,
type:"success ",
callback: action => {
if (window.clipboardData) {
window.clipboardData.setData('text', msg);
} else {
(function () {
document.oncopy = function (e) {
e.clipboardData.setData('text', msg);
e.preventDefault();
document.oncopy = null;
}
})(msg);
document.execCommand('Copy');
}
this.$message({
type: 'success',
message: `密码复制成功: ${ msg }`
});
this.getList();
}
});
}
})
},
// table
tableRowClassName({row, rowIndex}){
if (rowIndex % 2 !== 0) {

Loading…
Cancel
Save