Changeset View
Changeset View
Standalone View
Standalone View
src/resources/vue/Widgets/PasswordInput.vue
Show First 20 Lines • Show All 58 Lines • ▼ Show 20 Lines | export default { | ||||
methods: { | methods: { | ||||
checkPolicy(password) { | checkPolicy(password) { | ||||
if (this.cancelToken) { | if (this.cancelToken) { | ||||
this.cancelToken.cancel() | this.cancelToken.cancel() | ||||
} | } | ||||
const post = { password, user: this.user } | const post = { password, user: this.user } | ||||
if (!post.user && this.$store.state.authInfo) { | if (!post.user && this.$root.authInfo) { | ||||
post.user = this.$store.state.authInfo.id | post.user = this.$root.authInfo.id | ||||
} | } | ||||
const cancelToken = axios.CancelToken; | const cancelToken = axios.CancelToken; | ||||
this.cancelToken = cancelToken.source(); | this.cancelToken = cancelToken.source(); | ||||
axios.post('/api/auth/password-policy/check', post, { cancelToken: this.cancelToken.token }) | axios.post('/api/auth/password-policy/check', post, { cancelToken: this.cancelToken.token }) | ||||
.then(response => { | .then(response => { | ||||
if (response.data.list) { | if (response.data.list) { | ||||
Show All 18 Lines |