leisure-core 0.6.21 → 0.6.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/le-home/src/main.vue +26 -8
- package/le-login/src/main.vue +4 -0
- package/package.json +1 -1
package/le-home/src/main.vue
CHANGED
|
@@ -21,6 +21,14 @@
|
|
|
21
21
|
<el-dropdown-menu slot="dropdown">
|
|
22
22
|
<el-dropdown-item command="1">修改密码</el-dropdown-item>
|
|
23
23
|
<el-dropdown-item command="2">退出</el-dropdown-item>
|
|
24
|
+
<el-dropdown-item
|
|
25
|
+
v-for="item in extraDropdownItems"
|
|
26
|
+
:key="item.command"
|
|
27
|
+
:command="item.command"
|
|
28
|
+
:divided="item.divided"
|
|
29
|
+
>
|
|
30
|
+
{{ item.label }}
|
|
31
|
+
</el-dropdown-item>
|
|
24
32
|
</el-dropdown-menu>
|
|
25
33
|
</el-dropdown>
|
|
26
34
|
</div>
|
|
@@ -100,7 +108,7 @@
|
|
|
100
108
|
</el-main>
|
|
101
109
|
</el-container>
|
|
102
110
|
<el-dialog
|
|
103
|
-
title="
|
|
111
|
+
title="个人信息"
|
|
104
112
|
ref="elDialog"
|
|
105
113
|
:visible.sync="showChangePwd"
|
|
106
114
|
width="30%"
|
|
@@ -137,6 +145,9 @@
|
|
|
137
145
|
<el-form-item label="昵称" prop="nick">
|
|
138
146
|
<el-input v-model="ruleForm.nick" autocomplete="off"></el-input>
|
|
139
147
|
</el-form-item>
|
|
148
|
+
<el-form-item label="手机号" prop="phone">
|
|
149
|
+
<el-input v-model="ruleForm.phone" autocomplete="off"></el-input>
|
|
150
|
+
</el-form-item>
|
|
140
151
|
</el-form>
|
|
141
152
|
<div
|
|
142
153
|
ref="pwdref"
|
|
@@ -189,6 +200,10 @@ import { throttle } from "lodash"; // 可选,用于性能优化
|
|
|
189
200
|
export default {
|
|
190
201
|
name: "le-home",
|
|
191
202
|
props: {
|
|
203
|
+
extraDropdownItems: {
|
|
204
|
+
type: Array,
|
|
205
|
+
default: () => [],
|
|
206
|
+
},
|
|
192
207
|
companyInfo: {
|
|
193
208
|
type: Object,
|
|
194
209
|
default: () => ({}),
|
|
@@ -242,6 +257,7 @@ export default {
|
|
|
242
257
|
pwd: "",
|
|
243
258
|
confirmPwd: "",
|
|
244
259
|
nick: this.$store.getters.userinfo.nick,
|
|
260
|
+
phone: this.$store.getters.userinfo.phone,
|
|
245
261
|
},
|
|
246
262
|
rules: {
|
|
247
263
|
pwd: [{ validator: validatePass, trigger: "blur" }],
|
|
@@ -391,12 +407,9 @@ export default {
|
|
|
391
407
|
}
|
|
392
408
|
},
|
|
393
409
|
handleCommand(command) {
|
|
394
|
-
if (command
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
if (command == 2) {
|
|
398
|
-
this.signout();
|
|
399
|
-
}
|
|
410
|
+
if (command === "1") this.changPwd();
|
|
411
|
+
else if (command === "2") this.signout();
|
|
412
|
+
else this.$emit("command", command); // 抛出外部命令
|
|
400
413
|
},
|
|
401
414
|
changPwd() {
|
|
402
415
|
this.changeUid = this.$store.getters.userinfo.id;
|
|
@@ -404,6 +417,10 @@ export default {
|
|
|
404
417
|
this.ruleForm.confirmPwd = "";
|
|
405
418
|
this.showChangePwd = true;
|
|
406
419
|
},
|
|
420
|
+
validatePhone(phone) {
|
|
421
|
+
const phoneRegex = /^1[3-9]\d{9}$/;
|
|
422
|
+
return phoneRegex.test(phone);
|
|
423
|
+
},
|
|
407
424
|
cancelChangePwd() {
|
|
408
425
|
this.showChangePwd = false;
|
|
409
426
|
this.changeUid = "";
|
|
@@ -418,6 +435,7 @@ export default {
|
|
|
418
435
|
confirmPwd: this.ruleForm.confirmPwd,
|
|
419
436
|
uid: this.changeUid,
|
|
420
437
|
nick: this.ruleForm.nick,
|
|
438
|
+
phone: this.ruleForm.phone,
|
|
421
439
|
};
|
|
422
440
|
this.$emit("userChangePwd", params, this.changePwdAfter);
|
|
423
441
|
} else {
|
|
@@ -428,7 +446,7 @@ export default {
|
|
|
428
446
|
},
|
|
429
447
|
changePwdAfter(res) {
|
|
430
448
|
if (res && res.data && res.data.code == "10000") {
|
|
431
|
-
this.$message.success("
|
|
449
|
+
this.$message.success("更新成功");
|
|
432
450
|
localStorage.clear();
|
|
433
451
|
this.$store.commit("setUserInfo", null);
|
|
434
452
|
this.$router.replace({ path: "/" });
|
package/le-login/src/main.vue
CHANGED