Commit ff7f8f90 authored by leiqingsong's avatar leiqingsong

修改

parent 7a1f861f
......@@ -3,9 +3,10 @@ import request from "@/utils/request";
/**
* 获取专属客服
*/
export function getCustomer() {
export function getCustomer(params) {
return request({
url: "/customerService/service",
method: "get"
method: "get",
params
});
}
......@@ -8,7 +8,7 @@ const routes = [
path: "/my-status",
name: "MyStatus",
component: () => import("../views/my/myStatus.vue"),
meta: { title: "我的直推", noNav: false}
meta: { title: "我的直推", noNav: false }
},
{
path: "/publish",
......@@ -156,10 +156,38 @@ const routes = [
}
];
const router = new VueRouter({
mode: "history",
base: process.env.BASE_URL,
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;
......@@ -78,6 +78,15 @@ class bridgeToAppFun {
jsBridge.callhandler("showBottomBar", params);
}
}
redirectToLogin() {
console.log("去登陆");
if (this.userAgent === "android") {
console.log("an");
window.android.redirectToLogin();
} else {
jsBridge.callhandler("redirectToLogin");
}
}
}
export default bridgeToAppFun;
......@@ -5,7 +5,7 @@
name="arrow-left"
size="20"
class="nav-left"
@click="$router.go(-1)"
@click="handlerBack"
/>
<span class="nav-title">专属客服</span>
</div>
......@@ -39,6 +39,14 @@ export default {
},
mounted() {},
methods: {
handlerBack() {
try {
this.$bridgeToAppFun.navigateBack();
} catch {
console.log("不能和App交互");
this.$router.go(-1);
}
},
handleUrl(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