changes
This commit is contained in:
@@ -51,7 +51,7 @@ export default {
|
||||
methods: {
|
||||
async confirm() {
|
||||
if (this.checkError()) return this.$snackbar("Mã phê duyệt gồm 4 số từ 0-9");
|
||||
let user = await this.$getdata("user", undefined, { filter: { id: this.$store.state.login.id } }, true);
|
||||
let user = await this.$getdata("user", { first: true, filter: { id: this.$store.state.login.id } });
|
||||
user.approval_code = this.code;
|
||||
await this.$updateapi("user", user);
|
||||
},
|
||||
|
||||
@@ -117,7 +117,10 @@ export default {
|
||||
};
|
||||
},
|
||||
async created() {
|
||||
this.record = await this.$getdata("user", undefined, { filter: { id: this.row.id } }, true);
|
||||
this.record = await this.$getdata("user", {
|
||||
first: true,
|
||||
filter: { id: this.row.id },
|
||||
});
|
||||
this.radioBlocked = this.record.blocked ? 1 : 0;
|
||||
},
|
||||
methods: {
|
||||
@@ -158,12 +161,14 @@ export default {
|
||||
this.$set(this.check, v.code, this.check[v.code] ? false : true);
|
||||
},
|
||||
async setTokenExpiry() {
|
||||
let rows = await this.$getdata("token", {
|
||||
user: this.record.id,
|
||||
expiry: 0,
|
||||
const rows = await this.$getdata("token", {
|
||||
filter: {
|
||||
user: this.record.id,
|
||||
expiry: 0,
|
||||
},
|
||||
});
|
||||
if (rows.length === 0) return;
|
||||
rows.map((v) => (v.expiry = 1));
|
||||
rows.forEach((v) => (v.expiry = 1));
|
||||
this.$insertapi("token", rows, undefined, true);
|
||||
},
|
||||
},
|
||||
|
||||
@@ -321,7 +321,7 @@ export default {
|
||||
if (this.checkError()) return;
|
||||
let rs = await this.$insertapi("gethash", { text: this.password });
|
||||
this.hash = rs.rows[0];
|
||||
let data = await this.$getdata("user", { username: this.username }, undefined, true);
|
||||
let data = await this.$getdata("user", { first: true, filter: { username: this.username } });
|
||||
if (data) {
|
||||
return this.errors.push({
|
||||
name: "username",
|
||||
|
||||
@@ -104,7 +104,10 @@ export default {
|
||||
methods: {
|
||||
async changePassword() {
|
||||
if (!this.checkPassword()) return;
|
||||
let user = await this.$getdata("user", undefined, { filter: { id: this.row.id } }, true);
|
||||
let user = await this.$getdata("user", {
|
||||
first: true,
|
||||
params: { filter: { id: this.row.id } },
|
||||
});
|
||||
let rs = await this.$insertapi("gethash", { text: this.password });
|
||||
user.password = rs.rows[0];
|
||||
let rs1 = await this.$updateapi("user", user);
|
||||
|
||||
@@ -64,15 +64,13 @@ export default {
|
||||
};
|
||||
},
|
||||
async created() {
|
||||
this.record = await this.$getdata(
|
||||
"user",
|
||||
undefined,
|
||||
{
|
||||
this.record = await this.$getdata("user", {
|
||||
first: true,
|
||||
params: {
|
||||
filter: { id: this.userId || this.store.login.id },
|
||||
values: "id,username,fullname,type,type__name,create_time",
|
||||
},
|
||||
true,
|
||||
);
|
||||
});
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user