leisure-core 1.0.7 → 1.0.9
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
CHANGED
|
@@ -696,6 +696,8 @@ export default {
|
|
|
696
696
|
cancelButtonText: "取消",
|
|
697
697
|
type: "warning",
|
|
698
698
|
}).then(() => {
|
|
699
|
+
const userId = this.$store?.getters?.userinfo?.id ?? "";
|
|
700
|
+
this.$emit("signout", userId);
|
|
699
701
|
this.$router.push({ path: "/" });
|
|
700
702
|
localStorage.clear();
|
|
701
703
|
});
|
|
@@ -362,7 +362,9 @@ export default {
|
|
|
362
362
|
if (this.allowNegative) {
|
|
363
363
|
// 更严格的金额正则:不允许单独的负号、小数点、负号+小数点
|
|
364
364
|
if (this.allowDecimal) {
|
|
365
|
-
amountPattern =
|
|
365
|
+
amountPattern = new RegExp(
|
|
366
|
+
`^-?(?:[1-9]\\d*|0)(?:\\.\\d{0,${this.decimalLimit}})?$|^-?0\\.\\d{0,${this.decimalLimit}}$`
|
|
367
|
+
);
|
|
366
368
|
} else {
|
|
367
369
|
amountPattern = /^-?(?:[1-9]\d*|0)$/;
|
|
368
370
|
}
|
|
@@ -386,7 +388,9 @@ export default {
|
|
|
386
388
|
}
|
|
387
389
|
} else {
|
|
388
390
|
amountPattern = this.allowDecimal
|
|
389
|
-
?
|
|
391
|
+
? new RegExp(
|
|
392
|
+
`^(?:[1-9]\\d*|0)(?:\\.\\d{0,${this.decimalLimit}})?$|^0\\.\\d{0,${this.decimalLimit}}$`
|
|
393
|
+
)
|
|
390
394
|
: /^(?:[1-9]\d*|0)$/;
|
|
391
395
|
if (!amountPattern.test(cleanValue)) {
|
|
392
396
|
isValid = false;
|