强制更改密码

master
liangliang.Li 3 years ago
parent 7ec55ce771
commit c936338e25
  1. 51
      src/components/page/Index.vue
  2. 4
      src/components/page/RegisterForm.vue
  3. 10
      src/components/page/ShowExperiment.vue
  4. 1
      src/router/index.js
  5. 2
      src/utils/api.js

@ -10,8 +10,20 @@
<div>此处期货交易虚拟实验为2020新版本</div>
<div>2019旧版本入口为<a href="http://www.jgsyzx.uestc.cn/">http://www.jgsyzx.uestc.cn/</a></div>
</div>
</div>
<el-dialog :visible.sync="changeVisible" width="30%" :modal-append-to-body="false" :close-on-click-modal="false" :show-close="false" center title="更改密码">
<el-form label-width="80px" :model="regForm" :rules="regRules">
<el-form-item prop="password" label="新密码">
<el-input type="password" v-model="regForm.password" placeholder="请输入密码"></el-input>
</el-form-item>
<el-form-item prop="rePassword" label="确认密码">
<el-input type="password" v-model="regForm.rePassword" placeholder="请再次输入密码"></el-input>
</el-form-item>
</el-form>
<span slot="footer" center class="dialog-footer">
<el-button type="primary" @click="setPassword"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
@ -19,13 +31,46 @@ export default {
name: 'project',
data() {
return {
changeVisible:false,
regForm:{
password:'',
rePassword:''
},
regRules: {
password: [
{ required: true, message: '请输入密码', trigger: 'blur' },
{ pattern: /^.{8,}$/, message: '请输入8位数以上的密码', trigger: 'blur' }
],
rePassword: [
{ required: true, message: '请再次输入密码', trigger: 'blur' },
{ pattern: /^.{8,}$/, message: '请输入6位数以上的密码', trigger: 'blur' }
]
},
};
},
mounted() {
// this.showChangePass()
},
methods: {
setPassword(){
if(this.regForm.password !== this.regForm.rePassword){
return this.$message.warning('两次输入的密码不一致,请重新输入')
}else{
this.$post(this.api.resetUserPwd,{password:this.regForm.password}).then(res =>{
this.changeVisible = false
return this.$message.success('更改成功')
}).catch(err=>{
return this.$message.error(err.errmessage)
})
}
},
showChangePass(){
this.$get(this.api.isRequiredReset).then(res =>{
if(res.message) this.changeVisible = true
}).catch(err=>{})
},
toFuture(){
sessionStorage.setItem("model",0);//
this.core.toSubSystem('','','',0)

@ -116,11 +116,11 @@ export default {
],
password: [
{ required: true, message: '请输入密码', trigger: 'blur' },
{ pattern: /^.{6,}$/, message: '请输入6位数以上的密码', trigger: 'blur' }
{ pattern: /^.{8,}$/, message: '请输入8位数以上的密码', trigger: 'blur' }
],
rePassword: [
{ required: true, message: '请再次输入密码', trigger: 'blur' },
{ pattern: /^.{6,}$/, message: '请输入6位数以上的密码', trigger: 'blur' }
{ pattern: /^.{8,}$/, message: '请输入6位数以上的密码', trigger: 'blur' }
]
},
provinceList: this.$store.state.provinceList, //

@ -116,6 +116,7 @@
<div class="meta-title-wrap">
<p class="meta-title"><i class="el-icon-discount"></i> 实验数据及结果分析</p>
</div>
<div >
<div class="data-wrap">
<el-table :data="goodsData" :span-method="objectSpanMethod" stripe header-align="center" style="flex: 1;margin-right: 10px">
<el-table-column prop="name" label="现货" align="center"></el-table-column>
@ -134,10 +135,15 @@
<el-table-column prop="marketValue" label="期权市值" align="center"></el-table-column>
<el-table-column prop="proftAndLoss" label="累计盈亏" align="center"></el-table-column>
</el-table>
<div style="width: 150px;">
</div>
<div class="data-wrap">
<el-table :data="futuresLoss" stripe header-align="center">
<el-table-column prop="futuresLoss" label="策略总盈亏" align="center"></el-table-column>
</el-table>
<el-table :data="hisPositionData1" stripe header-align="center" class="mat20">
<el-table-column prop="percent" label="套期保值率" align="center"></el-table-column>
</el-table>
</div>
</div>
<el-input style="margin-top: 20px" v-model="form.analysis" type="textarea" :disabled="true" rows="5"></el-input>
@ -226,6 +232,7 @@
goodsData: [],
futuresData: [],
futuresLoss: [],
hisPositionData1:[]
}
},
mounted(){
@ -250,6 +257,7 @@
this.goodsData = steps9.goodsData ? steps9.goodsData: []
this.futuresData = steps9.futuresData ? steps9.futuresData: []
this.futuresLoss = steps9.futuresLoss ? steps9.futuresLoss: []
this.hisPositionData1 = steps9.hisPositionData1 ? steps9.hisPositionData1: []
}
let score = res.data.score

@ -10,6 +10,7 @@ export default new Router({
{
path: '/',
redirect: '/login'
// redirect: '/index'
},
{
path: '/teachingVideo',

@ -12,6 +12,8 @@ if(process.env.NODE_ENV === 'development'){
export default {
logins: `${host}/liuwanr/userInfo/logins`, //登录 
resetUserPwd: `${host}/liuwanr/userInfo/resetUserPwd`, //更改密码
isRequiredReset: `${host}/liuwanr/userInfo/isRequiredReset`, //密码是否为默认密码
getAccountPassword: `${host}/evaluation/tms/userInfo/getAccountPassword`, //获取账号密码
queryToken: `${host}/liuwanr/userInfo/queryToken`,
save: `${host}/evaluation/tms/userInfo/add`, //注册

Loading…
Cancel
Save