Update Account
This commit is contained in:
@@ -299,6 +299,7 @@ export default {
|
||||
this.account = data;
|
||||
this.fillData(data);
|
||||
},
|
||||
|
||||
onSuccess(googleUser) {
|
||||
let info = googleUser.getBasicProfile();
|
||||
|
||||
@@ -309,6 +310,7 @@ export default {
|
||||
this.type = 'google';
|
||||
if (!this.$empty(this.email)) this.checkAccount();
|
||||
},
|
||||
|
||||
async checkAccount() {
|
||||
if (this.$empty(this.email)) return;
|
||||
let found = this.$findapi('user');
|
||||
@@ -355,6 +357,7 @@ export default {
|
||||
name: 'email',
|
||||
text: `Tài khoản đang chờ xác thực. <a @click="$emit('resend')">Gửi lại mã</a>`,
|
||||
});
|
||||
this.$router.push({ path: '/account/auth', query: { id: data.id, email: data.email } });
|
||||
}
|
||||
return this.errors.length > 0 ? true : false;
|
||||
},
|
||||
@@ -366,10 +369,11 @@ export default {
|
||||
return;
|
||||
}
|
||||
//check permision
|
||||
if (this.module !== 'website') {
|
||||
let userapps = await this.$getdata('userapps', { user: data.id, apps__code: this.module }, undefined, true);
|
||||
if (!userapps) return this.$router.push('/welcome');
|
||||
}
|
||||
// if (this.module !== 'website') {
|
||||
// let userapps = await this.$getdata('userapps', { user: data.id, apps__code: this.module }, undefined, true);
|
||||
// if (!userapps) return this.$router.push('/welcome');
|
||||
// }
|
||||
|
||||
this.login = data; //store login
|
||||
if (this.$store.state.link) {
|
||||
let ele = this.$copy(data);
|
||||
@@ -394,21 +398,21 @@ export default {
|
||||
window.location.href = href;
|
||||
} else this.redirectUrl();
|
||||
},
|
||||
async sendNoti(obj) {
|
||||
let found = this.$findapi('notiform');
|
||||
found.params.filter = { code: 'login-alert' };
|
||||
const result = await this.$getapi([found]);
|
||||
let data = result[0].data.rows[0];
|
||||
let content = data.detail;
|
||||
content = content.replace('[1]', this.email);
|
||||
content = content.replace('[2]', obj.browser);
|
||||
content = content.replace('[3]', obj.browser_version);
|
||||
content = content.replace('[4]', obj.platform);
|
||||
content = content.replace('[5]', obj.os);
|
||||
content = content.replace('[6]', this.$dayjs().format('DD/MM/YYYY HH:mm'));
|
||||
let ele = { title: data.name, content: content, user: [obj.user.toString()], type: 1 };
|
||||
await this.$insertapi('notification', ele);
|
||||
},
|
||||
// async sendNoti(obj) {
|
||||
// let found = this.$findapi('notiform');
|
||||
// found.params.filter = { code: 'login-alert' };
|
||||
// const result = await this.$getapi([found]);
|
||||
// let data = result[0].data.rows[0];
|
||||
// let content = data.detail;
|
||||
// content = content.replace('[1]', this.email);
|
||||
// content = content.replace('[2]', obj.browser);
|
||||
// content = content.replace('[3]', obj.browser_version);
|
||||
// content = content.replace('[4]', obj.platform);
|
||||
// content = content.replace('[5]', obj.os);
|
||||
// content = content.replace('[6]', this.$dayjs().format('DD/MM/YYYY HH:mm'));
|
||||
// let ele = { title: data.name, content: content, user: [obj.user.toString()], type: 1 };
|
||||
// await this.$insertapi('notification', ele);
|
||||
// },
|
||||
async logInWithFacebook() {
|
||||
if (window.FB) {
|
||||
let self = this;
|
||||
|
||||
Reference in New Issue
Block a user