xiaoshushu vor 4 Jahren
Ursprung
Commit
347a4e4be8
3 geänderte Dateien mit 10 neuen und 20 gelöschten Zeilen
  1. 2 4
      src/permission.js
  2. 3 10
      src/router/index.js
  3. 5 6
      src/views/template/index.vue

+ 2 - 4
src/permission.js

@@ -7,7 +7,7 @@ import { getToken } from '@/utils/auth'
 
 NProgress.configure({ showSpinner: false })
 
-const whiteList = ['/login', '/auth-redirect', '/bind', '/register', '/template','/news/detail/']
+const whiteList = ['/login', '/auth-redirect', '/bind', '/register','/template/','/news/detail/']
 
 router.beforeEach((to, from, next) => {
   NProgress.start()
@@ -56,9 +56,7 @@ router.beforeEach((to, from, next) => {
         //设置页面标题
         document.title =to.meta.title;
         k++;
-      }else{
-		document.title ='传承云管理系统';
-	  }
+      }
     }
     // 在免登录白名单,直接进入
     if(k >= 0){

+ 3 - 10
src/router/index.js

@@ -124,8 +124,9 @@ export const constantRoutes = [{
   {
     path: '/template/t1/:id(\\d+)',
     component: (resolve) => require(['@/views/template/t1'], resolve),
+    name: 'template_t1',
     meta: {
-      title: '个人'
+      title: '个人详情'
     },
     hidden: true
   },
@@ -134,15 +135,7 @@ export const constantRoutes = [{
     component: (resolve) => require(['@/views/template/index'], resolve),
     name: 'template_index',
     meta: {
-      title: '个人生平'
-    },
-    hidden: true
-  },
-  {
-    path: '/template/t/:id(\\d+)',
-    component: (resolve) => require(['@/views/template/t'], resolve),
-    meta: {
-      title: '个人页'
+      title: '个人详情'
     },
     hidden: true
   },

+ 5 - 6
src/views/template/index.vue

@@ -2,12 +2,12 @@
   <div class="contents" v-loading="loading">
     <div class="grxq gary">
       <div class="top">
-        <div><audio controls autoplay loop src="https://data2.rrxh5.cc//2015/09/01/1441073275128.mp3">您的浏览器不支持 audio 标签。</audio></div>
+        <div v-if="user.state==4"><audio controls autoplay loop src="https://data2.rrxh5.cc//2015/09/01/1441073275128.mp3">您的浏览器不支持 audio 标签。</audio></div>
         <div class="name">
-          {{ user.name||'无名氏' }}
+          {{ user.name||user.nickName }}
           <div class="date">{{ user.birthday }}</div>
         </div>
-        <img :src="user.avatar?baseUrl + user.avatar:'https://file2.rrxh5.cc/g2/c1/2018/04/05/1522926275241.jpg@!user_image_200x1'" />
+        <img :src="user.avatar?baseUrl + user.avatar:require('@/assets/image/avataaars.jpg')" />
         <div class="clearfix"></div>
       </div>
       <!--个人详情-->
@@ -48,7 +48,7 @@
         </section>
       </div>
       <!--留言-->
-      <div style="margin-top: 10px;">
+      <div style="margin-top: 10px;" v-if="user.state==4">
         <el-table :data="messageOptions">
           <el-table-column label="TA的留念" prop="name" width="80" />
           <el-table-column prop="contents" />
@@ -100,7 +100,7 @@
       </div>
     </el-drawer>
     <!--弹出留言-->
-    <div class="add_btn" @click="drawer = true">留言</div>
+    <div class="add_btn" @click="drawer = true" v-if="user.state==4">留言</div>
   </div>
 </template>
 <script>
@@ -136,7 +136,6 @@ export default {
   mounted(e) {
     this.queryParams.userId = this.$route.params.id;
     listProfiles({ appUserId: this.$route.params.id }).then(res => {
-      console.log('zx:' + JSON.stringify(res));
       this.list = res.profileList;
       this.user = res.user;
       // 留言