Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
meihua-island-book
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
hookehuyr
2023-12-20 10:33:52 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
cb4b3338b10dd050e77c963fc7b5d53b1f41294f
cb4b3338
1 parent
50e335cd
新增授权页面
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
13 deletions
components.d.ts
src/app.config.js
src/app.js
src/pages/auth/index.vue
components.d.ts
View file @
cb4b333
...
...
@@ -18,6 +18,7 @@ declare module '@vue/runtime-core' {
NutCalendar
:
typeof
import
(
'@nutui/nutui-taro'
)[
'Calendar'
]
NutCol
:
typeof
import
(
'@nutui/nutui-taro'
)[
'Col'
]
NutConfigProvider
:
typeof
import
(
'@nutui/nutui-taro'
)[
'ConfigProvider'
]
NutCountdown
:
typeof
import
(
'@nutui/nutui-taro'
)[
'Countdown'
]
NutImagePreview
:
typeof
import
(
'@nutui/nutui-taro'
)[
'ImagePreview'
]
NutInput
:
typeof
import
(
'@nutui/nutui-taro'
)[
'Input'
]
NutInputNumber
:
typeof
import
(
'@nutui/nutui-taro'
)[
'InputNumber'
]
...
...
src/app.config.js
View file @
cb4b333
/*
* @Date: 2023-12-14 17:45:15
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2023-12-1
5 14:04:18
* @LastEditTime: 2023-12-1
9 17:21:45
* @FilePath: /meihuaApp/src/app.config.js
* @Description: 文件描述
*/
...
...
@@ -15,6 +15,7 @@ export default defineAppConfig({
'pages/payInfo/index'
,
'pages/login/index'
,
'pages/myInfo/index'
,
'pages/auth/index'
,
],
subpackages
:
[
// 配置在tabBar中的页面不能分包写到subpackages中去
{
...
...
src/app.js
View file @
cb4b333
/*
* @Date: 2023-12-14 17:45:15
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2023-12-1
6 15:03:36
* @LastEditTime: 2023-12-1
9 17:12:45
* @FilePath: /meihuaApp/src/app.js
* @Description: 文件描述
*/
import
{
createApp
}
from
'vue'
import
{
createPinia
}
from
'pinia'
import
'./app.less'
import
{
routerStore
}
from
'@/stores/router'
import
Taro
from
'@tarojs/taro'
const
App
=
createApp
({
// 对应 onLaunch
onLaunch
(
options
)
{
// 未授权状态跳转授权页面,首页不需要权限
const
path
=
options
.
path
;
// 缓存没有权限的地址
const
router
=
routerStore
();
router
.
add
(
path
);
if
(
path
!==
'pages/index/index'
&&
!
wx
.
getStorageSync
(
"sessionid"
))
{
console
.
warn
(
"没有权限"
);
// Taro.navigateTo({
// url: './pages/auth/index',
// })
}
},
onShow
(
options
)
{},
// 入口组件不需要实现 render 方法,即使实现了也会被 taro 所覆盖
})
...
...
src/pages/auth/index.vue
View file @
cb4b333
<!--
* @Date: 2022-09-19 14:11:06
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 202
2-11-15 16:45:25
* @FilePath: /
swx
/src/pages/auth/index.vue
* @LastEditTime: 202
3-12-19 17:18:11
* @FilePath: /
meihuaApp
/src/pages/auth/index.vue
* @Description: 文件描述
-->
<template>
...
...
@@ -49,15 +49,19 @@ export default {
//TAG 小程序绑定cookie
// 修改请求头
request.defaults.headers.cookie = res.cookies[0];
if (res.data.data.avatar) {
Taro.reLaunch({
url: '../../' + getCurrentPageParam().url
})
} else { // 头像没有设置跳转完善信息页面
Taro.redirectTo({
url: '../apxUserInfo/index'
})
}
// if (res.data.data.avatar) {
// Taro.reLaunch({
// url: '../../' + getCurrentPageParam().url
// })
// } else { // 头像没有设置跳转完善信息页面
// Taro.redirectTo({
// url: '../apxUserInfo/index'
// })
// }
console.warn(getCurrentPageParam());
// Taro.reLaunch({
// url: '../../' + getCurrentPageParam().url
// })
Taro.hideLoading();
}
} else {
...
...
Please
register
or
login
to post a comment