|
|
|
@ -84,12 +84,13 @@ |
|
|
|
fixed="right" |
|
|
|
header-align="center" |
|
|
|
align="center" |
|
|
|
width="150" |
|
|
|
width="200" |
|
|
|
:label="buttons.cz||'操作'"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<a type="text" @click="generateData(scope.row)">{{ buttons.auth || '审核' }}</a> |
|
|
|
<a type="text" @click="addOrUpdateHandle(scope.row.userId)">{{ buttons.edit || '修改' }}</a> |
|
|
|
<a type="text" @click="deleteHandle(scope.row.userId)">{{ buttons.delete || '删除' }}</a> |
|
|
|
<!-- <a type="text" @click="generateData(scope.row)">{{ buttons.auth || '审核' }}</a>--> |
|
|
|
<a type="text" v-if="scope.row.username!=='sys_wms'" @click="addOrUpdateHandle(scope.row.userId)">{{ buttons.edit || '修改' }}</a> |
|
|
|
<a type="text" v-if="scope.row.username!=='sys_wms'&&scope.row.username!=='admin'" @click="deleteHandle(scope.row.userId)">{{ buttons.delete || '删除' }}</a> |
|
|
|
<a type="text" v-if="scope.row.username!=='sys_wms'" @click="forceLogoutHandle(scope.row)" style="color: #F56C6C;">{{ buttons.forceLogout || '踢出登录' }}</a> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
@ -219,6 +220,7 @@ export default { |
|
|
|
specialVisible: false, |
|
|
|
siteVisible: false, |
|
|
|
warehouseVisible: false, |
|
|
|
forceLogoutLoading: false, |
|
|
|
currentData: {}, |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
transferData: [], |
|
|
|
@ -291,6 +293,7 @@ export default { |
|
|
|
add: '添加', |
|
|
|
edit: '编辑', |
|
|
|
delete: '删除', |
|
|
|
forceLogout: '踢出登录', |
|
|
|
specialCompetencies: '特殊权限', |
|
|
|
factoryAuthorization: '工厂授权', |
|
|
|
warehouseAuthorization: '仓库授权', |
|
|
|
@ -621,6 +624,35 @@ export default { |
|
|
|
}) |
|
|
|
}).catch(() => { |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 踢出登录 - rqrq |
|
|
|
forceLogoutHandle(row) { |
|
|
|
this.$confirm(`确定要踢出用户 [${row.username}] 的登录状态吗?该操作将清除该用户的登录状态,使其需要重新登录。`, '踢出登录确认', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
this.forceLogoutLoading = true |
|
|
|
this.$http({ |
|
|
|
url: this.$http.adornUrl('/sys/user/forceLogout'), |
|
|
|
method: 'post', |
|
|
|
data: this.$http.adornData({ |
|
|
|
userId: row.userId |
|
|
|
}) |
|
|
|
}).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.$message.success('已成功踢出该用户,用户需要重新登录') |
|
|
|
this.getDataList() |
|
|
|
} else { |
|
|
|
this.$alert(data.msg || '踢出登录失败', '错误') |
|
|
|
} |
|
|
|
}).catch(() => { |
|
|
|
this.$message.error('踢出登录失败') |
|
|
|
}).finally(() => { |
|
|
|
this.forceLogoutLoading = false |
|
|
|
}) |
|
|
|
}).catch(() => { |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
created() { |
|
|
|
|