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
b5a2c407
Commit
b5a2c407
authored
Apr 14, 2023
by
wenyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
IOS上架,按要求调整(1.用户不登录可以访问非基于帐户的功能,默认以游客身份登录)
parent
63dcef6d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
53 additions
and
28 deletions
+53
-28
components/search/search.vue
+20
-15
manifest.json
+1
-1
pages/index/index.vue
+28
-8
util/interceptor.ts
+4
-4
No files found.
components/search/search.vue
View file @
b5a2c407
...
...
@@ -11,7 +11,7 @@
import
api
from
"../../api/api"
;
import
common
from
'../../common/common'
;
export
default
{
props
:[
'isSearch'
],
props
:[
'isSearch'
,
'userId'
],
data
(){
return
{
messageUnreadCount
:
null
,
...
...
@@ -25,21 +25,27 @@
},
methods
:{
jumpToSystemMsg
(){
uni
.
navigateTo
({
url
:
'../systemMsg/system_msg'
})
if
(
this
.
userId
){
uni
.
navigateTo
({
url
:
'../systemMsg/system_msg'
})
}
},
querySystemMessage
(){
api
.
querySystemMessage
({
systemType
:
1
,
userId
:
uni
.
getStorageSync
(
'cffp_userId'
)}).
then
((
res
)
=>
{
if
(
res
[
'success'
]){
this
.
messageUnreadCount
=
res
[
'data'
][
'unReadcount'
];
if
(
Number
(
this
.
messageUnreadCount
)
>
99
){
this
.
messageUnreadCount
=
'99+'
;
}
}
else
{
this
.
messageUnreadCount
=
null
;
}
})
if
(
this
.
userId
){
api
.
querySystemMessage
({
systemType
:
1
,
userId
:
this
.
userId
}).
then
((
res
)
=>
{
if
(
res
[
'success'
]){
this
.
messageUnreadCount
=
res
[
'data'
][
'unReadcount'
];
if
(
Number
(
this
.
messageUnreadCount
)
>
99
){
this
.
messageUnreadCount
=
'99+'
;
}
}
else
{
this
.
messageUnreadCount
=
null
;
}
})
}
else
{
this
.
messageUnreadCount
=
0
;
}
},
searchBtn
(){
if
(
this
.
isSearch
==
1
){
...
...
@@ -54,7 +60,6 @@
url
:
'/pages/courselist/courselist'
})
}
}
},
mounted
()
{
...
...
manifest.json
View file @
b5a2c407
...
...
@@ -2,7 +2,7 @@
"name"
:
"CFFP财富中心"
,
"appid"
:
"__UNI__ED34740"
,
"description"
:
""
,
"versionCode"
:
10
1
,
"versionCode"
:
10
2
,
"transformPx"
:
false
,
/*
5
+App特有相关
*/
"app-plus"
:
{
...
...
pages/index/index.vue
View file @
b5a2c407
...
...
@@ -15,7 +15,7 @@
<text
class=
"iconfont icon-31tishi"
@
click=
"getIntroduce('center')"
></text>
</view>
<!--搜索组件-->
<search
:isSearch=
"0"
></search>
<search
:isSearch=
"0"
:userId =
"userId"
></search>
<!--轮播组件-->
<view
class=
"banner"
>
<view
class=
"uni-margin-wrap"
>
...
...
@@ -170,23 +170,43 @@
search
,
courseItem
},
on
Load
()
{
on
Show
()
{
},
on
Show
()
{
on
Load
()
{
if
(
uni
.
getStorageSync
(
'isLogin'
))
{
this
.
queryAreaCenterInfo
();
this
.
announcementQuery
();
this
.
courseList
()
let
loginType
=
uni
.
getStorageSync
(
'loginType'
)
if
(
loginType
==
"visitor"
){
this
.
loginornot
=
false
};
}
else
{
uni
.
navigateTo
({
/*
uni.navigateTo({
url: '/components/login/login'
}) */
api
.
loginVerification
({
"loginType"
:
1
}).
then
((
res
)
=>
{
if
(
res
[
'success'
]){
this
.
userId
=
String
(
res
[
'data'
][
'userId'
]);
uni
.
setStorageSync
(
'isLogin'
,
'1'
);
uni
.
setStorageSync
(
'cffp_userId'
,
this
.
userId
);
uni
.
setStorageSync
(
'loginType'
,
'visitor'
);
uni
.
setStorageSync
(
'uni-token'
,
res
.
data
[
'token'
]);
this
.
loginornot
=
false
;
this
.
queryAreaCenterInfo
();
this
.
announcementQuery
();
this
.
courseList
()
}
else
{
uni
.
showToast
({
title
:
res
[
'message'
],
duration
:
2000
,
icon
:
'none'
})
}
})
}
let
loginType
=
uni
.
getStorageSync
(
'loginType'
)
if
(
loginType
==
"visitor"
){
this
.
loginornot
=
false
};
},
methods
:
{
goDetail
(
item
){
...
...
util/interceptor.ts
View file @
b5a2c407
//
import {baseURL,apiURL,cffpURL} from "../environments/environment";
import
{
baseURL
,
apiURL
,
cffpURL
}
from
"../environments/environment"
;
// 白名单,不需要携带token就允许被访问的接口
const
whiteApiList
=
[
`
/api/authorize/obtainToken`
,
`/api
/authorize/checkToken`
];
const
whiteApiList
=
[
`
${
apiURL
}
/authorize/obtainToken`
,
`
${
apiURL
}
/authorize/checkToken`
];
export
const
interceptor
=
()
=>
{
uni
.
addInterceptor
(
'request'
,
{
// 请求拦截器
invoke
(
args
)
{
// console.log('请求拦截器',args
);
//console.log('请求拦截器',args.url
);
// 加载loading
// uni.showLoading({
// title: '加载中...'
...
...
@@ -24,7 +24,7 @@ export const interceptor = () => {
params
.
loginId
=
h5userId
;
}
uni
.
request
({
url
:
'/api/authorize/obtainToken'
,
url
:
`
${
apiURL
}
/authorize/obtainToken`
,
method
:
'POST'
,
data
:
params
,
success
:
(
res
)
=>
{
...
...
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