小小儁爺
2024-05-28 11ac3666423de5c03da72c388e38d869f04d9af7
1.APP重置密码100%
已添加1个文件
已修改5个文件
204 ■■■■■ 文件已修改
config/api.js 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages.json 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/grzx/gzcl.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/grzx/mmsz.vue 178 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/xtsy/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
style/global.css 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
config/api.js
@@ -317,4 +317,12 @@
// è®¾å¤‡ç»´ä¿®éªŒè¯æäº¤
export const RepairVerificationScanDeviceSave = (data) => http.post('/DeviceManager/RepairVerificationScanDeviceSave',
    data)
// ä¿®æ”¹å¯†ç 
export const UpdateUserPassword = (data) => http.post('/Login/UpdateUserPassword' +
    data)
// å¯†ç é‡ç½®
export const ResettUserPassword = (data) => http.post('/Login/ResettUserPassword' +
    data)
pages.json
@@ -231,6 +231,14 @@
                "enablePullDownRefresh": false
            }
        },
        {
            "path": "pages/grzx/mmsz",
            "style": {
                "navigationBarTitleText": "密码设置",
                "navigationStyle": "custom",
                "enablePullDownRefresh": false
            }
        },
        {
pages/grzx/gzcl.vue
@@ -63,7 +63,7 @@
                            <!--     <view class='inputClass' style="margin:10rpx auto 0;">
                                    <u--input placeholder="请选择" border="surround" v-model="startDate"></u--input>
                                </view> -->
                                 <!-- icon='calendar' -->
                            <!-- icon='calendar' -->
                            <u-button type="info" iconColor="#0659FF" size="" @click="calendarClick"
                                :text="calendarRange">
                            </u-button>
@@ -75,8 +75,8 @@
                                <view class="number">{{ parseFloat(form.report_qty)}}</view>
                            </view>
                            <view class="head_block_item flex_column">
                                <view class="titleFont">良废扣除</view>
                                <view class="number">{{ parseFloat(form.userngbadmoney)}}</view>
                                <view class="titleFont">不良数量</view>
                                <view class="number">{{ parseFloat(form.userngbadqty)}}</view>
                            </view>
                            <view class="head_block_item flex_column">
                                <view class="titleFont">工资收入(元)</view>
pages/grzx/mmsz.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,178 @@
<template>
    <view class="">
        <page-nav title="密码设置"></page-nav>
        <view class="flex_column head titleFont" style="min-height: 1400rpx;">
            <view class="flex_center marginTop20 marginLeft20">
                <view style="margin-left: 36rpx;">原密码:</view>
                <view class='inputClass'>
                    <u--input placeholder="请输入" border="surround" v-model="oldPassword"></u--input>
                </view>
            </view>
            <view class="flex_center marginTop20 marginLeft20">
                <view style="margin-left: 36rpx;">新密码:</view>
                <view class='inputClass'>
                    <u--input placeholder="请输入" border="surround" v-model="newPassword"></u--input>
                </view>
            </view>
            <view class="flex_center marginTop20 marginLeft20">
                <view>确认密码:</view>
                <view class='inputClass'>
                    <u--input placeholder="请输入" border="surround" v-model="newPasswordConfirm"></u--input>
                </view>
            </view>
        </view>
        <view class="footer">
            <u-button :loading="isDisabledSubmitButtonReset" loadingText="重置中..."
                style='width: 50%;border-radius: 10rpx 0 0 10rpx;' type="success" @click="resetPassword" text="重置密码"
                size="large">
            </u-button>
            <u-button :loading="isDisabledSubmitButtonEdit" loadingText="修改中..."
                style='width: 50%;border-radius:0 10rpx 10rpx 0' @click="editPassword" type="primary" text="修改密码"
                size="large"></u-button>
        </view>
    </view>
</template>
<script>
    import {
        UpdateUserPassword,
        ResettUserPassword
    } from '../../config/api.js';
    export default {
        onLoad(option) {
        },
        onPullDownRefresh() {
            setTimeout(() => {
                this.init(() => {
                    uni.stopPullDownRefresh();
                })
            }, 1000);
        },
        data() {
            return {
                topRightMessageCount: '',
                isDisabledSubmitButtonReset: false,
                isDisabledSubmitButtonEdit: false,
                oldPassword: '', //原密码
                newPassword: '', //新密码
                newPasswordConfirm: '', //确认密码
            }
        },
        created() {
        },
        mounted() {
            this.init()
        },
        methods: {
            init() {
                uni.stopPullDownRefresh();
            },
            // é‡ç½®å¯†ç 
            async resetPassword() {
                const data = {
                    usercode: uni.getStorageSync("usercode"),
                    username: uni.getStorageSync("username"),
                    usertype: 'APP'
                }
                this.isDisabledSubmitButtonReset = true
                const res = await ResettUserPassword(this.global.formatData(data))
                if (res.code === '200') {
                    this.isDisabledSubmitButtonReset = false
                    this.$u.toast('密码重置成功!')
                    uni.setStorageSync("Token", '')
                    uni.setStorageSync("usercode", '')
                    uni.setStorageSync("username", '')
                    uni.setStorageSync("storg_code", '')
                    uni.setStorageSync("storg_name", '')
                    setTimeout(() => {
                        uni.redirectTo({
                            url: '../login/index'
                        });
                    }, 2000)
                } else {
                    this.isDisabledSubmitButtonReset = false
                    this.$u.toast('密码重置失败!')
                }
            },
            // ä¿®æ”¹å¯†ç 
            async editPassword() {
                if (!this.oldPassword) {
                    return this.$u.toast('请输入原密码!')
                }
                if (!this.newPassword) {
                    return this.$u.toast('请输入新密码!')
                }
                if (!this.newPasswordConfirm) {
                    return this.$u.toast('请输入确认密码!')
                }
                if (this.newPassword.trim() !== this.newPasswordConfirm.trim()) {
                    return this.$u.toast('新密码与确认密码不一致!')
                }
                const data = {
                    // usercode: uni.getStorageSync("usercode"),
                    // username: uni.getStorageSync("username"),
                    password: this.oldPassword.trim(),
                    newpassword: this.newPassword.trim()
                }
                this.isDisabledSubmitButtonEdit = true
                const res = await UpdateUserPassword(this.global.formatData(data))
                if (res.code === '200') {
                    this.isDisabledSubmitButtonEdit = false
                    this.$u.toast('密码修改成功!')
                    uni.setStorageSync("Token", '')
                    uni.setStorageSync("usercode", '')
                    uni.setStorageSync("username", '')
                    uni.setStorageSync("storg_code", '')
                    uni.setStorageSync("storg_name", '')
                    setTimeout(() => {
                        uni.redirectTo({
                            url: '../login/index'
                        });
                    }, 2000)
                } else {
                    this.isDisabledSubmitButtonEdit = false
                    this.$u.toast('密码修改失败!')
                }
            }
        }
    }
</script>
<style lang="scss" scoped>
    @import url('@/style/global.css');
    ::v-deep .uicon-arrow-left>span {
        display: block;
    }
</style>
pages/xtsy/index.vue
@@ -167,7 +167,7 @@
                    case '2100':
                        url = 'grzx/gzcl' //工资产量
                        break;
                    case '2014':
                    case '2101':
                        url = 'grzx/mmsz' //密码设置
                        break;
                    case '2015':
style/global.css
@@ -158,7 +158,7 @@
    /* padding-top: 20rpx; */
    /* padding-bottom: 20rpx; */
    display: flex;
    flex-direction: column;
    /* flex-direction: column; */
    width: 100%;
}