12345678910111213141516171819202122232425262728293031 |
- <script>
- export default {
- globalData() {
- },
- onLaunch(options) {
- let userToken = this.vuex_user_token;
- let notLogin = [
- 'pages/login/login',
- ];
- if(!userToken && (notLogin.indexOf(options.path) === -1)){
- let arr = [];
- for (const key in options.query) {
- arr.push(`${key}=${options.query[key]}`)
- }
- uni.reLaunch({
- url: `/pages/login/login?redirect=${options.path}&${arr.join("&")}`,
- });
- }
- },
- onShow(options){
- console.log('app show -->')
- },
- onLoad(option) {
- console.log('app load -->')
- }
- }
- </script>
- <style lang="scss">
- @import "uview-ui/index.scss";
- </style>
|