Showing
8 changed files
with
75 additions
and
32 deletions
| @@ -93,7 +93,7 @@ export default { | @@ -93,7 +93,7 @@ export default { | ||
| 93 | background-color: #fff; | 93 | background-color: #fff; |
| 94 | color: #333; | 94 | color: #333; |
| 95 | border-radius: 20rpx; | 95 | border-radius: 20rpx; |
| 96 | - font-size: 30rpx; | 96 | + font-size: 15px; |
| 97 | margin-top: 30rpx; | 97 | margin-top: 30rpx; |
| 98 | padding: 30rpx; | 98 | padding: 30rpx; |
| 99 | } | 99 | } |
| @@ -108,11 +108,11 @@ export default { | @@ -108,11 +108,11 @@ export default { | ||
| 108 | align-items: center; | 108 | align-items: center; |
| 109 | .detail-label { | 109 | .detail-label { |
| 110 | color: #333; | 110 | color: #333; |
| 111 | - font-size: 30rpx; | 111 | + font-size: 15px; |
| 112 | } | 112 | } |
| 113 | .detail-value { | 113 | .detail-value { |
| 114 | color: #666; | 114 | color: #666; |
| 115 | - font-size: 28rpx; | 115 | + font-size: 14px; |
| 116 | margin-left: 30rpx; | 116 | margin-left: 30rpx; |
| 117 | } | 117 | } |
| 118 | } | 118 | } |
| @@ -236,7 +236,7 @@ export default { | @@ -236,7 +236,7 @@ export default { | ||
| 236 | .item { | 236 | .item { |
| 237 | padding: 30rpx; | 237 | padding: 30rpx; |
| 238 | view { | 238 | view { |
| 239 | - font-size: 28rpx; | 239 | + font-size: 14px; |
| 240 | margin-bottom: 10rpx; | 240 | margin-bottom: 10rpx; |
| 241 | } | 241 | } |
| 242 | .time { | 242 | .time { |
| @@ -247,7 +247,7 @@ export default { | @@ -247,7 +247,7 @@ export default { | ||
| 247 | display: flex; | 247 | display: flex; |
| 248 | justify-content: space-between; | 248 | justify-content: space-between; |
| 249 | align-items: center; | 249 | align-items: center; |
| 250 | - font-size: 30rpx; | 250 | + font-size: 15px; |
| 251 | font-weight: 500; | 251 | font-weight: 500; |
| 252 | align-items: center; | 252 | align-items: center; |
| 253 | .item-right { | 253 | .item-right { |
| @@ -256,7 +256,7 @@ export default { | @@ -256,7 +256,7 @@ export default { | ||
| 256 | align-items: center; | 256 | align-items: center; |
| 257 | width: 104rpx; | 257 | width: 104rpx; |
| 258 | height: 36rpx; | 258 | height: 36rpx; |
| 259 | - font-size: 20rpx; | 259 | + font-size: 10px; |
| 260 | border-radius: 20rpx; | 260 | border-radius: 20rpx; |
| 261 | } | 261 | } |
| 262 | .item-fail { | 262 | .item-fail { |
| @@ -276,7 +276,7 @@ export default { | @@ -276,7 +276,7 @@ export default { | ||
| 276 | .filter-title { | 276 | .filter-title { |
| 277 | text-align: center; | 277 | text-align: center; |
| 278 | margin-top: 14px; | 278 | margin-top: 14px; |
| 279 | - font-size: 32rpx; | 279 | + font-size: 16px; |
| 280 | font-weight: 700; | 280 | font-weight: 700; |
| 281 | } | 281 | } |
| 282 | .button-group { | 282 | .button-group { |
| @@ -44,7 +44,10 @@ | @@ -44,7 +44,10 @@ | ||
| 44 | </text> | 44 | </text> |
| 45 | </view> | 45 | </view> |
| 46 | </view> | 46 | </view> |
| 47 | - <view>{{ Object.entries(item.details.data)[0][0] }} : <text style="font-weight: bold; margin-left:4rpx;">{{ Object.entries(item.details.data)[0][1] }}</text></view> | 47 | + <view> |
| 48 | + {{ Object.entries(item.details.data)[0][0] }} : | ||
| 49 | + <text style="font-weight: bold; margin-left:4rpx;">{{ Object.entries(item.details.data)[0][1] }}</text> | ||
| 50 | + </view> | ||
| 48 | <view v-if="item.status"> | 51 | <view v-if="item.status"> |
| 49 | 告警状态:{{ | 52 | 告警状态:{{ |
| 50 | item.status === 'CLEARED_UNACK' ? '清除未确认' : item.status === 'CLEARED_ACK' ? '清除已确认' : item.status === 'ACTIVE_UNACK' ? '激活未确认' : '激活已确认' | 53 | item.status === 'CLEARED_UNACK' ? '清除未确认' : item.status === 'CLEARED_ACK' ? '清除已确认' : item.status === 'ACTIVE_UNACK' ? '激活未确认' : '激活已确认' |
| @@ -55,8 +58,8 @@ | @@ -55,8 +58,8 @@ | ||
| 55 | </view> | 58 | </view> |
| 56 | </mescroll-body> | 59 | </mescroll-body> |
| 57 | <!-- 告警筛选 --> | 60 | <!-- 告警筛选 --> |
| 58 | - <u-popup @close="close" closeable bgColor="#fff" :show="show" mode="bottom" :round="20"> | ||
| 59 | - <view class="filter"> | 61 | + <u-popup @close="close" closeable bgColor="#fff" :show="show" mode="bottom" :round="20" @touchmove.stop.prevent="disabledScroll"> |
| 62 | + <view class="filter" @touchmove.stop.prevent="disabledScroll"> | ||
| 60 | <view class="filter-title"><text>筛选条件</text></view> | 63 | <view class="filter-title"><text>筛选条件</text></view> |
| 61 | <FilterItem :filterList="alarmStatus" title="告警状态" @clickTag="currentIndex => handleClickTag(currentIndex, alarmStatus)"></FilterItem> | 64 | <FilterItem :filterList="alarmStatus" title="告警状态" @clickTag="currentIndex => handleClickTag(currentIndex, alarmStatus)"></FilterItem> |
| 62 | <FilterItem :filterList="typeStatus" title="设备类型" @clickTag="currentIndex => handleClickTag(currentIndex, typeStatus)"></FilterItem> | 65 | <FilterItem :filterList="typeStatus" title="设备类型" @clickTag="currentIndex => handleClickTag(currentIndex, typeStatus)"></FilterItem> |
| @@ -208,7 +211,7 @@ export default { | @@ -208,7 +211,7 @@ export default { | ||
| 208 | { | 211 | { |
| 209 | checked: false, | 212 | checked: false, |
| 210 | name: '近一天', | 213 | name: '近一天', |
| 211 | - type: '1440000' | 214 | + type: '86400000' |
| 212 | } | 215 | } |
| 213 | ], | 216 | ], |
| 214 | downOption: { | 217 | downOption: { |
| @@ -221,6 +224,9 @@ export default { | @@ -221,6 +224,9 @@ export default { | ||
| 221 | }; | 224 | }; |
| 222 | }, | 225 | }, |
| 223 | methods: { | 226 | methods: { |
| 227 | + disabledScroll(){ | ||
| 228 | + return; | ||
| 229 | + }, | ||
| 224 | /*下拉刷新的回调 */ | 230 | /*下拉刷新的回调 */ |
| 225 | downCallback() { | 231 | downCallback() { |
| 226 | //联网加载数据 | 232 | //联网加载数据 |
| @@ -333,7 +339,7 @@ export default { | @@ -333,7 +339,7 @@ export default { | ||
| 333 | 339 | ||
| 334 | <style lang="scss" scoped> | 340 | <style lang="scss" scoped> |
| 335 | .filter-button { | 341 | .filter-button { |
| 336 | - font-size: 24rpx; | 342 | + font-size: 12px; |
| 337 | width: 160rpx; | 343 | width: 160rpx; |
| 338 | height: 64rpx; | 344 | height: 64rpx; |
| 339 | border-radius: 32rpx; | 345 | border-radius: 32rpx; |
| @@ -360,7 +366,7 @@ export default { | @@ -360,7 +366,7 @@ export default { | ||
| 360 | .item { | 366 | .item { |
| 361 | padding: 30rpx; | 367 | padding: 30rpx; |
| 362 | view { | 368 | view { |
| 363 | - font-size: 28rpx; | 369 | + font-size: 14px; |
| 364 | margin-bottom: 10rpx; | 370 | margin-bottom: 10rpx; |
| 365 | } | 371 | } |
| 366 | .time { | 372 | .time { |
| @@ -369,7 +375,7 @@ export default { | @@ -369,7 +375,7 @@ export default { | ||
| 369 | .item-first { | 375 | .item-first { |
| 370 | display: flex; | 376 | display: flex; |
| 371 | justify-content: space-between; | 377 | justify-content: space-between; |
| 372 | - font-size: 30rpx; | 378 | + font-size: 15px; |
| 373 | font-weight: 500; | 379 | font-weight: 500; |
| 374 | align-items: center; | 380 | align-items: center; |
| 375 | .item-right { | 381 | .item-right { |
| @@ -391,7 +397,7 @@ export default { | @@ -391,7 +397,7 @@ export default { | ||
| 391 | .filter-title { | 397 | .filter-title { |
| 392 | text-align: center; | 398 | text-align: center; |
| 393 | margin-top: 14px; | 399 | margin-top: 14px; |
| 394 | - font-size: 32rpx; | 400 | + font-size: 16px; |
| 395 | font-weight: 700; | 401 | font-weight: 700; |
| 396 | } | 402 | } |
| 397 | .button-group { | 403 | .button-group { |
| @@ -53,7 +53,7 @@ | @@ -53,7 +53,7 @@ | ||
| 53 | <view style="width: 100%; padding: 0 30rpx;"> | 53 | <view style="width: 100%; padding: 0 30rpx;"> |
| 54 | <view style="text-align: center; font-weight:700;margin-bottom: 40rpx;">命令下发</view> | 54 | <view style="text-align: center; font-weight:700;margin-bottom: 40rpx;">命令下发</view> |
| 55 | <view class="u-flex"> | 55 | <view class="u-flex"> |
| 56 | - <text style="color: #333; font-size: 28rpx;font-weight:700;margin-right: 30rpx;">下发类型:</text> | 56 | + <text style="color: #333; font-size: 14px;font-weight:700;margin-right: 30rpx;">下发类型:</text> |
| 57 | 57 | ||
| 58 | <u-radio-group v-model="commandType" placement="row"> | 58 | <u-radio-group v-model="commandType" placement="row"> |
| 59 | <u-radio activeColor="#3388FF" label="OneWay" name="OneWay"></u-radio> | 59 | <u-radio activeColor="#3388FF" label="OneWay" name="OneWay"></u-radio> |
| @@ -138,6 +138,7 @@ export default { | @@ -138,6 +138,7 @@ export default { | ||
| 138 | }; | 138 | }; |
| 139 | await issueCommand(this.commandType, this.deviceDetail.tbDeviceId, commandValue); | 139 | await issueCommand(this.commandType, this.deviceDetail.tbDeviceId, commandValue); |
| 140 | this.hiddenModal(); | 140 | this.hiddenModal(); |
| 141 | + uni.$u.toast('下发成功~'); | ||
| 141 | } catch (e) { | 142 | } catch (e) { |
| 142 | uni.$u.toast('下发失败~'); | 143 | uni.$u.toast('下发失败~'); |
| 143 | } | 144 | } |
| @@ -171,11 +172,11 @@ export default { | @@ -171,11 +172,11 @@ export default { | ||
| 171 | align-items: center; | 172 | align-items: center; |
| 172 | .detail-label { | 173 | .detail-label { |
| 173 | color: #333; | 174 | color: #333; |
| 174 | - font-size: 30rpx; | 175 | + font-size: 15px; |
| 175 | } | 176 | } |
| 176 | .detail-value { | 177 | .detail-value { |
| 177 | color: #666; | 178 | color: #666; |
| 178 | - font-size: 28rpx; | 179 | + font-size: 14px; |
| 179 | margin-left: 30rpx; | 180 | margin-left: 30rpx; |
| 180 | } | 181 | } |
| 181 | } | 182 | } |
| @@ -35,7 +35,7 @@ export default { | @@ -35,7 +35,7 @@ export default { | ||
| 35 | display: flex; | 35 | display: flex; |
| 36 | justify-content: space-between; | 36 | justify-content: space-between; |
| 37 | color: #333; | 37 | color: #333; |
| 38 | - font-size: 32rpx; | 38 | + font-size: 16px; |
| 39 | font-family: PingFangSC-Medium, PingFang SC; | 39 | font-family: PingFangSC-Medium, PingFang SC; |
| 40 | font-weight: bold; | 40 | font-weight: bold; |
| 41 | .item-value { | 41 | .item-value { |
| @@ -44,7 +44,7 @@ export default { | @@ -44,7 +44,7 @@ export default { | ||
| 44 | } | 44 | } |
| 45 | .item-time { | 45 | .item-time { |
| 46 | margin-top: 4rpx; | 46 | margin-top: 4rpx; |
| 47 | - font-size: 26rpx; | 47 | + font-size: 13px; |
| 48 | color: #999; | 48 | color: #999; |
| 49 | } | 49 | } |
| 50 | } | 50 | } |
| @@ -37,7 +37,7 @@ | @@ -37,7 +37,7 @@ | ||
| 37 | " | 37 | " |
| 38 | > | 38 | > |
| 39 | <view style="width: 450rpx; text-align: left"> | 39 | <view style="width: 450rpx; text-align: left"> |
| 40 | - <text style="color: #333; font-size: 30rpx;font-weight: bold;">{{ item.name }}</text> | 40 | + <text style="color: #333; font-size: 15px;font-weight: bold;">{{ item.name }}</text> |
| 41 | </view> | 41 | </view> |
| 42 | <view style="width: 450rpx; text-align: left; margin-top: 10rpx"> | 42 | <view style="width: 450rpx; text-align: left; margin-top: 10rpx"> |
| 43 | <view style="color: #666; font-size: 14px;display: flex;"> | 43 | <view style="color: #666; font-size: 14px;display: flex;"> |
| @@ -194,6 +194,7 @@ export default { | @@ -194,6 +194,7 @@ export default { | ||
| 194 | async onLoad(options) { | 194 | async onLoad(options) { |
| 195 | // 隐藏原生的tabbar | 195 | // 隐藏原生的tabbar |
| 196 | uni.hideTabBar(); | 196 | uni.hideTabBar(); |
| 197 | + this.page.num = 1; | ||
| 197 | const { deviceState } = options; | 198 | const { deviceState } = options; |
| 198 | this.deviceState = deviceState; | 199 | this.deviceState = deviceState; |
| 199 | if (deviceState) { | 200 | if (deviceState) { |
| @@ -371,7 +372,7 @@ export default { | @@ -371,7 +372,7 @@ export default { | ||
| 371 | .filter-title { | 372 | .filter-title { |
| 372 | text-align: center; | 373 | text-align: center; |
| 373 | margin-top: 14px; | 374 | margin-top: 14px; |
| 374 | - font-size: 32rpx; | 375 | + font-size: 16px; |
| 375 | font-weight: 700; | 376 | font-weight: 700; |
| 376 | } | 377 | } |
| 377 | .button-group { | 378 | .button-group { |
| @@ -383,4 +384,4 @@ export default { | @@ -383,4 +384,4 @@ export default { | ||
| 383 | } | 384 | } |
| 384 | } | 385 | } |
| 385 | } | 386 | } |
| 386 | -</style> | 387 | +</style> |
| @@ -64,7 +64,7 @@ | @@ -64,7 +64,7 @@ | ||
| 64 | <!-- 基础统计 --> | 64 | <!-- 基础统计 --> |
| 65 | <!-- 四宫格CSS最新网格布局--> | 65 | <!-- 四宫格CSS最新网格布局--> |
| 66 | <view class="grid-container"> | 66 | <view class="grid-container"> |
| 67 | - <view class="grid-item"> | 67 | + <view class="grid-item" @click="showToastWip()"> |
| 68 | <view class="item-center"> | 68 | <view class="item-center"> |
| 69 | <view class="center"><image class="image" src="../../static/form.png"></image></view> | 69 | <view class="center"><image class="image" src="../../static/form.png"></image></view> |
| 70 | <view class="center-text"><text class="text text-muted">维修工单</text></view> | 70 | <view class="center-text"><text class="text text-muted">维修工单</text></view> |
| @@ -76,7 +76,7 @@ | @@ -76,7 +76,7 @@ | ||
| 76 | <view class="center-text"><text class="text text-muted" style="">摄像头管理</text></view> | 76 | <view class="center-text"><text class="text text-muted" style="">摄像头管理</text></view> |
| 77 | </view> | 77 | </view> |
| 78 | </view> | 78 | </view> |
| 79 | - <view class="grid-item"> | 79 | + <view class="grid-item" @click="showToastWip()"> |
| 80 | <view class="item-center"> | 80 | <view class="item-center"> |
| 81 | <view class="center"><image class="image" src="../../static/device.png"></image></view> | 81 | <view class="center"><image class="image" src="../../static/device.png"></image></view> |
| 82 | <view class="center-text"><text class="text text-muted">设备接入</text></view> | 82 | <view class="center-text"><text class="text text-muted">设备接入</text></view> |
| @@ -138,15 +138,21 @@ export default { | @@ -138,15 +138,21 @@ export default { | ||
| 138 | } | 138 | } |
| 139 | }); | 139 | }); |
| 140 | }, | 140 | }, |
| 141 | + showToastWip(){ | ||
| 142 | + uni.$u.toast('拼命开发中 ...') | ||
| 143 | + }, | ||
| 141 | openCamera() { | 144 | openCamera() { |
| 142 | - uni.navigateTo({ | ||
| 143 | - url: 'camera/camera' | ||
| 144 | - }); | 145 | + // uni.navigateTo({ |
| 146 | + // url: 'camera/camera' | ||
| 147 | + // }); | ||
| 148 | + this.showToastWip() | ||
| 145 | }, | 149 | }, |
| 146 | openOrgStatus() { | 150 | openOrgStatus() { |
| 147 | // uni.navigateTo({ | 151 | // uni.navigateTo({ |
| 148 | // url: 'configuration/configuration' | 152 | // url: 'configuration/configuration' |
| 149 | // }); | 153 | // }); |
| 154 | + this.showToastWip() | ||
| 155 | + | ||
| 150 | }, | 156 | }, |
| 151 | //告警状态查询 | 157 | //告警状态查询 |
| 152 | navigatorAlarmStatus(e) { | 158 | navigatorAlarmStatus(e) { |
| @@ -5,6 +5,7 @@ | @@ -5,6 +5,7 @@ | ||
| 5 | <view class="u-flex login-main"> | 5 | <view class="u-flex login-main"> |
| 6 | <view class="content"> | 6 | <view class="content"> |
| 7 | <view class="hello login-text-muted">您好,</view> | 7 | <view class="hello login-text-muted">您好,</view> |
| 8 | + | ||
| 8 | <view class="hello-welcome login-text-muted">欢迎来到ThingsKit!</view> | 9 | <view class="hello-welcome login-text-muted">欢迎来到ThingsKit!</view> |
| 9 | </view> | 10 | </view> |
| 10 | </view> | 11 | </view> |
| @@ -16,19 +17,26 @@ | @@ -16,19 +17,26 @@ | ||
| 16 | </view> | 17 | </view> |
| 17 | <view class="form-row u-flex"> | 18 | <view class="form-row u-flex"> |
| 18 | <view class="v-input"><input type="text" v-model="loginForm.password" maxlength="32" placeholder="请输入登录密码" :password="!showPassword" /></view> | 19 | <view class="v-input"><input type="text" v-model="loginForm.password" maxlength="32" placeholder="请输入登录密码" :password="!showPassword" /></view> |
| 19 | - <view class="v-password" @click.stop="showPasswordMode"> | ||
| 20 | - <u-icon color="#9a9a9a" width="18" height="15" :name="showPassword ? '/static/eye.png' : '/static/eye-hide.png'"></u-icon> | 20 | + <view class="v-password" style="padding: 30rpx" @click="showPasswordMode"> |
| 21 | + <u-icon color="#9a9a9a" :name="showPassword ? '/static/eye.png' : '/static/eye-hide.png'"></u-icon> | ||
| 21 | </view> | 22 | </view> |
| 23 | + | ||
| 22 | <u-icon></u-icon> | 24 | <u-icon></u-icon> |
| 23 | </view> | 25 | </view> |
| 26 | + | ||
| 24 | <button class="submit" size="default" @click="onSubmitFunc"><text class="text">登录</text></button> | 27 | <button class="submit" size="default" @click="onSubmitFunc"><text class="text">登录</text></button> |
| 28 | + | ||
| 25 | <view class="u-flex row-item"> | 29 | <view class="u-flex row-item"> |
| 26 | <view class="row-phone login-text-gray" @click="openCodeFunc">手机验证码登录</view> | 30 | <view class="row-phone login-text-gray" @click="openCodeFunc">手机验证码登录</view> |
| 31 | + | ||
| 27 | <view class="row-reset login-text-gray" @click="findPassrordFunc">忘记密码</view> | 32 | <view class="row-reset login-text-gray" @click="findPassrordFunc">忘记密码</view> |
| 28 | </view> | 33 | </view> |
| 34 | + | ||
| 29 | <view class="u-flex link-login"> | 35 | <view class="u-flex link-login"> |
| 30 | <view class="link-text login-text-gray">第三方账号登录</view> | 36 | <view class="link-text login-text-gray">第三方账号登录</view> |
| 37 | + | ||
| 31 | <view style="height: 20rpx"></view> | 38 | <view style="height: 20rpx"></view> |
| 39 | + | ||
| 32 | <button class="link-image" @tap="onWenxinAuthorization"><image class="image" src="../../static/weixin.png" mode="aspectFill"></image></button> | 40 | <button class="link-image" @tap="onWenxinAuthorization"><image class="image" src="../../static/weixin.png" mode="aspectFill"></image></button> |
| 33 | </view> | 41 | </view> |
| 34 | </view> | 42 | </view> |
| @@ -129,20 +137,26 @@ export default { | @@ -129,20 +137,26 @@ export default { | ||
| 129 | }); | 137 | }); |
| 130 | } | 138 | } |
| 131 | }) | 139 | }) |
| 140 | + | ||
| 132 | .catch(e => { | 141 | .catch(e => { |
| 133 | - // uni.$u.toast(e.data?.message); | 142 | + uni.$u.toast(e.data?.message); |
| 134 | }); | 143 | }); |
| 135 | } | 144 | } |
| 136 | }, | 145 | }, |
| 146 | + | ||
| 137 | fail: res => { | 147 | fail: res => { |
| 138 | //拒绝授权 | 148 | //拒绝授权 |
| 149 | + | ||
| 139 | return; | 150 | return; |
| 140 | } | 151 | } |
| 141 | }); | 152 | }); |
| 142 | }, | 153 | }, |
| 154 | + | ||
| 143 | //#endif | 155 | //#endif |
| 156 | + | ||
| 144 | saveUserInfo() { | 157 | saveUserInfo() { |
| 145 | //储存个人信息 | 158 | //储存个人信息 |
| 159 | + | ||
| 146 | uni.$u.http.get('/yt/user/me/info').then(res => { | 160 | uni.$u.http.get('/yt/user/me/info').then(res => { |
| 147 | if (res) { | 161 | if (res) { |
| 148 | this.setUserInfo(res); | 162 | this.setUserInfo(res); |
| @@ -161,39 +175,53 @@ export default { | @@ -161,39 +175,53 @@ export default { | ||
| 161 | return uni.$u.toast('请输入登录账号~'); | 175 | return uni.$u.toast('请输入登录账号~'); |
| 162 | } | 176 | } |
| 163 | const passReg = /^(?=.*?[A-Z])(?=(.*[a-z]){1,})(?=(.*[\d]){1,})(?=(.*[\W]){1,})(?!.*\s).{8,}$/; | 177 | const passReg = /^(?=.*?[A-Z])(?=(.*[a-z]){1,})(?=(.*[\d]){1,})(?=(.*[\W]){1,})(?!.*\s).{8,}$/; |
| 178 | + | ||
| 164 | if (this.loginForm.password == '') { | 179 | if (this.loginForm.password == '') { |
| 165 | uni.showToast({ | 180 | uni.showToast({ |
| 166 | title: '请输入登录密码~', | 181 | title: '请输入登录密码~', |
| 182 | + | ||
| 167 | icon: 'none' | 183 | icon: 'none' |
| 168 | }); | 184 | }); |
| 169 | return; | 185 | return; |
| 170 | } else if (!passReg.test(this.loginForm.password)) { | 186 | } else if (!passReg.test(this.loginForm.password)) { |
| 171 | uni.showToast({ | 187 | uni.showToast({ |
| 172 | title: '密码格式不正确(至少一个大写英文字母、至少一个小写英文字母、至少一位数字、至少一个特殊字符、最少八个字符)~', | 188 | title: '密码格式不正确(至少一个大写英文字母、至少一个小写英文字母、至少一位数字、至少一个特殊字符、最少八个字符)~', |
| 189 | + | ||
| 173 | icon: 'none', | 190 | icon: 'none', |
| 191 | + | ||
| 174 | duration: 3000 | 192 | duration: 3000 |
| 175 | }); | 193 | }); |
| 194 | + | ||
| 176 | return; | 195 | return; |
| 177 | } | 196 | } |
| 178 | uni.$u.http | 197 | uni.$u.http |
| 179 | .post('/auth/login', this.loginForm) | 198 | .post('/auth/login', this.loginForm) |
| 199 | + | ||
| 180 | .then(res => { | 200 | .then(res => { |
| 181 | if (res) { | 201 | if (res) { |
| 182 | // 储存登录信息 | 202 | // 储存登录信息 |
| 203 | + | ||
| 183 | let resObj = { | 204 | let resObj = { |
| 184 | refreshToken: res.refreshToken, | 205 | refreshToken: res.refreshToken, |
| 206 | + | ||
| 185 | isToken: res.token | 207 | isToken: res.token |
| 186 | }; | 208 | }; |
| 209 | + | ||
| 187 | let userInfo = { | 210 | let userInfo = { |
| 188 | ...resObj, | 211 | ...resObj, |
| 212 | + | ||
| 189 | token: true, //token用于判断是否登录 | 213 | token: true, //token用于判断是否登录 |
| 214 | + | ||
| 190 | isThirdLogin: false | 215 | isThirdLogin: false |
| 191 | }; | 216 | }; |
| 217 | + | ||
| 192 | if (userInfo.token) { | 218 | if (userInfo.token) { |
| 193 | this.setUserInfo(userInfo); | 219 | this.setUserInfo(userInfo); |
| 194 | } | 220 | } |
| 221 | + | ||
| 195 | uni.showToast({ | 222 | uni.showToast({ |
| 196 | title: '登录成功~', | 223 | title: '登录成功~', |
| 224 | + | ||
| 197 | icon: 'none' | 225 | icon: 'none' |
| 198 | }).then(async res => { | 226 | }).then(async res => { |
| 199 | this.saveUserInfo(); | 227 | this.saveUserInfo(); |
| @@ -204,6 +232,7 @@ export default { | @@ -204,6 +232,7 @@ export default { | ||
| 204 | }); | 232 | }); |
| 205 | } | 233 | } |
| 206 | }) | 234 | }) |
| 235 | + | ||
| 207 | .catch(e => { | 236 | .catch(e => { |
| 208 | uni.$u.toast(e.data?.message); | 237 | uni.$u.toast(e.data?.message); |
| 209 | }); | 238 | }); |
| @@ -231,4 +260,4 @@ export default { | @@ -231,4 +260,4 @@ export default { | ||
| 231 | /deep/ button { | 260 | /deep/ button { |
| 232 | background: rgba(0, 0, 0, 0); | 261 | background: rgba(0, 0, 0, 0); |
| 233 | } | 262 | } |
| 234 | -</style> | 263 | +</style> |