PanJiaChen/vue-admin-template · error · Error
The password can not be less than 6 digits
Error message
The password can not be less than 6 digits
What it means
Login form validation error raised by the password rule: fires when the password field has fewer than 6 characters, enforcing a minimum length before the login request is sent.
Source
Thrown at src/views/login/index.vue:70
</div>
</template>
<script>
import { validUsername } from '@/utils/validate'
export default {
name: 'Login',
data() {
const validateUsername = (rule, value, callback) => {
if (!validUsername(value)) {
callback(new Error('Please enter the correct user name'))
} else {
callback()
}
}
const validatePassword = (rule, value, callback) => {
if (value.length < 6) {
callback(new Error('The password can not be less than 6 digits'))
} else {
callback()
}
}
return {
loginForm: {
username: 'admin',
password: '111111'
},
loginRules: {
username: [{ required: true, trigger: 'blur', validator: validateUsername }],
password: [{ required: true, trigger: 'blur', validator: validatePassword }]
},
loading: false,
passwordType: 'password',
redirect: undefined
}
},View on GitHub (pinned to 4c18a3f47b)
Solutions
- Enter a password of at least 6 characters
- Treat the min-length rule as a UX guard only; real password policy must be enforced server-side
- Adjust the length threshold in validatePassword if the backend policy differs
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at src/views/login/index.vue:70 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of PanJiaChen/vue-admin-template@4c18a3f47b (2026-09-02).
Data as JSON: /api/errors/130d8fe99bcacd1f.
Report an issue: GitHub.