Showing
4 changed files
with
35 additions
and
13 deletions
| ... | @@ -18,6 +18,7 @@ declare module '@vue/runtime-core' { | ... | @@ -18,6 +18,7 @@ declare module '@vue/runtime-core' { |
| 18 | NutCalendar: typeof import('@nutui/nutui-taro')['Calendar'] | 18 | NutCalendar: typeof import('@nutui/nutui-taro')['Calendar'] |
| 19 | NutCol: typeof import('@nutui/nutui-taro')['Col'] | 19 | NutCol: typeof import('@nutui/nutui-taro')['Col'] |
| 20 | NutConfigProvider: typeof import('@nutui/nutui-taro')['ConfigProvider'] | 20 | NutConfigProvider: typeof import('@nutui/nutui-taro')['ConfigProvider'] |
| 21 | + NutCountdown: typeof import('@nutui/nutui-taro')['Countdown'] | ||
| 21 | NutImagePreview: typeof import('@nutui/nutui-taro')['ImagePreview'] | 22 | NutImagePreview: typeof import('@nutui/nutui-taro')['ImagePreview'] |
| 22 | NutInput: typeof import('@nutui/nutui-taro')['Input'] | 23 | NutInput: typeof import('@nutui/nutui-taro')['Input'] |
| 23 | NutInputNumber: typeof import('@nutui/nutui-taro')['InputNumber'] | 24 | NutInputNumber: typeof import('@nutui/nutui-taro')['InputNumber'] | ... | ... |
| 1 | /* | 1 | /* |
| 2 | * @Date: 2023-12-14 17:45:15 | 2 | * @Date: 2023-12-14 17:45:15 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2023-12-15 14:04:18 | 4 | + * @LastEditTime: 2023-12-19 17:21:45 |
| 5 | * @FilePath: /meihuaApp/src/app.config.js | 5 | * @FilePath: /meihuaApp/src/app.config.js |
| 6 | * @Description: 文件描述 | 6 | * @Description: 文件描述 |
| 7 | */ | 7 | */ |
| ... | @@ -15,6 +15,7 @@ export default defineAppConfig({ | ... | @@ -15,6 +15,7 @@ export default defineAppConfig({ |
| 15 | 'pages/payInfo/index', | 15 | 'pages/payInfo/index', |
| 16 | 'pages/login/index', | 16 | 'pages/login/index', |
| 17 | 'pages/myInfo/index', | 17 | 'pages/myInfo/index', |
| 18 | + 'pages/auth/index', | ||
| 18 | ], | 19 | ], |
| 19 | subpackages: [ // 配置在tabBar中的页面不能分包写到subpackages中去 | 20 | subpackages: [ // 配置在tabBar中的页面不能分包写到subpackages中去 |
| 20 | { | 21 | { | ... | ... |
| 1 | /* | 1 | /* |
| 2 | * @Date: 2023-12-14 17:45:15 | 2 | * @Date: 2023-12-14 17:45:15 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2023-12-16 15:03:36 | 4 | + * @LastEditTime: 2023-12-19 17:12:45 |
| 5 | * @FilePath: /meihuaApp/src/app.js | 5 | * @FilePath: /meihuaApp/src/app.js |
| 6 | * @Description: 文件描述 | 6 | * @Description: 文件描述 |
| 7 | */ | 7 | */ |
| 8 | import { createApp } from 'vue' | 8 | import { createApp } from 'vue' |
| 9 | import { createPinia } from 'pinia' | 9 | import { createPinia } from 'pinia' |
| 10 | import './app.less' | 10 | import './app.less' |
| 11 | +import { routerStore } from '@/stores/router' | ||
| 12 | +import Taro from '@tarojs/taro' | ||
| 11 | 13 | ||
| 12 | const App = createApp({ | 14 | const App = createApp({ |
| 15 | + // 对应 onLaunch | ||
| 16 | + onLaunch(options) { | ||
| 17 | + // 未授权状态跳转授权页面,首页不需要权限 | ||
| 18 | + const path = options.path; | ||
| 19 | + // 缓存没有权限的地址 | ||
| 20 | + const router = routerStore(); | ||
| 21 | + router.add(path); | ||
| 22 | + if (path !== 'pages/index/index' && !wx.getStorageSync("sessionid")) { | ||
| 23 | + console.warn("没有权限"); | ||
| 24 | + // Taro.navigateTo({ | ||
| 25 | + // url: './pages/auth/index', | ||
| 26 | + // }) | ||
| 27 | + } | ||
| 28 | + }, | ||
| 13 | onShow (options) {}, | 29 | onShow (options) {}, |
| 14 | // 入口组件不需要实现 render 方法,即使实现了也会被 taro 所覆盖 | 30 | // 入口组件不需要实现 render 方法,即使实现了也会被 taro 所覆盖 |
| 15 | }) | 31 | }) | ... | ... |
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2022-09-19 14:11:06 | 2 | * @Date: 2022-09-19 14:11:06 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2022-11-15 16:45:25 | 4 | + * @LastEditTime: 2023-12-19 17:18:11 |
| 5 | - * @FilePath: /swx/src/pages/auth/index.vue | 5 | + * @FilePath: /meihuaApp/src/pages/auth/index.vue |
| 6 | * @Description: 文件描述 | 6 | * @Description: 文件描述 |
| 7 | --> | 7 | --> |
| 8 | <template> | 8 | <template> |
| ... | @@ -49,15 +49,19 @@ export default { | ... | @@ -49,15 +49,19 @@ export default { |
| 49 | //TAG 小程序绑定cookie | 49 | //TAG 小程序绑定cookie |
| 50 | // 修改请求头 | 50 | // 修改请求头 |
| 51 | request.defaults.headers.cookie = res.cookies[0]; | 51 | request.defaults.headers.cookie = res.cookies[0]; |
| 52 | - if (res.data.data.avatar) { | 52 | + // if (res.data.data.avatar) { |
| 53 | - Taro.reLaunch({ | 53 | + // Taro.reLaunch({ |
| 54 | - url: '../../' + getCurrentPageParam().url | 54 | + // url: '../../' + getCurrentPageParam().url |
| 55 | - }) | 55 | + // }) |
| 56 | - } else { // 头像没有设置跳转完善信息页面 | 56 | + // } else { // 头像没有设置跳转完善信息页面 |
| 57 | - Taro.redirectTo({ | 57 | + // Taro.redirectTo({ |
| 58 | - url: '../apxUserInfo/index' | 58 | + // url: '../apxUserInfo/index' |
| 59 | - }) | 59 | + // }) |
| 60 | - } | 60 | + // } |
| 61 | + console.warn(getCurrentPageParam()); | ||
| 62 | + // Taro.reLaunch({ | ||
| 63 | + // url: '../../' + getCurrentPageParam().url | ||
| 64 | + // }) | ||
| 61 | Taro.hideLoading(); | 65 | Taro.hideLoading(); |
| 62 | } | 66 | } |
| 63 | } else { | 67 | } else { | ... | ... |
-
Please register or login to post a comment