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-22 09:59:49 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
f80f61cd635718111c65e5da2851f9144a703471
f80f61cd
1 parent
6824e659
测试授权跳转功能
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
16 deletions
src/app.js
src/pages/auth/index.vue
src/utils/request.js
src/app.js
View file @
f80f61c
/*
* @Date: 2023-12-14 17:45:15
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2023-12-2
1 16:09:14
* @LastEditTime: 2023-12-2
2 09:28:22
* @FilePath: /meihuaApp/src/app.js
* @Description: 文件描述
*/
...
...
@@ -22,9 +22,9 @@ const App = createApp({
// if (path !== 'pages/index/index' && !wx.getStorageSync("sessionid")) {
if
(
!
wx
.
getStorageSync
(
"sessionid"
))
{
console
.
warn
(
"没有权限"
);
//
Taro.navigateTo({
//
url: './pages/auth/index',
//
})
Taro
.
navigateTo
({
url
:
'./pages/auth/index'
,
})
}
},
onShow
(
options
)
{},
...
...
src/pages/auth/index.vue
View file @
f80f61c
<!--
* @Date: 2022-09-19 14:11:06
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2023-12-
19 17:18:11
* @LastEditTime: 2023-12-
22 09:44:20
* @FilePath: /meihuaApp/src/pages/auth/index.vue
* @Description: 文件描述
-->
...
...
@@ -35,8 +35,8 @@ export default {
title: '授权中',
})
request.post('/srv/?a=openid', {
code: res.code
//
openid: '0002'
//
code: res.code
openid: '0002'
// openid: 'o5NFZ5cFQtLRy3aVHaZMLkjHFusI'
// openid: 'o5NFZ5TpgG4FwYursGCLjcUJH2ak'
// openid: 'o5NFZ5cqroPYwawCp8FEOxewtgnw'
...
...
@@ -58,10 +58,13 @@ export default {
// url: '../apxUserInfo/index'
// })
// }
console.warn(getCurrentPageParam());
//
console.warn(getCurrentPageParam());
// Taro.reLaunch({
// url:
'../../' +
getCurrentPageParam().url
// url: getCurrentPageParam().url
// })
Taro.reLaunch({
url: '/pages/index/index'
})
Taro.hideLoading();
}
} else {
...
...
src/utils/request.js
View file @
f80f61c
/*
* @Date: 2022-09-19 14:11:06
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2023-12-2
1 17:17:10
* @LastEditTime: 2023-12-2
2 09:32:24
* @FilePath: /meihuaApp/src/utils/request.js
* @Description: 简单axios封装,后续按实际处理
*/
...
...
@@ -25,7 +25,6 @@ const service = axios.create({
service
.
defaults
.
params
=
{
f
:
'room'
,
a
:
'room_order'
,
};
// request interceptor
...
...
@@ -94,11 +93,11 @@ service.interceptors.response.use(
* 未授权跳转登录页
* 授权完成后 返回当前页面
*/
setTimeout
(()
=>
{
Taro
.
navigateTo
({
url
:
'../../pages/auth/index?url='
+
routerStore
().
url
});
},
1000
);
//
setTimeout(() => {
//
Taro.navigateTo({
//
url: '../../pages/auth/index?url=' + routerStore().url
//
});
//
}, 1000);
}
return
response
},
...
...
Please
register
or
login
to post a comment