Merge remote-tracking branch 'origin/master'

This commit is contained in:
q4speed 2020-09-23 16:12:09 +08:00
commit c0fe259276
3 changed files with 19 additions and 1 deletions

View File

@ -47,7 +47,7 @@ public class TestCaseCommentService {
testCaseWithBLOBs = testCaseMapper.selectByPrimaryKey(request.getCaseId()); testCaseWithBLOBs = testCaseMapper.selectByPrimaryKey(request.getCaseId());
SaveTestCaseReviewRequest caseReviewRequest = new SaveTestCaseReviewRequest(); SaveTestCaseReviewRequest caseReviewRequest = new SaveTestCaseReviewRequest();
List<String> userIds = new ArrayList<>(); List<String> userIds = new ArrayList<>();
userIds.add(testCaseComment.getAuthor()); userIds.add(testCaseWithBLOBs.getMaintainer());
mailService.sendHtml(userIds, "comment", caseReviewRequest, request, testCaseWithBLOBs); mailService.sendHtml(userIds, "comment", caseReviewRequest, request, testCaseWithBLOBs);
} }

View File

@ -26,6 +26,9 @@ const router = new VueRouter({
}); });
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
redirectLoginPath(to.fullPath);
//解决localStorage清空cookie没失效导致的卡死问题 //解决localStorage清空cookie没失效导致的卡死问题
if (!localStorage.getItem('Admin-Token')) { if (!localStorage.getItem('Admin-Token')) {
axios.get("/signout"); axios.get("/signout");
@ -38,4 +41,17 @@ router.beforeEach((to, from, next) => {
} }
}); });
// 登入后跳转至原路径
function redirectLoginPath(originPath) {
let redirectUrl = sessionStorage.getItem('redirectUrl');
let loginSuccess = sessionStorage.getItem('loginSuccess');
sessionStorage.setItem('redirectUrl', originPath);
if (redirectUrl && loginSuccess) {
sessionStorage.removeItem('loginSuccess');
router.push(redirectUrl);
}
sessionStorage.removeItem('loginSuccess');
}
export default router export default router

View File

@ -143,12 +143,14 @@
normalLogin() { normalLogin() {
this.result = this.$post("signin", this.form, response => { this.result = this.$post("signin", this.form, response => {
saveLocalStorage(response); saveLocalStorage(response);
sessionStorage.setItem('loginSuccess', 'true');
this.getLanguage(response.data.language); this.getLanguage(response.data.language);
}); });
}, },
ldapLogin() { ldapLogin() {
this.result = this.$post("ldap/signin", this.form, response => { this.result = this.$post("ldap/signin", this.form, response => {
saveLocalStorage(response); saveLocalStorage(response);
sessionStorage.setItem('loginSuccess', 'true');
this.getLanguage(response.data.language); this.getLanguage(response.data.language);
}); });
}, },