Skip to content

Commit 11ec87c

Browse files
replace hardcoded client ids with dynamic first entries from clientMap
1 parent 5fecffa commit 11ec87c

1 file changed

Lines changed: 10 additions & 9 deletions

File tree

web/lrm/client/pages/index.vue

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -80,22 +80,23 @@ export default {
8080
name: 'Login',
8181
8282
data() {
83+
const clientMap = this.$config.public.clientMap;
84+
const clientIds = new Map(clientMap);
85+
const keys = [...clientIds.keys()];
86+
const form = {
87+
clientId: keys[0] || null,
88+
targetId: keys[1] || null,
89+
tester: false,
90+
};
8391
return {
8492
store: useMainStore(),
8593
alert: {
8694
show: false,
8795
type: 'error',
8896
message: '',
8997
},
90-
clientIds:
91-
Object.keys(this.$config.public.clientMap).length === 0
92-
? new Map()
93-
: new Map(this.$config.public.clientMap),
94-
form: {
95-
clientId: [...new Map(this.$config.public.clientMap).keys()][0] || null,
96-
targetId: [...new Map(this.$config.public.clientMap).keys()][1] || null,
97-
tester: false,
98-
},
98+
clientIds,
99+
form,
99100
rules: {
100101
required: (v) => !!v || 'This field is required',
101102
testTargetId: (v) => {

0 commit comments

Comments
 (0)