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
d84e9d30
Commit
d84e9d30
authored
Jun 16, 2025
by
yuzhenWang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
注销账号bug已修复,已提交测试
parent
132a2700
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
55 additions
and
40 deletions
+55
-40
components/login/login.vue
+2
-15
pages/courseDetail/courseDetail.vue
+1
-1
pages/index/index.vue
+4
-0
pages/invitationRegister/invitationRegister.vue
+2
-2
pages/personalCenter/personalCenter.vue
+25
-20
util/interceptor.ts
+4
-0
util/router.js
+17
-2
No files found.
components/login/login.vue
View file @
d84e9d30
...
...
@@ -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
:
'加载中...'
});
...
...
pages/courseDetail/courseDetail.vue
View file @
d84e9d30
...
...
@@ -571,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 @
d84e9d30
...
...
@@ -223,6 +223,10 @@
this
.
loginornot
=
false
}
else
{
this
.
loginornot
=
true
;
}
if
(
loginType
==
'codelogin'
){
this
.
querySystemMessage
()
}
this
.
queryAreaCenterInfo
();
...
...
pages/invitationRegister/invitationRegister.vue
View file @
d84e9d30
...
...
@@ -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/personalCenter/personalCenter.vue
View file @
d84e9d30
...
...
@@ -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{
// uni.showToast({
// title: res['message'],
// duration: 2000
// });
}
else
{
uni
.
showToast
({
title
:
res
[
'message'
],
duration
:
2000
});
// 清空全部本地存储
uni
.
clearStorageSync
();
uni
.
setStorageSync
(
'loginType'
,
'visitor'
)
this
.
showMyName
=
''
this
.
loginType
=
'visitor'
}
console
.
log
(
'this.showMyName'
,
this
.
showMyName
);
})
}
},
...
...
util/interceptor.ts
View file @
d84e9d30
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 @
d84e9d30
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