-
+
{{$t('test_track.test_case')}}
+
+
+
+
+
+
+
+
import MsCreateBox from '../../../settings/CreateBox';
+ import TestCaseImport from '../components/TestCaseImport';
+ import TestCaseExport from '../components/TestCaseExport';
export default {
name: "TestCaseList",
- components: {MsCreateBox},
+ components: {MsCreateBox, TestCaseImport, TestCaseExport},
data() {
return {
result: {},
@@ -195,6 +206,9 @@
type: 'success'
});
});
+ },
+ refresh() {
+ this.$emit('refresh');
}
}
}
diff --git a/frontend/src/common/js/utils.js b/frontend/src/common/js/utils.js
index 4aa4fe946d..3fb356949d 100644
--- a/frontend/src/common/js/utils.js
+++ b/frontend/src/common/js/utils.js
@@ -28,3 +28,12 @@ export function checkoutCurrentWorkspace() {
// 查看当前用户是否是 lastWorkspaceId 的工作空间用户
return user.userRoles.filter(ur => hasRoles(ROLE_TEST_MANAGER, ROLE_TEST_USER, ROLE_TEST_VIEWER) && user.lastWorkspaceId === ur.sourceId).length > 0;
}
+
+export function saveLocalStorage(response) {
+ // 登录信息保存 cookie
+ localStorage.setItem(TokenKey, JSON.stringify(response.data));
+ let rolesArray = response.data.roles;
+ let roles = rolesArray.map(r => r.id);
+ // 保存角色
+ localStorage.setItem("roles", roles);
+}
diff --git a/frontend/src/login/Login.vue b/frontend/src/login/Login.vue
index 5116a483f0..83c8b81998 100644
--- a/frontend/src/login/Login.vue
+++ b/frontend/src/login/Login.vue
@@ -41,7 +41,7 @@