Skip to content

Commit

Permalink
fix: 前端交互问题修复 TencentBlueKing#879 (TencentBlueKing#880)
Browse files Browse the repository at this point in the history
  • Loading branch information
yuri0528 authored Jan 11, 2023
1 parent 46bcd4f commit 091fc90
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 41 deletions.
2 changes: 1 addition & 1 deletion src/pages/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"express-art-template": "1.0.1",
"intl-tel-input": "16.0.0",
"js-base64": "^3.7.2",
"jsencrypt": "^3.3.1",
"jsencrypt": "3.3.1",
"jsonp": "0.2.1",
"query-string": "6.5.0",
"sortablejs": "1.10.1",
Expand Down
12 changes: 2 additions & 10 deletions src/pages/src/views/audit/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
<template v-if="isOperate">
<td><div class="text-overflow-hidden" v-bk-overflow-tips>{{item.operator}}</div></td>
<td><div class="text-overflow-hidden" v-bk-overflow-tips>{{item.display_name || '--'}}</div></td>
<td><div class="text-overflow-hidden">{{item.datetime | convertIsoTime}}</div></td>
<td><div class="text-overflow-hidden">{{item.datetime}}</div></td>
<td><div class="text-overflow-hidden" v-bk-overflow-tips>{{item.client_ip}}</div></td>
<td><div class="text-overflow-hidden">{{item.operation}}</div></td>
<td><div class="text-overflow-hidden" v-bk-overflow-tips>{{item.category_display_name}}</div></td>
Expand All @@ -69,7 +69,7 @@
<template v-else>
<td><div class="text-overflow-hidden">{{item.username}}</div></td>
<td><div class="text-overflow-hidden">{{item.display_name || '--'}}</div></td>
<td><div class="text-overflow-hidden">{{item.datetime | convertIsoTime}}</div></td>
<td><div class="text-overflow-hidden">{{item.datetime}}</div></td>
<td><div class="text-overflow-hidden">{{item.client_ip}}</div></td>
<td><div class="text-overflow-hidden" v-bk-tooltips="errorTips(item)">
<i :class="['status', { 'status-fail': !item.is_success }]" />
Expand Down Expand Up @@ -109,14 +109,6 @@
<script>
export default {
name: 'AuditIndex',
filters: {
convertIsoTime(iso) {
const arr = iso.split('T');
const year = arr[0];
const time = arr[1].split('.')[0];
return `${year} ${time}`;
},
},
data() {
return {
basicLoading: true,
Expand Down
59 changes: 29 additions & 30 deletions src/pages/src/views/organization/details/UserMaterial.vue
Original file line number Diff line number Diff line change
Expand Up @@ -378,49 +378,48 @@ export default {
return;
}
this.clickSecond = true;
try {
this.$emit('showBarLoading');
let data = {};
// 任何人在重置admin密码时,需要先输入原密码
if (this.isAdmin) {
// passwordData.old_password = this.oldPassword.trim();
if (this.isRsaEncrypted) {
data = {
password: this.Rsa.rsaPublicData(this.newPassword.trim(), this.publicKey),
old_password: this.Rsa.rsaPublicData(this.oldPassword.trim(), this.publicKey),
};
} else {
data = {
password: this.newPassword.trim(),
old_password: this.oldPassword.trim(),
};
}
this.$emit('showBarLoading');
let data = {};
// 任何人在重置admin密码时,需要先输入原密码
if (this.isAdmin) {
if (this.isRsaEncrypted) {
data = {
password: this.Rsa.rsaPublicData(this.newPassword.trim(), this.publicKey),
old_password: this.Rsa.rsaPublicData(this.oldPassword.trim(), this.publicKey),
};
} else {
if (this.isRsaEncrypted) {
data = { password: this.Rsa.rsaPublicData(this.newPassword.trim(), this.publicKey) };
} else {
data = { password: this.newPassword.trim() };
}
data = {
password: this.newPassword.trim(),
old_password: this.oldPassword.trim(),
};
}
} else {
if (this.isRsaEncrypted) {
data = { password: this.Rsa.rsaPublicData(this.newPassword.trim(), this.publicKey) };
} else {
data = { password: this.newPassword.trim() };
}
this.patchProfile(this.currentProfile.id, data);
}
this.patchProfile(this.currentProfile.id, data);
this.isShowReset = false;
},
async patchProfile(id, data) {
try {
await this.$store.dispatch('organization/patchProfile', {
id,
data,
});
this.$bkMessage({
message: this.$t('重置密码成功'),
theme: 'success',
});
this.isShowReset = false;
} catch (e) {
console.warn(e);
} finally {
this.clickSecond = false;
this.$emit('closeBarLoading');
}
},
async patchProfile(id, data) {
await this.$store.dispatch('organization/patchProfile', {
id,
data,
});
},
closeResetDialog(e) {
if (e.target.innerText === '重置密码') return;
this.isShowReset = false;
Expand Down

0 comments on commit 091fc90

Please sign in to comment.