Commit ff7f8f90 authored by leiqingsong's avatar leiqingsong

修改

parent 7a1f861f
...@@ -3,9 +3,10 @@ import request from "@/utils/request"; ...@@ -3,9 +3,10 @@ import request from "@/utils/request";
/** /**
* 获取专属客服 * 获取专属客服
*/ */
export function getCustomer() { export function getCustomer(params) {
return request({ return request({
url: "/customerService/service", url: "/customerService/service",
method: "get" method: "get",
params
}); });
} }
...@@ -8,7 +8,7 @@ const routes = [ ...@@ -8,7 +8,7 @@ const routes = [
path: "/my-status", path: "/my-status",
name: "MyStatus", name: "MyStatus",
component: () => import("../views/my/myStatus.vue"), component: () => import("../views/my/myStatus.vue"),
meta: { title: "我的直推", noNav: false} meta: { title: "我的直推", noNav: false }
}, },
{ {
path: "/publish", path: "/publish",
...@@ -156,10 +156,38 @@ const routes = [ ...@@ -156,10 +156,38 @@ const routes = [
} }
]; ];
const router = new VueRouter({ const router = new VueRouter({
mode: "history", mode: "history",
base: process.env.BASE_URL, base: process.env.BASE_URL,
routes routes
}); });
router.beforeEach((to, from, next) => {
console.log('to', to);
const whiteList = [
"MyStatus",
"Publish",
"FastestProgress",
"MonthAward",
"Settings",
"Grade",
"AirDrop",
"Invite",
"AboutUs",
"customerService",
"Wallet"
];
const token = localStorage.getItem("token");
if (whiteList.indexOf(to.name) > -1) {
if (token) {
next()
} else {
console.log('未登录');
}
} else {
next()
}
})
export default router; export default router;
...@@ -78,6 +78,15 @@ class bridgeToAppFun { ...@@ -78,6 +78,15 @@ class bridgeToAppFun {
jsBridge.callhandler("showBottomBar", params); jsBridge.callhandler("showBottomBar", params);
} }
} }
redirectToLogin() {
console.log("去登陆");
if (this.userAgent === "android") {
console.log("an");
window.android.redirectToLogin();
} else {
jsBridge.callhandler("redirectToLogin");
}
}
} }
export default bridgeToAppFun; export default bridgeToAppFun;
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
name="arrow-left" name="arrow-left"
size="20" size="20"
class="nav-left" class="nav-left"
@click="$router.go(-1)" @click="handlerBack"
/> />
<span class="nav-title">专属客服</span> <span class="nav-title">专属客服</span>
</div> </div>
...@@ -39,6 +39,14 @@ export default { ...@@ -39,6 +39,14 @@ export default {
}, },
mounted() {}, mounted() {},
methods: { methods: {
handlerBack() {
try {
this.$bridgeToAppFun.navigateBack();
} catch {
console.log("不能和App交互");
this.$router.go(-1);
}
},
handleUrl(urlName) { handleUrl(urlName) {
this.$router.push({ name: urlName }); this.$router.push({ name: urlName });
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment