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
8306be9e
Commit
8306be9e
authored
Nov 10, 2022
by
kyle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
登录logo路径修改
parent
91ab25ee
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
19 deletions
+33
-19
components/login/login.vue
+16
-2
manifest.json
+14
-14
util/interceptor.ts
+3
-3
No files found.
components/login/login.vue
View file @
8306be9e
<
template
>
<view
class=
"wrapper"
>
<view
class=
"logo"
>
<img
src=
"/static/cffp_logo.jpg
"
alt=
"logo"
srcset=
""
>
<img
:src=
"imgSrc
"
alt=
"logo"
srcset=
""
>
<view>
欢迎登录使用CFFP
</view>
</view>
<view
class=
"content"
>
...
...
@@ -97,7 +97,8 @@
account
:
null
,
doublePassword
:
null
,
agreeFlag
:
false
,
userId
:
null
userId
:
null
,
imgSrc
:
'static/cffp_logo.jpg'
}
},
methods
:
{
...
...
@@ -292,9 +293,22 @@
password
:
null
,
}
},
checkToken
(){
api
.
checkToken
().
then
(
res
=>
{
if
(
res
[
'success'
]){}
else
{
api
.
obtainToken
().
then
(
res
=>
{
if
(
res
.
success
){
uni
.
setStorageSync
(
'uni-token'
,
res
.
data
[
'token'
]);
}
})
}
})
},
},
mounted
()
{
this
.
checkToken
()
}
}
</
script
>
...
...
manifest.json
View file @
8306be9e
...
...
@@ -88,20 +88,20 @@
"router"
:
{
"base"
:
"/cffp/"
,
"mode"
:
"history"
},
"devServer"
:
{
"proxy"
:
{
"/api"
:
{
"port"
:
3000
,
//
端口号
"target"
:
"https://mdev.zuihuibi.cn"
,
//请求的目标域名
"changeOrigin"
:
true
,
//是否跨域
"secure"
:
false
,
//设置支持https协议的代理
"logLevel"
:
"debug"
,
"pathRewrite"
:
{
"^/api"
:
""
}
}
}
}
//
"devServer"
:
{
//
"proxy"
:
{
//
"/api"
:
{
//
"port"
:
3000
,
//
端口号
//
"target"
:
"https://mdev.zuihuibi.cn"
,
//请求的目标域名
//
"changeOrigin"
:
true
,
//是否跨域
//
"secure"
:
false
,
//设置支持https协议的代理
//
"logLevel"
:
"debug"
,
//
"pathRewrite"
:
{
//
"^/api"
:
""
//
}
//
}
//
}
//
}
}
}
util/interceptor.ts
View file @
8306be9e
...
...
@@ -10,14 +10,14 @@ export const interceptor = () => {
// 请求拦截器
invoke
(
args
)
{
//
console.log('请求拦截器',args);
console
.
log
(
'请求拦截器'
,
args
);
// 加载loading
uni
.
showLoading
({
title
:
'加载中...'
})
// 当本地没有token,并且接口地址没在白名单内,需要重新获取token
if
(
!
uni
.
getStorageSync
(
'uni-token'
)
&&
!
whiteApiList
.
includes
(
args
.
url
))
{
//
console.log('-----------')
console
.
log
(
'-----------'
)
return
new
Promise
((
resolve
,
reject
)
=>
{
uni
.
request
({
url
:
'/api/authorize/obtainToken'
,
...
...
@@ -44,7 +44,7 @@ export const interceptor = () => {
'content-type'
:
args
.
method
===
'POST'
?
'application/json'
:
'application/x-www-form-urlencoded'
,
'X-Authorization'
:
uni
.
getStorageSync
(
'uni-token'
)
}
//
console.log(args.header)
console
.
log
(
args
.
header
)
},
// 响应拦截器,可以对数据进行预处理
...
...
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