切换导航条
此项目
正在载入...
登录
朱兆平
/
vue_cli
·
提交
转到一个项目
GitLab
转到仪表盘
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
朱兆平
about a year ago
提交
0cedcccea7af087c88163750d6d25db5bef90bac
1 个父辈
decbf659
update:
1. 增加用户锁定接口操作按钮 2. 心跳间隔调整至90秒一次
隐藏空白字符变更
内嵌
并排对比
正在显示
3 个修改的文件
包含
45 行增加
和
10 行删除
src/api/user.js
src/views/HomeNew.vue
src/views/nav1/user.vue
src/api/user.js
查看文件 @
0cedccc
...
...
@@ -10,21 +10,24 @@ export const getRandCode = params => { return http.get(`/cloud-user-center/anony
export
const
getUserListPage
=
params
=>
{
return
http
.
get
(
`
/
user
/
list
`
,
params
)
};
export
const
removeUser
=
params
=>
{
return
http
.
del
(
`
$
{
baseUrl
}
/del`,params
)
}
;
export
const
removeUser
=
params
=>
{
return
http
.
post
(
`
$
{
baseUrl
}
/del`,params
)
}
;
export
const
batchRemoveUser
=
params
=>
{
return
http
.
del
(
`
$
{
baseUrl
}
/batchremove`, { params: params }
)
; }
;
export
const
batchRemoveUser
=
params
=>
{
return
http
.
post
(
`
$
{
baseUrl
}
/batchremove`, { params: params }
)
; }
;
export
const
editPass
=
params
=>
{
return
http
.
p
u
t
(
`
$
{
baseUrl
}
/password`,params
)
}
;
export
const
editPass
=
params
=>
{
return
http
.
p
os
t
(
`
$
{
baseUrl
}
/password`,params
)
}
;
export
const
editUser
=
params
=>
{
return
http
.
p
u
t
(
`
$
{
baseUrl
}
/edit`,params
)
}
;
export
const
editUser
=
params
=>
{
return
http
.
p
os
t
(
`
$
{
baseUrl
}
/edit`,params
)
}
;
export
const
addUser
=
params
=>
{
return
http
.
post
(
`
$
{
baseUrl
}
/add`,params
)
}
;
export
const
heartBeat
=
params
=>
{
return
http
.
post
(
`
$
{
serviceName
}
/heartbeat`,params
)
}
;
export
const
setUserRole
=
params
=>
{
return
http
.
put
(
`
$
{
baseUrl
}
/roleset`,params
)
}
;
export
const
userLock
=
params
=>
{
return
http
.
post
(
`
$
{
baseUrl
}
/lock`,params
)
}
;
export
const
setUserRole
=
params
=>
{
return
http
.
post
(
`
$
{
baseUrl
}
/roleset`,params
)
}
;
export
const
resetToken
=
params
=>
{
return
http
.
post
(
`
$
{
baseUrl
}
/resetToken`,params
)
}
;
export
const
resetToken
=
params
=>
{
return
http
.
put
(
`
$
{
baseUrl
}
/resetToken`,params
)
}
;
export
const
loginedUserInfo
=
()
=>
{
...
...
src/views/HomeNew.vue
查看文件 @
0cedccc
...
...
@@ -286,6 +286,11 @@
heartBeatAPI:function () {
heartBeat().then(response => {
}).catch(e=>{
this.$notify.error({
title: '心跳',
message: '心跳失败'
});
});
}
},
...
...
@@ -310,8 +315,10 @@
this.checkUpdate();
}, 30000);
setInterval(() => {
this.heartBeatAPI();
}, 60000);
if (this.sysUserName){
this.heartBeatAPI();
}
}, 90000);
this.$nextTick(function(){
this.initUserInfo();
// this.rowDrop(); //行拖拽效果
...
...
src/views/nav1/user.vue
查看文件 @
0cedccc
...
...
@@ -50,6 +50,9 @@
<template slot-scope="scope">
<el-tag type="success" v-if="scope.row.state">启用</el-tag>
<el-tag type="danger" v-else>禁用</el-tag>
<el-button type="text" @click="lockUser(scope.$index, scope.row, false)" v-if="scope.row.state">禁用</el-button>
<el-button type="text" @click="lockUser(scope.$index, scope.row, true)" v-else>启用</el-button>
</template>
</el-table-column>
<el-table-column prop="userStatus" label="状态" width="100">
...
...
@@ -228,7 +231,7 @@
<script>
import util from '../../common/js/util'
import NProgress from 'nprogress'
import { getUserList, removeUser, batchRemoveUser, editUser, addUser, setUserRole } from '../../api/user';
import { getUserList, removeUser, batchRemoveUser, editUser, addUser, setUserRole
,userLock
} from '../../api/user';
import { getList} from '../../api/role_api';
import { getList as getRoleList} from '../../api/role_api';
import moment from 'moment'
...
...
@@ -340,7 +343,29 @@
});
},
// 禁用与启用用户
lockUser: function(index, row, stateCode){
this.listLoading = true;
let para = {
userId: row.userId,
username:row.username,
state: stateCode
};
userLock(para).then((res) => {
this.$message({
message: '操作成功',
type: 'success'
});
this.getUsers();
}).catch((e) => {
this.$message({
message: '操作失败',
type: 'error'
});
}).finally(()=>{
this.listLoading = false;
});
},
// 获取公司列表
getCompanyNmae(){
let para = {
...
...
请
注册
或
登录
后发表评论