refactor: not use axios
gitea/salix/pipeline/head This commit is unstable
Details
gitea/salix/pipeline/head This commit is unstable
Details
This commit is contained in:
parent
617e2d804f
commit
517422be8c
|
@ -20,8 +20,11 @@ module.exports = Self => {
|
|||
|
||||
try {
|
||||
await models.user.resetPassword({email});
|
||||
} catch (e) {
|
||||
return;
|
||||
} catch (err) {
|
||||
if (err.code === 'EMAIL_NOT_FOUND')
|
||||
return;
|
||||
else
|
||||
throw err;
|
||||
}
|
||||
};
|
||||
};
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
DELETE FROM `salix`.`ACL`
|
||||
WHERE model = 'UserPassword';
|
|
@ -1,6 +1,5 @@
|
|||
import ngModule from '../../module';
|
||||
import './style.scss';
|
||||
const axios = require('axios');
|
||||
|
||||
export default class Controller {
|
||||
constructor($scope, $element, $http, vnApp, $translate, $state, $location) {
|
||||
|
@ -16,11 +15,7 @@ export default class Controller {
|
|||
}
|
||||
|
||||
$onInit() {
|
||||
const headers = {
|
||||
Authorization: this.$location.$$search.access_token
|
||||
};
|
||||
|
||||
axios.post('api/UserPasswords/findOne', null, {headers})
|
||||
this.$http.get('UserPasswords/findOne')
|
||||
.then(res => {
|
||||
this.passRequirements = res.data;
|
||||
});
|
||||
|
@ -38,7 +33,7 @@ export default class Controller {
|
|||
|
||||
const newPassword = this.newPassword;
|
||||
|
||||
axios.post('api/users/reset-password', {newPassword}, {headers})
|
||||
this.$http.post('users/reset-password', {newPassword}, {headers})
|
||||
.then(() => {
|
||||
this.vnApp.showSuccess(this.$translate.instant('Password changed!'));
|
||||
this.$state.go('login');
|
||||
|
|
|
@ -30,5 +30,13 @@
|
|||
"type": "number",
|
||||
"required": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"acls": [
|
||||
{
|
||||
"accessType": "READ",
|
||||
"principalType": "ROLE",
|
||||
"principalId": "$everyone",
|
||||
"permission": "ALLOW"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue