|
@@ -22,6 +22,12 @@ const FROM_LOCAL_STORAGE = JSON.parse(localStorage.getItem('workspace') || '{}')
|
|
|
|
|
|
|
|
const INIT = Object.keys(FROM_LOCAL_STORAGE).length > 0 ? FROM_LOCAL_STORAGE : DEFAULT;
|
|
const INIT = Object.keys(FROM_LOCAL_STORAGE).length > 0 ? FROM_LOCAL_STORAGE : DEFAULT;
|
|
|
|
|
|
|
|
|
|
+const convert = (url: string) => {
|
|
|
|
|
+ const u = new URL(url);
|
|
|
|
|
+ u.host = 'seecoder-gitlab-gitlab.seec.seecoder.cn';
|
|
|
|
|
+ return u.href;
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
const actions: ActionTree<WorkspaceState, RootState> = {
|
|
const actions: ActionTree<WorkspaceState, RootState> = {
|
|
|
clearWorkspace({ commit }) {
|
|
clearWorkspace({ commit }) {
|
|
|
commit('updateProjectList', []);
|
|
commit('updateProjectList', []);
|
|
@@ -29,7 +35,10 @@ const actions: ActionTree<WorkspaceState, RootState> = {
|
|
|
commit('updateMembers', []);
|
|
commit('updateMembers', []);
|
|
|
},
|
|
},
|
|
|
async refreshProjectList({ commit }) {
|
|
async refreshProjectList({ commit }) {
|
|
|
- const projectList = (await ProjectAPI.getProjectListByUserId()) || [];
|
|
|
|
|
|
|
+ const projectList = ((await ProjectAPI.getProjectListByUserId()) || []) as unknown as Array<Project>;
|
|
|
|
|
+ projectList.forEach((project) => {
|
|
|
|
|
+ project.gitRemoteUrl = convert(project.gitRemoteUrl);
|
|
|
|
|
+ });
|
|
|
commit('updateProjectList', projectList);
|
|
commit('updateProjectList', projectList);
|
|
|
},
|
|
},
|
|
|
async changeProject({ commit }, payload: ChangeProjectPayload) {
|
|
async changeProject({ commit }, payload: ChangeProjectPayload) {
|