2025.02.15 工作代码提交 修复已经设置了二级密码没有先验证的bug

This commit is contained in:
sx 2025-02-15 21:58:36 +08:00
parent 069ec46cb9
commit 243e1b1d03
6 changed files with 36 additions and 28 deletions

View File

@ -6,8 +6,8 @@ const config = {
// host: 'h5api', // host: 'h5api',
// #endif // #endif
// #ifndef H5 // #ifndef H5
// host: 'http://91f.xyz:8080', host: 'http://91f.xyz:8080',
host: 'http://1a4b9ed1.r24.cpolar.top', // host: 'http://d5si5v.natappfree.cc',
// #endif // #endif
// 支付方式配置 // 支付方式配置
payType: { payType: {

View File

@ -41,7 +41,6 @@
*/ */
function init(productId) { function init(productId) {
if (productId) proId.value = productId if (productId) proId.value = productId
// //
open() open()
// //

View File

@ -134,11 +134,7 @@
}).then(rs => { }).then(rs => {
if (rs.code == 200) { if (rs.code == 200) {
if (list.pageNum == 1) list.data.length = [] if (list.pageNum == 1) list.data.length = []
list.data.push(...rs.rows.map(item => { list.data.push(...rs.rows)
item.format_videoUrl = util.format_url(item.videoUrl, 'video')
item.format_imageUrl = util.format_url(item.imageUrl, 'img')
return item
}))
list.total = rs.total list.total = rs.total
return return
} }
@ -285,7 +281,7 @@
<scroll-view scroll-x="true" class="scroll"> <scroll-view scroll-x="true" class="scroll">
<view class="list df"> <view class="list df">
<view class="item oh pr fs0 mr20 br20" v-for="(item,index) in myVideos" :key="index"> <view class="item oh pr fs0 mr20 br20" v-for="(item,index) in myVideos" :key="index">
<image class="poster br20" :src="item.format_imageUrl" mode="aspectFill" /> <image class="poster br20" :src="item.coverUrl" mode="aspectFill" />
<!-- <view class="window pfull"></view> --> <!-- <view class="window pfull"></view> -->
</view> </view>
</view> </view>

View File

@ -216,9 +216,9 @@
}, 50) }, 50)
// //
// proxy.$refs.productAltRef.init() // proxy.$refs.productAltRef.init()
handleProBuy({ // handleProBuy({
productId: 42, // productId: 42,
}) // })
}) })
onShow(() => { onShow(() => {
@ -686,6 +686,7 @@
* @param {Object} item 视频列表项 * @param {Object} item 视频列表项
*/ */
function handleShowProduct(item) { function handleShowProduct(item) {
console.log('video', item)
// 打开产品详情弹窗 // 打开产品详情弹窗
proxy.$refs.productAltRef.init(item.productId) proxy.$refs.productAltRef.init(item.productId)
} }
@ -856,7 +857,7 @@
<!-- 左侧菜单弹窗 --> <!-- 左侧菜单弹窗 -->
<leftMenuAlt ref="leftMenuRef" /> <leftMenuAlt ref="leftMenuRef" />
<!-- 产品详情弹窗 --> <!-- 产品详情弹窗 -->
<productAlt ref="productAltRef" @click="handleProductBuy" /> <productAlt ref="productAltRef" @buy="handleProductBuy" />
<!-- 产品立即下单弹窗 --> <!-- 产品立即下单弹窗 -->
<productSpecAlt ref="productSpecAltRef" :detail="productDetail" @confirm="handlePay" /> <productSpecAlt ref="productSpecAltRef" :detail="productDetail" @confirm="handlePay" />

View File

@ -28,19 +28,23 @@
} = getCurrentInstance() } = getCurrentInstance()
// //
const store = useStore() const store = useStore()
// set rePwd check // pwd rePwd check
const mode = ref('set') const mode = ref('pwd')
// //
const form = reactive({ const form = reactive({
pwd: '', pwd: '',
rePwd: '', rePwd: '',
check: '',
}) })
// //
const formKey = ref('pwd') const formKey = ref('pwd')
// //
const userinfo = computed(() => { const userinfo = computed(() => {
let result = store.state.userinfo let result = store.state.userinfo
if (result.hasSecondCipher) mode.value = 'check' if (result.hasSecondCipher) {
mode.value = 'check'
formKey.value = 'check'
}
return result return result
}) })
@ -79,7 +83,7 @@
// //
form.pwd = '' form.pwd = ''
form.rePwd = '' form.rePwd = ''
mode.value = 'set' mode.value = 'pwd'
return return
} }
// //
@ -112,22 +116,23 @@
} }
// //
if (!data.pwd) { if (!data.check) {
util.alert('二级密码不能为空') util.alert('二级密码不能为空')
return
} }
// //
data.pwd = CryptoJS.MD5(data.pwd).toString() data.check = CryptoJS.MD5(data.check).toString()
// //
api.mine.checkSecondLevelCipher({ api.mine.checkSecondLevelCipher({
data: { data: {
id: userinfo.value.id, id: userinfo.value.id,
secondLevelCipher: data.pwd, secondLevelCipher: data.check,
} }
}).then(rs => { }).then(rs => {
if (rs.code == 200) { if (rs.code == 200) {
form.pwd = '' form.check = ''
mode.value = 'set' mode.value = 'pwd'
return return
} }
util.alert({ util.alert({
@ -162,7 +167,7 @@
<template> <template>
<view class="appbw"> <view class="appbw">
<view class="container ver mt10p" v-if="mode === 'set'"> <view class="container ver mt10p" v-if="mode === 'pwd'">
<view class="title c333 f54">设置二级密码</view> <view class="title c333 f54">设置二级密码</view>
<view class="content mt50 c666 f32">请设置六位数字的二级密码</view> <view class="content mt50 c666 f32">请设置六位数字的二级密码</view>
@ -187,14 +192,22 @@
<view class="container ver mt10p" v-if="mode === 'check'"> <view class="container ver mt10p" v-if="mode === 'check'">
<view class="title c333 f54">验证二级密码</view> <view class="title c333 f54">验证二级密码</view>
<view class="content mt50 c666 f32">请输入二级密码用于验证</view> <view class="content mt50 c666 f32">请输入二级密码用于验证</view>
<view class="inputBox mt50 ptb10 plr30">
<input type="number" :maxlength="6" v-model="form.pwd" :focus="true" placeholder="六位数字密码" /> <view class="pwd">
<codeInput v-model:modelValue="form.check" />
</view> </view>
<!-- <view class="inputBox mt50 ptb10 plr30">
<input type="number" :maxlength="6" v-model="form.pwd" :focus="true" placeholder="六位数字密码" />
</view> -->
<view class="btn lg black mtb50 plr50" @click="handleCheck">验证</view> <view class="btn lg black mtb50 plr50" @click="handleCheck">验证</view>
</view> </view>
</view> </view>
<!-- -->
<view v-show="0">{{userinfo}}</view>
<!-- 安全键盘 --> <!-- 安全键盘 -->
<!-- <cc-defineKeyboard ref="CodeKeyboard" passwrdType="pay" @KeyInfo="KeyInfo" /> --> <!-- <cc-defineKeyboard ref="CodeKeyboard" passwrdType="pay" @KeyInfo="KeyInfo" /> -->
<view class="keyboard"> <view class="keyboard">

View File

@ -3,9 +3,8 @@ import {
} from 'vite'; } from 'vite';
import uni from '@dcloudio/vite-plugin-uni'; import uni from '@dcloudio/vite-plugin-uni';
// let target = 'http://91f.xyz:8080' let target = 'http://91f.xyz:8080'
let target = 'http://1a4b9ed1.r24.cpolar.top' // let target = 'http://d5si5v.natappfree.cc'
export default defineConfig({ export default defineConfig({
plugins: [uni()], plugins: [uni()],