acdr-ui/dist/build/mp-weixin/interceptors/route.js

2 lines
552 B
JavaScript
Raw Normal View History

2024-10-01 09:15:35 +08:00
"use strict";const e=require("../common/vendor.js");require("../store/index.js");const r=require("../utils/index.js"),n=require("../store/user.js"),t={invoke({url:t}){const i=t.split("?")[0];let o=[];o=r.needLoginPages;if(!o.includes(i))return!0;if(n.useUserStore().isLogined)return!0;const s=`/modules/pet/login/index?redirect=${encodeURIComponent(t)}`;return e.index.navigateTo({url:s}),!1}},i={install(){e.index.addInterceptor("navigateTo",t),e.index.addInterceptor("reLaunch",t),e.index.addInterceptor("redirectTo",t)}};exports.routeInterceptor=i;