推广管理
This commit is contained in:
@@ -226,11 +226,27 @@ export default {
|
||||
},
|
||||
initAccountSelection() {
|
||||
const q = this.$route.query;
|
||||
const storedEmailId = localStorage.getItem('mailboxCollect_j_email_id');
|
||||
const storedJournalId = localStorage.getItem('mailboxCollect_journal_id');
|
||||
|
||||
// 1. 兼容老链接:如果地址栏里带有参数,优先用并写入本地
|
||||
if (q.j_email_id) {
|
||||
this.loadAccountById(q.j_email_id);
|
||||
} else {
|
||||
this.openAccountDialog();
|
||||
localStorage.setItem('mailboxCollect_j_email_id', q.j_email_id);
|
||||
if (q.journal_id) {
|
||||
localStorage.setItem('mailboxCollect_journal_id', q.journal_id);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// 2. 否则尝试从本地缓存恢复上次选择
|
||||
if (storedEmailId) {
|
||||
this.loadAccountById(storedEmailId);
|
||||
return;
|
||||
}
|
||||
|
||||
// 3. 都没有则弹出选择账号弹窗
|
||||
this.openAccountDialog();
|
||||
},
|
||||
loadDefaultAccount() {
|
||||
this.$api.post(API.getAllJournal, {}).then(res => {
|
||||
@@ -310,13 +326,17 @@ export default {
|
||||
chooseAccount(row) {
|
||||
this.selectedAccount = row;
|
||||
this.accountDialogVisible = false;
|
||||
this.closeDetail();
|
||||
// 回填到地址栏
|
||||
const q = Object.assign({}, this.$route.query, {
|
||||
j_email_id: row.j_email_id,
|
||||
journal_id: row.journal_id
|
||||
});
|
||||
this.$router.replace({ path: this.$route.path, query: q });
|
||||
this.closeDetail();
|
||||
|
||||
// 将所选邮箱配置持久化到本地,避免暴露在地址栏
|
||||
if (row && row.j_email_id) {
|
||||
localStorage.setItem('mailboxCollect_j_email_id', String(row.j_email_id));
|
||||
}
|
||||
if (row && row.journal_id) {
|
||||
localStorage.setItem('mailboxCollect_journal_id', String(row.journal_id));
|
||||
}
|
||||
|
||||
// 不再写入路由 query,直接拉取数据
|
||||
this.fetchData();
|
||||
},
|
||||
handleAccountDialogBeforeClose(done) {
|
||||
@@ -521,7 +541,7 @@ export default {
|
||||
.folder-list li.active { background: #edeef0; color: #006699; font-weight: bold; border-right: 3px solid #006699; }
|
||||
.badge { margin-left: auto; background: #ddd; padding: 2px 8px; border-radius: 10px; font-size: 12px; }
|
||||
|
||||
.sidebar-footer { padding: 15px 20px; border-top: 1px solid #eee; background: #f8f9fa; }
|
||||
.sidebar-footer { padding: 10px 0px; border-top: 1px solid #eee; background: #f8f9fa; }
|
||||
.user-card { display: flex; align-items: center; margin-bottom: 8px; overflow: hidden; }
|
||||
.user-avatar { flex-shrink: 0; background: #ffeded; color: #f56c6c; }
|
||||
.user-detail { margin-left: 10px; overflow: hidden; flex: 1; }
|
||||
|
||||
Reference in New Issue
Block a user