diff --git a/common/custom.scss b/common/custom.scss index 3d15e04..8014d71 100644 --- a/common/custom.scss +++ b/common/custom.scss @@ -57,6 +57,22 @@ display: none; } } +.lbRequiredDot{ + position: relative; + &::after{ + height: 26rpx; + line-height: 26rpx; + display: block; + content: '*'; + position: absolute; + color: red; + top: 50%; + margin-top: -10rpx; + left: -16rpx; + font-size: 30rpx; + font-weight: bold; + } +} .smp-tag{ margin: 0 20rpx 20rpx 0; display: inline-block; } diff --git a/common/validate.js b/common/validate.js index 767f6df..3190017 100644 --- a/common/validate.js +++ b/common/validate.js @@ -1,6 +1,6 @@ import { showToast } from "./untool" -const checkParams = (param, validConfig)=> { - return new Promise((resolve)=> { +const checkParams = (param, validConfig, showErrMsg = true)=> { + return new Promise((resolve, reject)=> { let errMsg = '' Object.keys(validConfig).map(key=> { const itemConf = validConfig[key] @@ -13,7 +13,8 @@ const checkParams = (param, validConfig)=> { } }) if(errMsg) { - showToast(errMsg) + showErrMsg && showToast(errMsg) + reject() } else { resolve() } diff --git a/main.js b/main.js index 0466f10..73edc2b 100644 --- a/main.js +++ b/main.js @@ -50,7 +50,7 @@ export function createApp() { } // 其他组件属性配置 // ...... - } + }, }) app.use(store) diff --git a/store/modules/user.js b/store/modules/user.js index 25bc630..3f5bfff 100644 --- a/store/modules/user.js +++ b/store/modules/user.js @@ -67,7 +67,6 @@ export default { }, options) { if(!state.token) { console.log('缺少token') - // TODO setTimeout(()=> { goto("login/login", 2) }, 200)