mirror of
https://gitee.com/niucloud-team/niucloud.git
synced 2026-03-21 13:03:04 +00:00
51 lines
1.4 KiB
TypeScript
51 lines
1.4 KiB
TypeScript
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
|
|
})
|
|
|
|
redirectInterceptor({
|
|
path: route,
|
|
query: this.query
|
|
})
|
|
},
|
|
onShareAppMessage(){
|
|
useShare().onShareAppMessage()
|
|
},
|
|
onShareTimeline(){
|
|
useShare().onShareTimeline()
|
|
},
|
|
methods:{
|
|
themeColor(){
|
|
const configStore = useConfigStore()
|
|
return configStore.getThemeColor();
|
|
}
|
|
}
|
|
});
|
|
},
|
|
};
|