Commit 18f77d7c authored by 郭欢's avatar 郭欢

'token过期逻辑,首页修改,'

parent ed247072
...@@ -26,6 +26,7 @@ export default { ...@@ -26,6 +26,7 @@ export default {
// 登录相关 // 登录相关
SENDCODE: baseUrl + '/worker/send', // 发送验证码 SENDCODE: baseUrl + '/worker/send', // 发送验证码
BINDLOGIN: baseUrl + '/worker/bind/login', // 手机号验证码登录绑定微信 BINDLOGIN: baseUrl + '/worker/bind/login', // 手机号验证码登录绑定微信
REFRESHTOKEN: baseUrl + '/worker/change/token',
USERINFO: baseUrl + '/worker/user/info', // 获取用户信息 USERINFO: baseUrl + '/worker/user/info', // 获取用户信息
REPAIR_LIST: baseUrl + '/worker/repair/list', // 工人/审核员端报修单列表 REPAIR_LIST: baseUrl + '/worker/repair/list', // 工人/审核员端报修单列表
......
...@@ -5,14 +5,15 @@ export function updateToken (cb, errcb) { ...@@ -5,14 +5,15 @@ export function updateToken (cb, errcb) {
.post(apiList.REFRESHTOKEN, null, { .post(apiList.REFRESHTOKEN, null, {
headers: { headers: {
token: window.localStorage.getItem('token'), token: window.localStorage.getItem('token'),
type: 1 // type: 1
} }
}) })
.then((response) => { .then((response) => {
console.log(response, 'response--------')
if (response.status === 200) { if (response.status === 200) {
const curdata = response.data const curdata = response.data
const code = curdata.code const code = curdata.meta.code
const msg = curdata.msg const msg = curdata.meta.message
console.log('换取token ' + code + ' --- ' + msg) console.log('换取token ' + code + ' --- ' + msg)
if (code === 200) { if (code === 200) {
window.localStorage.setItem('token', curdata.data.token) window.localStorage.setItem('token', curdata.data.token)
...@@ -22,7 +23,7 @@ export function updateToken (cb, errcb) { ...@@ -22,7 +23,7 @@ export function updateToken (cb, errcb) {
typeof cb === 'function' && cb() typeof cb === 'function' && cb()
} else { } else {
console.log('token换取失败-------', curdata) console.log('token换取失败-------', curdata)
// typeof errcb === 'function' && errcb(curdata) typeof errcb === 'function' && errcb(curdata)
} }
} }
}) })
......
@import "../global.scss"; @import "../global.scss";
.cont {
.tips-cont { min-height: 100vh;
@extend .flex-h; background: #fff;
@extend .flex-space-between; padding: 0.4rem 0rem;
width: 100%; }
height: 2.36rem; .top {
background: $color-main; height: 0.36rem;
color: #ffffff; margin-bottom: 0.38rem;
padding: .4rem .3rem .3rem .3rem; margin-left: 0.3rem;
font-size: .28rem; }
.top .point {
.left-cont { width: 0.1rem;
width: 4rem; height: 0.1rem;
background: #0054ff;
.tips-title { border-radius: 50%;
@extend .flex-h; margin-right: 0.13rem;
@extend .flex-align-center; }
font-size: .36rem; .top .status {
margin-bottom: .16rem; color: #0054ff;
font-size: 0.36rem;
img { font-weight: bold;
width: .35rem; }
height: .35rem; .menu .hc_total {
margin-left: .12rem; color: #727272;
vertical-align: middle; font-size: 0.28rem;
} }
} .menu .options {
width: 1.76rem;
.tip-text { height: 0.58rem;
font-size: .32rem; background: #ffffff;
margin-top: .2rem; border: 1px solid #0054ff;
} border-radius: 0.12rem;
} color: #0054ff;
font-size: 0.28rem;
.btn { line-height: 0.58rem;
@extend .flex-h; text-align: center;
@extend .flex-hc; position: relative;
@extend .flex-align-center; z-index: 10;
min-width: 1.6rem; margin-right: 0.3rem;
max-width: 2.5rem; }
height: .46rem; .menu .options .option-box {
border: 1px solid #ffffff; width: 1.7rem;
text-align: center; // height: 2rem;
line-height: .46rem; background: #fff;
border-radius: .25rem; border: 1px solid #0054ff;
font-size: .28rem; position: absolute;
padding: 0 .1rem; top: 0.57rem;
left: 0rem;
p { z-index: 10;
margin-right: .05rem; border-radius: 0 0 0.12rem 0.12rem;
} }
.order-item {
.iconfont { width: 6.9rem;
font-size: .16rem;
}
}
.purchase-btn {
width: 1.88rem;
height: .6rem;
line-height: .6rem;
color: #000000;
background: #FFCA3C;
text-align: center;
line-height: .6rem;
border-radius: .16rem;
margin-top: .56rem;
// &.disabled-btn {
// color: #cccccc;
// background: #aca9a2;
// }
&.disabled-btn {
opacity: 0.6;
}
}
}
.content {
padding: .1rem .3rem;
background: #ffffff; background: #ffffff;
margin-top: .12rem; box-shadow: 0px 0px 0.12rem 0.01rem rgba(214, 214, 214, 0.78);
border-radius: 0.12rem;
margin: 0.4rem auto 0.2rem;
padding: 0.4rem 0.3rem;
font-size: 0.3rem;
} }
.title {
.placeholder-view { color: #0054ff;
font-size: 0.32rem;
font-weight: bold;
margin-bottom: 0.5rem;
}
.item {
// height: 0.3rem;
margin-bottom: 0.2rem;
}
.item-title {
// min-width: 1.5rem;
color: #000000;
}
.item-desc {
color: #727272;
}
.que-desc {
margin: .2rem auto;
}
.img {
width: 1.2rem;
height: 1.2rem;
border-radius: 0.08rem;
margin-top: 0.08rem;
}
.img img {
width: 100%; width: 100%;
height: 2rem; height: 100%;
border-radius: 0.08rem;
margin-left: 0.16rem;
margin-right: 0.16rem;
}
.list-item {
margin-bottom: 0.4rem;
}
.line {
width: 6.28rem;
height: 0.01rem;
background: #f1f1f1;
margin-bottom: 0.4rem;
}
.ma-item {
margin-top: 0.3rem;
}
.one {
color: #727272;
margin-bottom: 0.3rem;
}
.one-item {
margin-left: 0.3rem;
margin-right: 0.3rem;
}
.btn-item {
width: 1.8rem;
height: 0.7rem;
background: #0054ff;
border-radius: 0.35rem;
text-align: center;
line-height: 0.7rem;
color: #fff;
font-size: 0.27rem;
margin-left: 0.2rem;
}
.sf-btn {
background: #ffffff; background: #ffffff;
border: 1px solid #0054ff;
color: #0054ff;
}
.blank {
height: 1rem;
}
.van-popup {
width: 6.9rem;
max-height: 7rem;
// height: 5.9rem;
background: #fff;
border-radius: 0.12rem;
padding-top: 0.4rem;
padding-bottom: 0.2rem;
text-align: center;
}
.pop_title {
color: #000000;
font-size: 0.36rem;
font-weight: bold;
margin-bottom: 0.4rem;
}
.van-popup textarea {
width: 6.3rem;
height: 3rem;
border: 1px solid #f1f1f1;
border-radius: 0.08rem;
padding: 0.3rem 0.2rem;
}
.van-popup textarea::-webkit-input-placeholder {
color: #c8c8c8;
font-size: 0.26rem;
}
.btnItem {
margin-top: 0.4rem;
margin-left: 0.65rem;
}
.btnItem .cancel {
width: 2.65rem;
height: 0.78rem;
border: 1px solid #c8c8c8;
border-radius: 0.39rem;
color: #000000;
font-size: 0.32rem;
text-align: center;
line-height: 0.78rem;
margin-right: 0.3rem;
}
.btnItem .sure {
width: 2.65rem;
height: 0.78rem;
background: linear-gradient(270deg, #0054ff, #1965ff);
border-radius: 0.39rem;
color: #ffffff;
font-size: 0.32rem;
text-align: center;
line-height: 0.78rem;
margin-right: 0.3rem;
}
.input {
width: 6.3rem;
height: 0.76rem;
background: #ffffff;
border: 1px solid #f1f1f1;
border-radius: 0.08rem;
text-align: left;
padding-left: 0.2rem;
margin-bottom: 0.1rem;
font-size: 0.3rem;
}
.input::-webkit-input-placeholder {
color: #c8c8c8;
font-size: 0.3rem;
}
.math-btn {
margin-left: 0.3rem;
margin-right: 0.3rem;
color: #0256ff;
font-size: 0.3rem;
}
.hc_total {
text-align: left;
color: #000000;
font-size: 0.26rem;
margin-left: 0.3rem;
}
.sure-btn {
width: 3.12rem;
height: 0.78rem;
background: linear-gradient(270deg, #0054ff, #1965ff);
border-radius: 0.39rem;
color: #ffffff;
text-align: center;
line-height: 0.78rem;
margin: 1.2rem auto;
} }
\ No newline at end of file
This diff is collapsed.
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