Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CFFP-HB
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chao Sun
CFFP-HB
Commits
0f277ee5
Commit
0f277ee5
authored
Jun 17, 2025
by
yuzhenWang
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature-20250609-优化cffp' into 'uat'
Feature 20250609 优化cffp See merge request
!8
parents
de413fa6
b3e070b6
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
223 additions
and
81 deletions
+223
-81
components/clause/clause.vue
+0
-0
components/eSignature/eSignature.vue
+69
-19
components/login/login.vue
+2
-15
environments/environment.ts
+5
-1
manifest.json
+1
-1
myPackageA/lawManual/lawManual.vue
+1
-0
pages/application-process/signature.vue
+80
-20
pages/courseDetail/courseDetail.vue
+7
-4
pages/index/index.vue
+4
-0
pages/invitationRegister/invitationRegister.vue
+2
-2
pages/invitationRegister/invitationlogin.vue
+1
-0
pages/personalCenter/personalCenter.vue
+22
-17
pages/pointsExchange/customDatePop.vue
+8
-0
static/logo1.png
+0
-0
util/interceptor.ts
+4
-0
util/router.js
+17
-2
No files found.
components/clause/clause.vue
View file @
0f277ee5
This diff is collapsed.
Click to expand it.
components/eSignature/eSignature.vue
View file @
0f277ee5
...
...
@@ -39,7 +39,8 @@
points
:
[],
//签名图片
SignatureImg
:
''
,
hasSign
:
false
hasSign
:
false
,
isDrawing
:
false
// 新增绘制状态
};
},
props
:
[
'showCanvas'
],
...
...
@@ -67,8 +68,21 @@
this
.
ctx
.
lineCap
=
'round'
;
this
.
ctx
.
lineJoin
=
'round'
;
},
//触摸开始,获取到起点
// //触摸开始,获取到起点
// touchstart(e) {
// let startX = e.changedTouches[0].x;
// let startY = e.changedTouches[0].y;
// let startPoint = {
// X: startX,
// Y: startY
// };
// this.points.push(startPoint);
// //每次触摸开始,开启新的路径
// this.ctx.beginPath();
// },
// 触摸开始,获取到起点 - 修改后的方法
touchstart
(
e
)
{
this
.
isDrawing
=
true
;
let
startX
=
e
.
changedTouches
[
0
].
x
;
let
startY
=
e
.
changedTouches
[
0
].
y
;
let
startPoint
=
{
...
...
@@ -76,26 +90,60 @@
Y
:
startY
};
this
.
points
.
push
(
startPoint
);
//每次触摸开始,开启新的路径
this
.
ctx
.
beginPath
();
// 阻止事件冒泡
e
.
stopPropagation
();
return
false
;
},
//触摸移动,获取到路径点
// //触摸移动,获取到路径点
// touchmove(e) {
// let moveX = e.changedTouches[0].x;
// let moveY = e.changedTouches[0].y;
// let movePoint = {
// X: moveX,
// Y: moveY
// };
// this.points.push(movePoint); //存点
// let len = this.points.length;
// if (len >= 2) {
// this.draw(); //绘制路径
// }
// },
// 触摸移动,获取到路径点 - 修改后的方法
touchmove
(
e
)
{
if
(
!
this
.
isDrawing
)
return
;
let
moveX
=
e
.
changedTouches
[
0
].
x
;
let
moveY
=
e
.
changedTouches
[
0
].
y
;
let
movePoint
=
{
X
:
moveX
,
Y
:
moveY
};
this
.
points
.
push
(
movePoint
);
//存点
this
.
points
.
push
(
movePoint
);
let
len
=
this
.
points
.
length
;
if
(
len
>=
2
)
{
this
.
draw
();
//绘制路径
this
.
draw
();
}
// 阻止事件冒泡
e
.
stopPropagation
();
return
false
;
},
// 触摸结束,将未绘制的点清空防止对后续路径产生干扰
// // 触摸结束,将未绘制的点清空防止对后续路径产生干扰
// touchend() {
// this.points = [];
// },
// 触摸结束 - 修改后的方法
touchend
()
{
this
.
isDrawing
=
false
;
this
.
points
=
[];
// 阻止事件冒泡
if
(
e
)
{
e
.
stopPropagation
();
}
return
false
;
},
//绘制笔迹
draw
()
{
...
...
@@ -154,6 +202,18 @@
},
mounted
()
{
this
.
createCanvas
();
// 新增代码
// 在组件挂载时添加额外的事件监听
// #ifdef H5
const
canvas
=
document
.
querySelector
(
'.mycanvas'
);
if
(
canvas
)
{
canvas
.
addEventListener
(
'touchmove'
,
(
e
)
=>
{
if
(
this
.
isDrawing
)
{
e
.
preventDefault
();
}
},
{
passive
:
false
});
}
// #endif
}
};
</
script
>
...
...
@@ -163,32 +223,22 @@
flex-direction
:
column
;
align-items
:
center
;
background
:
#fff
;
//
height
:
calc
(
100vh-44
rpx
);
//签名模块
.signature
{
//
position
:
fixed
;
//
top
:
10px
;
//
left
:
2%
;
//
z-index
:
999
;
touch-action
:
none
;
/* 禁用触摸操作 */
width
:
96%
;
//canvas
.mycanvas
{
touch-action
:
none
;
/* 禁用触摸操作 */
width
:
100%
;
//
height
:
calc
(
100vh
-
200
upx
);
height
:
calc
(
100vh
-
600
rpx
);
background-color
:
#f9f9f9
;
border-radius
:
10px
10px
0
0
;
}
//
底部按钮
.footer
{
//
font-size
:
14px
;
//
height
:
150
upx
;
display
:
flex
;
justify-content
:
space-around
;
//
align-items
:
center
;
//
background-color
:
#fff
;
//
border-radius
:
0
0
10px
10px
;
//
border-top
:
1px
solid
#a7a7a733
;
}
}
//
生成的图片
...
...
components/login/login.vue
View file @
0f277ee5
...
...
@@ -108,20 +108,6 @@
c_agreeFlag
(){
this
.
agreeFlag
=!
this
.
agreeFlag
;
},
// rpsdlogin(){
// if(this.loginType== 'resetpw'){
// this.loginType= 'codelogin'
// return
// }else {
// // uni.navigateBack({ delta: 1 });
// const pages = getCurrentPages();
// console.log('pages',pages);
// if (pages.length > 1) {
// uni.navigateBack({ delta: 1 });
// }
// }
// },
rpsdlogin
()
{
if
(
this
.
loginType
==
'resetpw'
)
{
this
.
loginType
=
'codelogin'
;
...
...
@@ -134,7 +120,6 @@
const
pages
=
getCurrentPages
();
const
currentPage
=
pages
[
pages
.
length
-
1
];
const
from
=
currentPage
.
options
.
from
;
// 获取 url 中的 from 参数
console
.
log
(
'currentPage'
,
currentPage
);
// 从 TabBar 页跳转过来,用 switchTab 返回
if
(
from
===
'index'
)
{
uni
.
switchTab
({
...
...
@@ -202,6 +187,8 @@
},
1000
);
},
loginIn
(
loginType
,
urlType
){
console
.
log
(
'loginType'
,
loginType
);
console
.
log
(
'this.loginType'
,
this
.
loginType
);
uni
.
showLoading
({
title
:
'加载中...'
});
...
...
environments/environment.ts
View file @
0f277ee5
const
dev
=
{
// base_url:'https://mstage.zuihuibi.cn',
// api_url:'https://mstage.zuihuibi.cn/cffpApi',
// cffp_url:'https://mstage.zuihuibi.cn/cffpApi/cffp',
// share_url:'https://mstage.zuihuibi.cn/cffp',
base_url
:
'https://mdev.anjibao.cn'
,
api_url
:
'https://mdev.anjibao.cn/cffpApi'
,
cffp_url
:
'https://mdev.anjibao.cn/cffpApi/cffp'
,
...
...
@@ -37,7 +41,7 @@ const config = {
stage
,
prod
}
let
env
=
'
prod
'
;
let
env
=
'
dev
'
;
let
baseURL
=
config
[
env
].
base_url
;
let
apiURL
=
config
[
env
].
api_url
;
...
...
manifest.json
View file @
0f277ee5
...
...
@@ -169,7 +169,7 @@
"vueVersion"
:
"3"
,
"h5"
:
{
"router"
:
{
"base"
:
"/
appYdhomeoffice
/"
,
"base"
:
"/
cffp
/"
,
"mode"
:
"history"
},
"devServer"
:
{
...
...
myPackageA/lawManual/lawManual.vue
View file @
0f277ee5
...
...
@@ -1852,6 +1852,7 @@
loginPopup
.
value
.
close
();
uni
.
setStorageSync
(
'cffp_userId'
,
String
(
res
[
'data'
][
'userId'
]));
uni
.
setStorageSync
(
'uni-token'
,
res
[
'data'
][
'token'
]);
uni
.
setStorageSync
(
'loginType'
,
'codelogin'
);
userId
.
value
=
String
(
res
[
'data'
][
'userId'
]);
powerQuery
();
}
else
{
...
...
pages/application-process/signature.vue
View file @
0f277ee5
...
...
@@ -65,6 +65,7 @@
},
touchMoveHandler
:
null
,
isScrollLocked
:
false
// 新增滚动锁定状态
}
},
components
:{
eSignature
},
...
...
@@ -97,33 +98,89 @@
this
.
releaseScroll
();
},
methods
:
{
// 锁定滚动
// // 锁定滚动
// lockScroll() {
// // #ifdef H5
// if (this.touchMoveHandler) return; // 避免重复绑定
// this.touchMoveHandler = (e) => {
// e.preventDefault();
// };
// document.body.addEventListener(
// 'touchmove',
// this.touchMoveHandler,
// { passive: false }
// );
// // #endif
// },
// 锁定滚动 - 修改后的方法
lockScroll
()
{
// #ifdef H5
if
(
this
.
touchMoveHandler
)
return
;
// 避免重复绑定
if
(
this
.
isScrollLocked
)
return
;
// #ifdef H5
// 阻止触摸事件默认行为
this
.
touchMoveHandler
=
(
e
)
=>
{
// 检查触摸事件是否发生在签名区域内
const
signatureArea
=
document
.
querySelector
(
'.signatureContent'
);
if
(
signatureArea
&&
signatureArea
.
contains
(
e
.
target
))
{
e
.
preventDefault
();
}
};
document
.
body
.
addEventListener
(
'touchmove'
,
this
.
touchMoveHandler
,
{
passive
:
false
}
);
document
.
body
.
addEventListener
(
'touchmove'
,
this
.
touchMoveHandler
,
{
passive
:
false
});
// #endif
// 在App端也需要禁用滚动
// #ifdef APP-PLUS
const
pages
=
getCurrentPages
();
const
page
=
pages
[
pages
.
length
-
1
];
const
webview
=
page
.
$getAppWebview
();
webview
.
setStyle
({
scrollIndicator
:
'none'
,
scrollsToTop
:
false
,
bounce
:
'none'
});
// #endif
this
.
isScrollLocked
=
true
;
},
// 释放滚动
// // 释放滚动
// releaseScroll() {
// // #ifdef H5
// if (this.touchMoveHandler) {
// document.body.removeEventListener(
// 'touchmove',
// this.touchMoveHandler
// );
// this.touchMoveHandler = null;
// }
// // #endif
// },
// 释放滚动 - 修改后的方法
releaseScroll
()
{
if
(
!
this
.
isScrollLocked
)
return
;
// #ifdef H5
if
(
this
.
touchMoveHandler
)
{
document
.
body
.
removeEventListener
(
'touchmove'
,
this
.
touchMoveHandler
);
document
.
body
.
removeEventListener
(
'touchmove'
,
this
.
touchMoveHandler
);
this
.
touchMoveHandler
=
null
;
}
// #endif
// 在App端恢复滚动
// #ifdef APP-PLUS
const
pages
=
getCurrentPages
();
const
page
=
pages
[
pages
.
length
-
1
];
const
webview
=
page
.
$getAppWebview
();
webview
.
setStyle
({
scrollIndicator
:
'auto'
,
scrollsToTop
:
true
,
bounce
:
'vertical'
});
// #endif
this
.
isScrollLocked
=
false
;
},
goBack
()
{
this
.
releaseScroll
()
...
...
@@ -218,17 +275,24 @@
<
style
lang=
"scss"
scoped
>
@import
'applyCommon.scss'
;
//
uni-page-wrapper
{
//
overflow
:
hidden
!important
;
//
}
.container
{
background-color
:
#fff
;
//
新增样式
position
:
fixed
;
top
:
0
;
left
:
0
;
right
:
0
;
bottom
:
0
;
overflow
:
hidden
;
-webkit-overflow-scrolling
:
touch
;
}
.signatureContent
{
background
:
#fff
;
margin-top
:
20
rpx
;
height
:
auto
;
position
:
relative
;
//
新增样式
touch-action
:
none
;
/* 禁用触摸操作 */
}
.signature_action
{
display
:
flex
;
...
...
@@ -243,10 +307,6 @@
.imgBox{
display
:
flex
;
align-items
:
center
;
//
position
:
absolute
;
//
bottom
:
-7%
;
//
left
:
50%
;
//
transform
:
translateX
(
-50%
);
width
:
120
rpx
;
height
:
120
rpx
;
}
...
...
pages/courseDetail/courseDetail.vue
View file @
0f277ee5
...
...
@@ -29,10 +29,13 @@
<view
class=
"swiperBox"
v-if=
"bannerViewType == '2'"
>
<uni-swiper-dot
:dots-styles=
"
{
backgroundColor: 'rgba(255, 255, 255, 0.5)',
selectedBackgroundColor: 'rgba(255, 255, 255, 1)'
backgroundColor: 'rgba(145, 151, 201, .5)',
selectedBackgroundColor: 'rgba(255, 255, 255, 1)',
bottom:100,
selectedBorder: '10rpx rgba(255, 255, 255, 1) solid',
width:8
}" :info="swiperList" :current="current" mode="default">
<swiper
autoplay
:interval=
"3000"
circular
class=
"swiper-box"
@
change=
"changeSwiper"
>
<swiper
autoplay
:indicator-dots=
"true"
:interval=
"3000"
circular
class=
"swiper-box"
@
change=
"changeSwiper"
>
<swiper-item
v-for=
"(item,index) in swiperList"
:key=
"index"
class=
"swiper-item-no-gap"
>
<view
class=
"swiper-item"
>
<image
style=
"height: 100%;width: 100%;display: block;"
:src=
"item['filePath']"
mode=
"aspectFill"
></image>
...
...
@@ -568,7 +571,7 @@
}
//this.courseInfo.serviceContent = res['data']['data']['filePathOss'];
this
.
lecturerId
=
res
[
'data'
][
'data'
][
'fileLecturerId'
];
this
.
lecturerQuery
();
//
this.lecturerQuery();
this
.
relatedCoursesList
();
if
(
uni
.
getStorageSync
(
'h5_coursesharing'
))
{
this
.
coursesharing
=
uni
.
getStorageSync
(
'h5_coursesharing'
)
...
...
pages/index/index.vue
View file @
0f277ee5
...
...
@@ -223,6 +223,10 @@
this
.
loginornot
=
false
}
else
{
this
.
loginornot
=
true
;
}
if
(
loginType
==
'codelogin'
){
this
.
querySystemMessage
()
}
this
.
queryAreaCenterInfo
();
...
...
pages/invitationRegister/invitationRegister.vue
View file @
0f277ee5
...
...
@@ -66,8 +66,8 @@
<
style
lang=
"scss"
scoped
>
.container
{
height
:
100vh
;
background
:
url('../../static/app-plus/registerBg.png')
100%
100%
;
background-size
:
co
ntain
;
background
:
url('../../static/app-plus/registerBg.png')
30%
30%
no-repeat
;
background-size
:
co
ver
;
color
:
#fff
;
.logo{
padding-top
:
100
rpx
;
...
...
pages/invitationRegister/invitationlogin.vue
View file @
0f277ee5
...
...
@@ -143,6 +143,7 @@
uni
.
setStorageSync
(
'cffp_userId'
,
this
.
userId
);
uni
.
setStorageSync
(
'isH5'
,
1
);
uni
.
setStorageSync
(
'uni-token'
,
res
.
data
[
'token'
]);
uni
.
setStorageSync
(
'loginType'
,
'codelogin'
);
uni
.
navigateTo
({
url
:
'/pages/application-process/basic-info?userId='
+
this
.
userId
+
'&shareId='
+
this
.
form
.
id
})
...
...
pages/personalCenter/personalCenter.vue
View file @
0f277ee5
...
...
@@ -11,17 +11,16 @@
<view
class=
"headerInfo"
>
<view
class=
"headerTop"
>
<view
class=
""
style=
"margin-right: 15rpx;"
>
<view
class=
"myName"
v-if=
"login
ornot
"
>
{{
showMyName
||
'点击头像完善信息'
}}
</view>
<view
class=
"myName"
v-if=
"
!loginornot
"
>
游客
</view>
<view
class=
"myName"
v-if=
"login
Type == 'codelogin'
"
>
{{
showMyName
||
'点击头像完善信息'
}}
</view>
<view
class=
"myName"
v-if=
"
loginType == 'visitor'
"
>
游客
</view>
</view>
<view
class=
"desBox"
v-if=
"login
ornot
&&customerBasicInfo.partnerType"
>
<view
class=
"desBox"
v-if=
"login
Type == 'codelogin'
&&customerBasicInfo.partnerType"
>
{{
customerBasicInfo
.
partnerType
}}
</view>
</view>
<view
class=
"nickName"
>
<!--昵称:
{{
loginornot
==
true
?
customerBasicInfo
.
nickName
:
'游客'
}}
-->
<text
v-if=
"loginornot && customerBasicInfo.nickName"
>
昵称:
{{
customerBasicInfo
.
nickName
}}
</text>
<text
v-if=
"!loginornot"
>
昵称:游客
</text>
<text
v-if=
"loginType == 'codelogin' && customerBasicInfo.nickName"
>
昵称:
{{
customerBasicInfo
.
nickName
}}
</text>
<text
v-if=
"loginType == 'visitor'"
>
昵称:游客
</text>
</view>
</view>
...
...
@@ -145,12 +144,14 @@
export
default
{
data
()
{
return
{
showMyName
:
''
,
msgTotal
:
0
,
messageInfo
:[],
companyType
:
companyInfo
.
companyType
,
companyLogo
:
'../../static/myteam/logo.png'
,
userId
:
uni
.
getStorageSync
(
'cffp_userId'
),
loginType
:
uni
.
getStorageSync
(
'loginType'
),
inviteEqrode
:
''
,
currentPage
:
'personalCenter'
,
customerBasicInfo
:{},
...
...
@@ -228,21 +229,24 @@
tabBar
,
},
onShow
()
{
this
.
loginType
=
uni
.
getStorageSync
(
'loginType'
)
console
.
log
(
'this.loginType'
,
this
.
loginType
);
if
(
this
.
companyType
==
'1'
){
this
.
companyLogo
=
'../../static/myteam/Group1633.png'
;
}
else
if
(
this
.
companyType
==
'2'
){
this
.
companyLogo
=
'../../static/myteam/logo.png'
;
}
this
.
queryInfo
();
let
loginType
=
uni
.
getStorageSync
(
'loginType'
)
if
(
loginType
==
"visitor"
){
if
(
this
.
loginType
==
"visitor"
){
this
.
loginornot
=
false
this
.
messageInfo
=
[]
}
else
{
this
.
querySystemMessage
()
this
.
loginornot
=
true
;
}
if
(
this
.
loginType
==
'codelogin'
){
this
.
querySystemMessage
()
this
.
queryInfo
();
}
uni
.
$on
(
"handClick"
,
res
=>
{
this
.
customerBasicInfo
=
res
.
data
if
(
this
.
customerBasicInfo
?.
realName
&&
this
.
customerBasicInfo
?.
realName
.
length
>
5
){
...
...
@@ -253,10 +257,6 @@
// 移除监听事件
uni
.
$off
(
'handClick'
);
});
// setTimeout(() => {
// this.loadshow = false
// }, 10000)
},
methods
:
{
...
...
@@ -285,7 +285,6 @@
}
},
jumpToSystemMsg
(){
if
(
this
.
userId
&&
this
.
messageInfo
.
length
>
0
){
uni
.
navigateTo
({
url
:
'../systemMsg/system_msg'
...
...
@@ -405,14 +404,20 @@
this
.
inviteEqrode
=
this
.
customerBasicInfo
.
invitationCode
;
uni
.
setStorageSync
(
'user_mobile'
,
res
.
data
.
mobile
)
uni
.
setStorageSync
(
'userinfodataForm'
,
res
.
data
)
// }else{
}
else
{
// uni.showToast({
// title: res['message'],
// duration: 2000
// });
}
else
{
// 清空全部本地存储
uni
.
clearStorageSync
();
uni
.
setStorageSync
(
'loginType'
,
'visitor'
)
this
.
showMyName
=
''
this
.
loginType
=
'visitor'
}
console
.
log
(
'this.showMyName'
,
this
.
showMyName
);
})
}
},
...
...
pages/pointsExchange/customDatePop.vue
View file @
0f277ee5
...
...
@@ -400,6 +400,14 @@
this
.
$emit
(
'comfirm'
,{
year
:
this
.
year
,
month
:
this
.
month
,
current
:
this
.
current
,
timeType
:
'8'
})
}
if
(
this
.
current
==
'2'
){
if
(
!
this
.
currentDate
.
length
){
uni
.
showToast
({
title
:
`请选择时间`
,
duration
:
1000
,
icon
:
'none'
});
return
}
let
newObj
=
{}
if
(
this
.
monthList
.
filter
(
item
=>
item
.
value
==
this
.
currentMonth
).
length
>
0
){
newObj
=
this
.
monthList
.
filter
(
item
=>
item
.
value
==
this
.
currentMonth
)[
0
]
...
...
static/logo1.png
View file @
0f277ee5
436 KB
|
W:
|
H:
12.1 KB
|
W:
|
H:
2-up
Swipe
Onion skin
util/interceptor.ts
View file @
0f277ee5
import
{
apiURL
,
cffpURL
}
from
"../environments/environment"
;
import
api
from
"@/api/api"
;
// 白名单,不需要携带token就允许被访问的接口
const
whiteApiList
=
[
`
${
apiURL
}
/authorize/obtainToken`
,
`
${
apiURL
}
/authorize/checkToken`
,
`
${
cffpURL
}
/user/loginVerification`
,
`
${
apiURL
}
/appVersion/checkIsUpdate`
,
`
${
cffpURL
}
/accessLog/accessLogSave`
,
`
${
cffpURL
}
/user/powerQuery`
,
`
${
cffpURL
}
/user/wxLogin`
,
`
${
cffpURL
}
/certificate/officialWebsiteDetail`
];
...
...
@@ -8,13 +9,16 @@ export const interceptor = () => {
invoke
(
args
)
{
// 当本地没有token,并且接口地址没在白名单内,需要重新获取token
if
(
!
uni
.
getStorageSync
(
'uni-token'
)
&&
!
whiteApiList
.
includes
(
args
.
url
))
{
const
params
=
{
ticket
:
'uni-app'
,
loginId
:
null
}
let
h5userId
=
uni
.
getStorageSync
(
'cffp_userId'
);
if
(
h5userId
)
{
params
.
loginId
=
h5userId
;
}
uni
.
request
({
url
:
`
${
apiURL
}
/authorize/obtainToken`
,
...
...
util/router.js
View file @
0f277ee5
import
api
from
"@/api/api"
;
//只要是未登录状态,想要跳转到名单内的路径时,直接跳到登录页
// 页面白名单,不受拦截
const
whiteList
=
[
...
...
@@ -10,10 +11,24 @@ const whiteList = [
'/pages/index/index'
]
export
default
function
initApp
(){
uni
.
addInterceptor
(
'navigateTo'
,
{
// 页面跳转前进行拦截, invoke根据返回值进行判断是否继续执行跳转
invoke
(
e
)
{
if
(
uni
.
getStorageSync
(
'cffp_userId'
)){
api
.
queryInfo
({
userId
:
uni
.
getStorageSync
(
'cffp_userId'
)}).
then
(
res
=>
{
if
(
!
res
[
'success'
]){
// 清空全部本地存储
uni
.
clearStorageSync
();
uni
.
setStorageSync
(
'loginType'
,
'visitor'
)
uni
.
redirectTo
({
url
:
'/components/login/login'
})
return
}
})
}
let
whiteArr
=
[
'index'
,
'personalCenter'
,
'courselist'
,
'product'
]
// 1. 解析 URL 中的 from 参数
const
getQueryParam
=
(
url
,
key
)
=>
{
...
...
@@ -65,7 +80,7 @@ function hasPermission (url) {
let
islogin
=
uni
.
getStorageSync
(
"isLogin"
);
//在这可以使用token、vuex
// islogin = Boolean(Number(islogin));//返回布尔值
// 在白名单中或有登录判断条件可以直接跳转
console
.
log
(
whiteList
.
indexOf
(
url
.
slice
(
0
,
url
.
indexOf
(
'?'
)))
!==
-
1
);
if
(
whiteList
.
indexOf
(
url
.
slice
(
0
,
url
.
indexOf
(
'?'
)))
!==
-
1
||
islogin
)
{
return
true
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment