You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
55 lines
1.6 KiB
55 lines
1.6 KiB
import { currRoute } from './common'
|
|
import { redirectInterceptor } from './interceptor'
|
|
import useConfigStore from "@/stores/config";
|
|
import useSystemStore from '@/stores/system'
|
|
import { useShare } from '@/hooks/useShare'
|
|
|
|
export default {
|
|
install(vue) {
|
|
vue.mixin({
|
|
data() {
|
|
return {
|
|
query: {}
|
|
}
|
|
},
|
|
onLoad: (data: object) => {
|
|
const route = currRoute() || ''
|
|
|
|
this.query = data
|
|
|
|
useSystemStore().$patch((state) => {
|
|
state.currRoute = route
|
|
})
|
|
},
|
|
onShow: () => {
|
|
const route = currRoute() || ''
|
|
|
|
useSystemStore().$patch((state) => {
|
|
state.currRoute = route
|
|
})
|
|
|
|
let loginBack = uni.getStorageSync('loginBack');
|
|
if (loginBack && loginBack.url == '/' + route) {
|
|
this.query = loginBack.param
|
|
}
|
|
|
|
redirectInterceptor({
|
|
path: route,
|
|
query: this.query
|
|
})
|
|
},
|
|
onShareAppMessage() {
|
|
return useShare().onShareAppMessage()
|
|
},
|
|
onShareTimeline() {
|
|
return useShare().onShareTimeline()
|
|
},
|
|
methods: {
|
|
themeColor() {
|
|
const configStore = useConfigStore()
|
|
return configStore.getThemeColor();
|
|
}
|
|
}
|
|
});
|
|
},
|
|
};
|
|
|