Skip to content

Commit

Permalink
feat(login): remove unnecessary logic
Browse files Browse the repository at this point in the history
  • Loading branch information
h7ml committed May 6, 2022
1 parent 153b249 commit 82e401f
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@
},
"config": {
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
"path": "cz-conventional-changelog"
}
},
"husky": {
Expand Down
25 changes: 17 additions & 8 deletions src/dgiot/components/DgiotRoleTree/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@
},
data() {
return {
firstChild: false,
updateKey: 1,
// 在需要对节点进行过滤时,调用 Tree 实例的filter方法,参数为关键字。
filterText: '',
Expand Down Expand Up @@ -157,6 +158,12 @@
watch: {},
created() {
this.$nextTick(() => {
// 确保只有获取不到currentDepartment 再点击
console.error(this.currentDepartment, 'this.currentDepartment')
if (!this.currentDepartment?.objectId) {
document.querySelector('.el-tree-node__content').click()
this.firstChild = true
}
this.$refs.tree.setCurrentKey(this.currentDepartment.objectId)
})
},
Expand Down Expand Up @@ -246,14 +253,15 @@
.getDgiotlog('src/dgiot/components/DgiotRoleTree/index.vue')
.info('DgiotRoleTree ->', data, checked)
console.groupEnd()
this.$baseNotify(
this.$translateTitle('message.Department has been switched to') +
data.depname,
this.$translateTitle('message.Tips'),
'success',
'',
5000
)
if (!this.firstChild)
this.$baseNotify(
this.$translateTitle('message.Department has been switched to') +
data.depname,
this.$translateTitle('message.Tips'),
'success',
'',
5000
)
} catch (error) {
dgiotlog.log(error)
this.$baseMessage(
Expand All @@ -262,6 +270,7 @@
'dgiot-hey-message-error'
)
}
this.firstChild = false
},
handleCheckClick(data, checked) {
console.groupCollapsed(
Expand Down
1 change: 1 addition & 0 deletions src/views/DeviceCloud/manage/component/task.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<!-- Language: vue -->
<!-- Path: src/views/DeviceCloud/manage/component/task.vue -->

<template>
<div class="task-con-container">{{ productid }}</div>
</template>
Expand Down
3 changes: 2 additions & 1 deletion src/views/MultiTenant/user/login/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@
import { Roletree } from '@/api/Menu'
import { Permission } from '@/api/Permission'
import { getProtocol } from '@/api/Protocol/index'
export default {
name: 'Login',
directives: {
Expand Down Expand Up @@ -204,6 +205,7 @@
logo: 'user/logo',
objectId: 'user/objectId',
backgroundimage: 'user/backgroundimage',
currentDepartment: 'user/currentDepartment',
}),
},
watch: {
Expand Down Expand Up @@ -340,7 +342,6 @@
}
await setTimeout(async () => {
if (this.objectId) {
document.querySelector('.el-tree-node__content').click()
console.log('userid', this.objectId)
const { results: permission = [] } = await Permission()
this.setPermission(permission)
Expand Down

0 comments on commit 82e401f

Please sign in to comment.