1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>修改登录密码-创业帮</title>
- <meta name="keywords" content="修改登录密码-创业帮">
- <meta name="description" content="修改登录密码-创业帮">
- <meta content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,shrink-to-fit=no,user-scalable=no" name="viewport" viewport="cover">
- <meta name="apple-mobile-web-app-capable" content="yes">
- <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
- <meta content="telephone=no" name="format-detection">
- <meta content="email=no" name="format-detection">
- <meta name="apple-mobile-web-app-title" content="修改登录密码-创业帮">
- <meta http-equiv="Cache-Control" content="no-siteapp">
- <link rel="stylesheet" href="./static/css/main.css">
- </head>
- <body class="bgcf7f7f7 pt0" style="padding-top:0;">
- <div id="app" v-cloak>
- <van-nav-bar class="bgcf7f7f7 user_rank_explan_title user_title_normal" left-arrow @click-left="goback" v-if="toptitleisshow">
- <template #left> <img src="./static/images/left.png" alt=""></template>
- </van-nav-bar>
- <div class="regist-box-input pt8 pb32 pl32 pr32">
- <div class="f24 c333 b pb32">修改登录密码</div>
- <div class="f12 c666 mb6">原密码</div>
- <van-field class="mb12" v-model="changepwd.LoginPwd" @input="checkValue" type="password" placeholder="请输入原密码" maxlength="16"></van-field>
- <div class="f12 c666 mb6">新密码</div>
- <van-field class="mb12" v-model="changepwd.NewLoginPwd" @input="checkValue" :type="isShowPwd ? 'text' : 'password'" placeholder="请输入新密码" maxlength="16">
- <template #button>
- <van-button class="fr" @click="showPwd()"><img class="fr" :src="isShowPwd ? './static/images/show-icon@3x.png' : './static/images/noshow-icon@3x.png'" alt=""></van-button>
- </template>
- </van-field>
- <div class="f12 c666 mb6">确认密码</div>
- <van-field class="mb12" v-model="newpwd2" @input="checkValue" type="password" placeholder="请再次输入以确认" maxlength="16"></van-field>
- <div class="pt16 bc333" v-cloak>
- <van-button type="primary" block color="#FFD500" :disabled="canSubmit ? false : true" @click="changepwdfn">完成</van-button>
- </div>
- </div>
- </div>
- <script src="./static/js/klm-vv.min.js"></script>
- <script src="./static/js/appfunc.min.js"></script>
- <script src="./static/js/klm-axios-config.js"></script>
- <script src="./static/js/publicfn.js"></script>
- <script>
- // 通过 CDN 引入时不会自动注册 Lazyload 组件
- // 可以通过下面的方式手动注册
- Vue.use(vant.Lazyload);
-
- // 在 #app 标签下渲染一个按钮组件
- let app = new Vue({
- el: '#app',
- data() {
- return {
- toptitleisshow:false,
- newpwd2: '',
- canSubmit: false,
- isShowPwd: false,
- changepwd:{
- Id:'',
- LoginPwd:'',
- NewLoginPwd:''
- }
- };
- },
- created() {
- this.toptitleisshow = toptitleisshow;
- this.changepwd.Id = PublicLib.getCookieInfo('userId');
- },
- methods: {
- //- 确定按钮是否可用
- checkValue(){
- this.canSubmit = (this.changepwd.LoginPwd !== '' && this.changepwd.NewLoginPwd !== '' && this.newpwd2 !== '') ? true : false;
- },
- //- 是否显示密码
- showPwd(){
- this.isShowPwd = !this.isShowPwd;
- },
- //- 修改密码
- async changepwdfn(){
- if(this.changepwd.NewLoginPwd.length < 6 || this.changepwd.NewLoginPwd.length > 16) return tips('密码长度应为6~16位');
- if(this.newpwd2 !== this.changepwd.NewLoginPwd) return tips('两次密码不一致,请重新输入!');
- const res = await postRequest('api/v1/users/modifyloginpwd?t='+Math.random(6),JSON.stringify(this.changepwd));
- if(res.status !== '1') return tips(res.info);
- tips('修改登录密码成功!');
- setTimeout(()=>{
- PublicLib.GoBack({Level:-1});
- },2000);
- },
- goback(){
- PublicLib.GoBack({Level:1});
- }
- }
- });
- </script>
- </body>
- </html>
|