Browse Source

Merge remote-tracking branch 'origin/seec' into seec

yhd12345 4 years ago
parent
commit
ebae5b0c63

+ 1 - 1
src/components/InfoCard.vue

@@ -19,7 +19,7 @@
       <div style="font-size: x-small">{{ email }}</div>
       <div style="font-size: x-small">{{ email }}</div>
     </div>
     </div>
     <el-button class="info-card-button" v-if="isLogin" plain round size="small" type="primary" @click="signOut">登出</el-button>
     <el-button class="info-card-button" v-if="isLogin" plain round size="small" type="primary" @click="signOut">登出</el-button>
-    <el-button class="info-card-button" v-else plain round size="small" type="primary" @click="this.$router.push('/auth')">登录/注册</el-button>
+    <el-button class="info-card-button" v-else plain round size="small" type="primary" @click="this.$router.push('/login')">登录/注册</el-button>
   </div>
   </div>
 </template>
 </template>
 
 

+ 17 - 2
src/components/project/ProjectLongCard.vue

@@ -16,7 +16,7 @@
       </div>
       </div>
       <el-button v-if="isTeacher" size="small" type="primary"
       <el-button v-if="isTeacher" size="small" type="primary"
                  @click.stop="$emit('switch')">
                  @click.stop="$emit('switch')">
-        设为{{ isPublic ? '私有' : '公共' }}
+        设为{{ isPublic ? "私有" : "公共" }}
       </el-button>
       </el-button>
       <el-button v-if="isPublic&&!isTeacher" size="small" type="primary"
       <el-button v-if="isPublic&&!isTeacher" size="small" type="primary"
                  @click.stop="$emit('fork')">
                  @click.stop="$emit('fork')">
@@ -25,7 +25,10 @@
     </div>
     </div>
     <el-divider v-if="project.name"/>
     <el-divider v-if="project.name"/>
     <div v-if="project.name">描述:{{ project.description }}</div>
     <div v-if="project.name">描述:{{ project.description }}</div>
-    <div v-if="project.name">链接:{{ project.gitRemoteUrl }}</div>
+    <div v-if="project.name">
+      <span>链接:{{ project.gitRemoteUrl }}</span>
+      <i class="el-icon-document-copy" @click.stop="copyGitUrl"></i>
+    </div>
   </el-card>
   </el-card>
 </template>
 </template>
 
 
@@ -66,6 +69,10 @@ export default {
         window.open("https://devcloud.seec.seecoder.cn/project/" + this.project.id + "/schedule?id_token=" + this.$store.state.user.token);
         window.open("https://devcloud.seec.seecoder.cn/project/" + this.project.id + "/schedule?id_token=" + this.$store.state.user.token);
       }
       }
     },
     },
+    async copyGitUrl(){
+      await navigator.clipboard.writeText(this.project.gitRemoteUrl);
+      this.$message.success("复制成功!");
+    },
   },
   },
 };
 };
 </script>
 </script>
@@ -85,6 +92,14 @@ export default {
 }
 }
 
 
 .project-long-card-member:hover {
 .project-long-card-member:hover {
+  /*color: #409EFF;*/
+}
+
+.el-icon-document-copy {
+  margin-left: 10px;
+}
+
+.el-icon-document-copy:hover {
   color: #409EFF;
   color: #409EFF;
 }
 }
 </style>
 </style>

+ 0 - 1
src/views/AuthPage/components/AuthCard.vue

@@ -348,7 +348,6 @@ export default {
                       type: "success",
                       type: "success",
                       duration: 1000,
                       duration: 1000,
                     });
                     });
-                    console.log(res);
                     setTimeout(() => {
                     setTimeout(() => {
                       if (!res.data.data.redirectUri) {
                       if (!res.data.data.redirectUri) {
                         if (this.$route.params.login_to) {
                         if (this.$route.params.login_to) {

+ 1 - 1
src/views/CoursePage/CoursePage.vue

@@ -48,7 +48,7 @@
         <div v-if="this.activeIndex === '2' && !isLogin">
         <div v-if="this.activeIndex === '2' && !isLogin">
           请先
           请先
           <span style="cursor: pointer;color: #409eff"
           <span style="cursor: pointer;color: #409eff"
-                @click="$router.push('/auth')">登录</span>
+                @click="$router.push('/login')">登录</span>
         </div>
         </div>
       </el-card>
       </el-card>
     </el-col>
     </el-col>

+ 10 - 17
src/views/CoursePage/tabs/ProjectTab.vue

@@ -2,7 +2,7 @@
   <div class="project-tab">
   <div class="project-tab">
     <el-button v-if="isCreator"
     <el-button v-if="isCreator"
                class="tabs-function-button"
                class="tabs-function-button"
-               type="primary" plain
+               type="primary"
                @click="openProjectDialog">
                @click="openProjectDialog">
       新建项目
       新建项目
     </el-button>
     </el-button>
@@ -122,23 +122,16 @@ export default {
       }
       }
     },
     },
 
 
-    handleForkProject(id) {
+    async handleForkProject(id) {
       const _this = this;
       const _this = this;
-      ElMessageBox.prompt("请输入新项目名称", "Fork", {
-        confirmButtonText: "确认",
-        cancelButtonText: "取消",
-        inputPlaceholder: "默认为项目Id-用户Username",
-      })
-        .then(async ({value}) => {
-          const res = (await _this.$apis.forkProject(id, value)).data;
-          if (!res.code) {
-            _this.projects.private.push(res.data);
-            _this.projectTabName = "private";
-            ElMessage.success("Fork完成");
-          } else {
-            ElMessage.error(res.message);
-          }
-        });
+      const res = (await _this.$apis.forkProject(id, null)).data;
+      if (!res.code) {
+        _this.projects.private.push(res.data);
+        _this.projectTabName = "private";
+        ElMessage.success("Fork完成");
+      } else {
+        ElMessage.error(res.message);
+      }
     },
     },
 
 
     async handleSwitchProject(id) {
     async handleSwitchProject(id) {

+ 1 - 1
src/views/ProjectPage/ProjectPage.vue

@@ -76,7 +76,7 @@
         <div v-if="this.activeIndex === '2' && !isLogin">
         <div v-if="this.activeIndex === '2' && !isLogin">
           请先
           请先
           <span style="cursor: pointer;color: #409eff"
           <span style="cursor: pointer;color: #409eff"
-                @click="$router.push('/auth')">登录</span>
+                @click="$router.push('/login')">登录</span>
         </div>
         </div>
       </el-card>
       </el-card>
     </el-col>
     </el-col>

+ 1 - 1
src/views/TestPage/TestPage.vue

@@ -96,7 +96,7 @@
         <div v-if="this.activeIndex === '2' && !isLogin">
         <div v-if="this.activeIndex === '2' && !isLogin">
           请先
           请先
           <span style="cursor: pointer;color: #409eff"
           <span style="cursor: pointer;color: #409eff"
-                @click="$router.push('/auth')">登录</span>
+                @click="$router.push('/login')">登录</span>
         </div>
         </div>
       </el-card>
       </el-card>
     </el-col>
     </el-col>