Commit 8306be9e by kyle

登录logo路径修改

parent 91ab25ee
<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>
......
......@@ -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" : ""
// }
// }
// }
// }
}
}
......@@ -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)
},
// 响应拦截器,可以对数据进行预处理
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment