diff --git a/src/api/index.js b/src/api/index.js
index b12cc2e..7b98b4e 100644
--- a/src/api/index.js
+++ b/src/api/index.js
@@ -35,7 +35,7 @@ export default {
saveUser: `/users/users/data/user/save`,
getUserList: `/users/users/data/user/getUserList`,
getUserTotalBySchoolId: `/users/users/data/user/getUserTotalBySchoolId`,
- checkAccount:`/users/users/data/user/checkAccount`,
+ checkAccount:`/occupationlab/architecture/checkWorkNumOrAccount`,
getDetail:`/users/users/data/user/getDetail`,
modifyUser:`/users/users/data/user/modify`,
export_failure:`${Setting.apiBaseURL}/users/users/data/user/export_failure`,
diff --git a/src/pages/user/list/index.vue b/src/pages/user/list/index.vue
index cef6836..9e6b057 100644
--- a/src/pages/user/list/index.vue
+++ b/src/pages/user/list/index.vue
@@ -19,7 +19,6 @@
-
@@ -55,18 +54,14 @@
{{scope.row.isEnable ? '启用' : '禁用'}}
-
-
- {{scope.row.roleId == '0' ? '用户' : (roleList.find(n => n.id == scope.row.roleId) ? roleList.find(n => n.id == scope.row.roleId).roleName : '')}}
-
-
+
{{scope.row.loginNumber ? scope.row.loginNumber : 0}}
-
+
查看
编辑
@@ -90,7 +85,6 @@
- 用户
{{item.roleName}}
@@ -187,7 +181,7 @@ export default {
userId: '',
accountId: '',
userName: '',
- roleIds: ['user'],
+ roleIds: [],
phone: '',
uniqueIdentification: '',
workNumber: '',
@@ -330,7 +324,7 @@ export default {
},
accountChange(){
if(this.form.account !== this.originalAccount){
- this.$get(`${this.api.checkAccount}?account=${this.form.account}&type=1&platformId=${Setting.platformId}`).then(res => {
+ this.$post(`${this.api.checkAccount}?account=${this.form.account}&type=1&platformId=${Setting.platformId}${this.form.userId ? '&accountId=' + this.form.account : ''}`).then(res => {
this.accountRepeat = false
}).catch(res => {
this.accountRepeat = true
@@ -341,7 +335,7 @@ export default {
},
workNumberChange(){
if(this.form.workNumber !== this.originalWorkNumber){
- this.$get(`${this.api.checkAccount}?workNumber=${this.form.workNumber}&type=2&platformId=${Setting.platformId}`).then(res => {
+ this.$post(`${this.api.checkAccount}?workNumber=${this.form.workNumber}&type=1&platformId=${Setting.platformId}`).then(res => {
this.workNumberRepeat = false
}).catch(res => {
this.workNumberRepeat = true
@@ -370,7 +364,7 @@ export default {
userId: data.userId,
accountId,
userName: data.userName,
- roleId: data.roleId,
+ roleIds: data.roleId.map(e => e.roleId),
phone: data.phone ? data.phone : '暂未绑定',
workNumber: data.workNumber,
email: data.email,
@@ -400,14 +394,7 @@ export default {
// 如果是新增,则生成个时间戳作为唯一标识
if(!data.userId) data.uniqueIdentification = new Date().getTime()
- // 每个用户都有个默认的角色,就是"用户",这是个基础角色,而"用户"的roleId是0,这是写死的
- // 如果没选择任何角色,则只有一个不可勾选的"用户"角色,则把roleId赋值为0
- if(data.roleIds.length == 1){
- data.roleIds = ['0']
- }else{
- // 第一个角色是用户,该角色不用传给后端,只需要传非用户的角色
- data.roleIds = data.roleIds.slice(1)
- }
+ if(!data.roleIds.length) return util.errorMsg('请至少选择一个角色')
if(this.form.userId){
this.$post(this.api.modifyUser,data).then(res => {
this.userVisible = false
diff --git a/src/setting.js b/src/setting.js
index 7f796df..d616945 100644
--- a/src/setting.js
+++ b/src/setting.js
@@ -24,7 +24,7 @@ const Setting = {
showProgressBar: true,
// 接口请求地址
// apiBaseURL: env === 'development' ? 'http://192.168.31.125:9000' : 'http://39.108.250.202:9000',// 佳坤
- apiBaseURL: env === 'development' ? 'http://39.108.250.202:9000' : 'http://39.108.250.202:9000',
+ apiBaseURL: env === 'development' ? 'http://192.168.31.151:9000' : 'http://39.108.250.202:9000',
// 接口请求返回错误时,弹窗的持续时间,单位:秒
modalDuration: 3,
// 接口请求返回错误时,弹窗的类型,可选值为 Message 或 Notice