lushuncheng před 5 roky
rodič
revize
b65dd9487e

+ 1 - 1
layouts/opacity_header.vue

@@ -25,7 +25,7 @@ export default {
     ...mapState(["isPC", "isWeixin", "deviceType", "noneCommonFooter", "scope"])
   },
   mounted() {
-    console.log("this****", this);
+    // console.log("this****", this);
     this.checkTerminal();
     window.addEventListener("resize", this.checkInnerWidth);
   },

+ 1 - 1
layouts/opacity_header_kf_tmp.vue

@@ -25,7 +25,7 @@ export default {
     ...mapState(["isPC", "isWeixin", "deviceType", "noneCommonFooter", "scope"])
   },
   mounted() {
-    console.log("this****", this);
+    // console.log("this****", this);
     this.checkTerminal();
     window.addEventListener("resize", this.checkInnerWidth);
   },

+ 2 - 4
middleware/authenticated.js

@@ -1,5 +1,3 @@
 export default function ({ store, redirect }) {
-  // if(!store.state.userinfo.uid) {
-  //   redirect('/?loginbox=show')
-  // }
-}
+
+}

+ 2 - 26
middleware/initialize.js

@@ -23,7 +23,7 @@ export default function (context) {
     }
     url = proto + "://" + host;
     cookies = req.headers.cookie;
-    // console.log("server", req.headers)
+    console.log("server", req.headers)
   }
   // Client-side
   if (process.client) {
@@ -34,7 +34,7 @@ export default function (context) {
       proto = "https";
     }
     cookies = document.cookie;
-    // console.log("client", document.location)
+    console.log("client", cookies)
   }
   let groups = {}
   try {
@@ -188,28 +188,4 @@ export default function (context) {
   const matchedScope = host && /(kaifain|jishuin|job)/.exec(host)
 
   matchedScope && context.store.commit('scope:set', matchedScope[1])
-
-  // 301
-  // Server-side
-  /* if (process.server) {
-    console.log("server side redirect 301............");
-    const {
-      req,
-      redirect
-    } = context;
-    let reqUrl = new URL(req.url, url);
-    //todo 暂时去除301跳转
-    // if (reqUrl.pathname.indexOf('/job/') === 0 && url.indexOf('job.') === -1) {
-    //   redirect(301, jobUrl + reqUrl.pathname.replace('/job/', '/') + reqUrl.search)
-    // }
-    if (reqUrl.pathname.indexOf('/kaifain/') === 0 && url.indexOf('kaifain.') === -1) {
-      redirect(301, kaifainUrl + reqUrl.pathname.replace('/kaifain/', '/') + reqUrl.search)
-    }
-    // console.log("server", req.headers)
-
-    // console.log('****** 0000000000000 ******')
-    // console.log(context.app.router)
-    // console.log(context.app.router.options.routes)
-    // console.log('****** 11111111111111 ******')
-  } */
 }

+ 0 - 94
plugins/router.js

@@ -1,101 +1,7 @@
 export default ({ app, context, req, store}) => {
   if (process.client) {
     const { host } = location || {}
-    const isKaifain = host.indexOf('kaifain') !== -1
-    const isJishuin = host.indexOf('jishuin') !== -1
     const isJob = host.indexOf('job') !== -1
-    // console.log('before Route Path', window.__NUXT__.routePath)
-    // console.log("app.router.options.routes", app.router.options.routes)
-    /* if (isKaifain) {
-      window.__NUXT__.routePath = app.context.route.path.replace(/^\/kaifain/, '/')
-      let kaifainIndex = app.router.options.routes.filter(v => v.name === 'kaifain')[0]
-      let kaifainSearch = app.router.options.routes.filter(v => v.name === 'kaifainSearch')[0]
-      let kaifainDetail = app.router.options.routes.filter(v => v.name === 'kaifain-detail-tid')[ 0 ]
-      let kaifainCaseDetail = app.router.options.routes.filter(v => v.name === 'kaifain-case-tid')[ 0 ]
-      let kaifainAdd = app.router.options.routes.filter(v => v.name === 'kaifain-add')[ 0 ]
-      let kaifainPreview = app.router.options.routes.filter(v => v.name === 'kaifain-preview')[ 0 ]
-      let kaifainPreviewCase = app.router.options.routes.filter(v => v.name === 'kaifain-previewCase')[ 0 ]
-      let kaifainIndexNow = {
-        name: 'kaifain_$',
-        path: '/*',
-        component: kaifainIndex.component
-      }
-      let kaifainDetailNow = {
-        name: 'kaifainSeoDetails_$',
-        path: '/s/:tid',
-        component: kaifainDetail.component
-      }
-      let kaifainCaseDetailNow = {
-        name: 'kaifainCaseSeoDetails_$',
-        path: '/d/:tid',
-        component: kaifainCaseDetail.component
-      }
-      let kaifainAddNow = {
-        name: 'kaifainAdd_$',
-        path: '/add',
-        component: kaifainAdd.component
-      }
-      let kaifainPreviewNow = {
-        name: 'kaifainPreview_$',
-        path: '/preview',
-        component: kaifainPreview.component
-      }
-      let kaifainPreviewCaseNow = {
-        name: 'kaifainPreviewCase_$',
-        path: '/previewCase',
-        component: kaifainPreviewCase.component
-      }
-      let kaifainOrderList = [ kaifainPreviewCaseNow,
-        kaifainPreviewNow,
-        kaifainAddNow,
-        kaifainCaseDetailNow,
-        kaifainDetailNow,
-        kaifainIndexNow
-      ]
-      try {
-        app.router.options.routes.unshift(...kaifainOrderList)
-        app.router.matcher.addRoutes(kaifainOrderList)
-      } catch ( e ) {
-        console.log(e)
-      }
-    } */
-
-    /* if (isJishuin) {
-      window.__NUXT__.routePath = app.context.route.path.replace(/^\/jishuin/, '/')
-      let jishuinCIndex = app.router.options.routes.filter(v => v.name === "user-collect_article-id-type")[ 0 ]
-      let jishuinCType = app.router.options.routes.filter(v => v.name === "user-collect_article-id-type")[ 0 ]
-      let jishuinUIndex = app.router.options.routes.filter(v => v.name === "user-id-type")[ 0 ]
-      let jishuinUType = app.router.options.routes.filter(v => v.name === "user-id-type")[ 0 ]
-      let jishuinU = {
-        name: 'jishuinSeoU_$',
-        path: '/u/:id',
-        component: jishuinUIndex.component
-      }
-      let jishuinUT = {
-        name: 'jishuinSeoUType_$',
-        path: '/u/:id/:type',
-        component: jishuinUType.component
-      }
-      let jishuinC = {
-        name: 'jishuinSeoC_$',
-        path: '/c/:id',
-        component: jishuinCIndex.component
-      }
-      let jishuinCT = {
-        name: 'jishuinSeoCT_$',
-        path: '/c/:id/:type',
-        component: jishuinCType.component
-      }
-      let jishuinOrderList = [
-        jishuinCT, jishuinC, jishuinUT, jishuinU
-      ]
-      try {
-        app.router.options.routes.unshift(...jishuinOrderList)
-        app.router.matcher.addRoutes(jishuinOrderList)
-      } catch ( e ) {
-        console.log(e)
-      }
-    } */
 
     if (isJob) {
       window.__NUXT__.routePath = app.context.route.path.replace(/^\/job/, '/')