This commit is contained in:
parent
a0fb7b1d8e
commit
580c2c6f10
|
@ -6,10 +6,11 @@ module.exports = Self => {
|
|||
Self.send = async(senderFk, destination, message, options) => {
|
||||
const smsConfig = await models.SmsConfig.findOne();
|
||||
|
||||
if (destination.length == 9) {
|
||||
const spainPrefix = '0034';
|
||||
const [{prefix: spainPrefix}] = await Self.rawSql(
|
||||
'SELECT prefix FROM pbx.prefix WHERE country = ?', ['es'], options
|
||||
);
|
||||
if (destination.length == 9)
|
||||
destination = spainPrefix + destination;
|
||||
}
|
||||
|
||||
const params = {
|
||||
api_key: smsConfig.apiKey,
|
||||
|
@ -34,7 +35,7 @@ module.exports = Self => {
|
|||
console.error(e);
|
||||
}
|
||||
if (!options?.insert) return;
|
||||
// return response;
|
||||
|
||||
const [result] = response.result;
|
||||
const error = result.error_id;
|
||||
|
||||
|
|
|
@ -30,8 +30,9 @@
|
|||
val="email"
|
||||
ng-model="$ctrl.method"
|
||||
>
|
||||
</vn-radio></vn-vertical
|
||||
></vn-one>
|
||||
</vn-radio>
|
||||
</vn-vertical>
|
||||
</vn-one>
|
||||
<div class="text-secondary" ng-if="$ctrl.method && $ctrl.user">
|
||||
<span ng-if="$ctrl.method ==='sms'" translate>
|
||||
We will sent you a sms to recover your password
|
||||
|
|
|
@ -28,10 +28,10 @@
|
|||
rule="VnUser">
|
||||
</vn-textfield>
|
||||
<vn-textfield
|
||||
vn-one
|
||||
label="Recovery phone"
|
||||
ng-model="$ctrl.user.recoveryPhone"
|
||||
disabled="$root.user.id !== $ctrl.user.id"
|
||||
vn-one
|
||||
label="Recovery phone"
|
||||
ng-model="$ctrl.user.recoveryPhone"
|
||||
disabled="$root.user.id !== $ctrl.user.id"
|
||||
>
|
||||
</vn-textfield>
|
||||
<vn-autocomplete
|
||||
|
|
Loading…
Reference in New Issue