|
|
@@ -113,7 +113,7 @@
|
|
|
import DealSeoFooter from "@/components/kaifain/dealSeoFooter"
|
|
|
import ChangeBgImage from "@/components/kaifain/ChangeBgImage"
|
|
|
import KaifainFooter from "@/components/SeoFooter"
|
|
|
-
|
|
|
+ import {HashIDUtil, GenType} from "../../../../plugins/genHashId"
|
|
|
|
|
|
export default {
|
|
|
layout: "opacity_header",
|
|
|
@@ -138,17 +138,24 @@
|
|
|
}
|
|
|
},
|
|
|
async asyncData({ ...params }) {
|
|
|
- let { tid } = params.app.context.route.params || {}
|
|
|
- tid = tid.replace(".html", "")
|
|
|
+ let { tid: newTid } = params.app.context.route.params || {}
|
|
|
+ let tid = newTid.replace(".html", "")
|
|
|
|
|
|
if (process.server) {
|
|
|
- // const {path, fullPath} = params.app.context && params.app.context.route || {}
|
|
|
- // if (path && path.indexOf('/kaifain/s/14.html') !== -1) {
|
|
|
- // let reditUrl = fullPath
|
|
|
- // let path1 = path.replace("/user/", "/u/")
|
|
|
- // reditUrl = path.replace(path, path1)
|
|
|
- // redirect(301, reditUrl)
|
|
|
- // }
|
|
|
+ const {path, fullPath} = params.app.context && params.app.context.route || {}
|
|
|
+ //将id都转到hashId
|
|
|
+ console.log("********* tid", tid, tid.length !== 12)
|
|
|
+ if (tid && tid.length !== 12 && Number(tid) === Number(tid)) {
|
|
|
+ console.log("********* innnnnn", 123)
|
|
|
+
|
|
|
+ let genHashId = new HashIDUtil()
|
|
|
+ let nowId = genHashId.getHashID(GenType.TYPE_SERVICE_PROVIDER, tid)
|
|
|
+ console.log("********* nowId", nowId)
|
|
|
+ let path1 = path.replace(newTid, nowId)
|
|
|
+ let reditUrl = path.replace(path, path1)
|
|
|
+ params.redirect(301, reditUrl)
|
|
|
+ return
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
let errInfo = ""
|