You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.vue.bak 2.9 kB

2 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. /**
  2. * @Author moxianchengbao
  3. */
  4. <template>
  5. <div id="login-main">
  6. <el-card class="box-card">
  7. <template #header>
  8. <div class="card-header">
  9. <span style="font-weight: bolder;color: #2155c2">登录系统</span>
  10. </div>
  11. </template>
  12. <el-form :model="resetForm" status-icon :rules="resetFormRules" ref="resetForm" label-width="100px" style="width: 300px" hide-required-asterisk="false">
  13. <el-form-item label="用户名" prop="username">
  14. <el-input type="text" v-model="resetForm.username" auto-complete="off" placeholder="请输入用户名"></el-input>
  15. </el-form-item>
  16. <el-form-item label="密码" prop="password">
  17. <el-input type="password" show-password v-model="resetForm.password" auto-complete="off" placeholder="请输入密码"></el-input>
  18. </el-form-item>
  19. </el-form>
  20. <div class="subm">
  21. <el-button type="primary" round @click="subup('resetForm')"> 登录</el-button>
  22. </div>
  23. </el-card>
  24. </div>
  25. </template>
  26. <script>
  27. import {ElMessage} from "element-plus";
  28. export default {
  29. name: "index",
  30. data(){
  31. var validatePass = (rule, value, callback) => {
  32. if (value === '') {
  33. callback(new Error('请输入密码!'));
  34. } else {
  35. callback();
  36. }
  37. };
  38. var validateid = (rule, value, callback) => {
  39. if (!value) {
  40. callback(new Error('请输入用户名!'));
  41. } else {
  42. callback();
  43. }
  44. };
  45. return{
  46. //重置密码
  47. resetForm: {},
  48. resetFormRules: {
  49. password: [
  50. { required: true, validator: validatePass,trigger: 'blur' }
  51. ],
  52. username: [
  53. { required: true, validator: validateid, trigger: 'blur' }
  54. ]
  55. },
  56. }
  57. },
  58. methods:{
  59. subup(resetForm){
  60. this.$refs[resetForm].validate((valid)=>{
  61. if(valid){
  62. this.$http.post("/user/login",this.resetForm).then(res=>{
  63. if(res.statusCode == '200'){
  64. localStorage.setItem("token",res.data.userToken)
  65. ElMessage({
  66. message: '登录成功!',
  67. type: 'success',
  68. })
  69. this.$router.push("/")
  70. }else {
  71. ElMessage.error('登录失败!')
  72. }
  73. }).catch(()=>{
  74. ElMessage.error('登录失败!')
  75. })
  76. }else{
  77. ElMessage.error('请填写!')
  78. return false;
  79. }
  80. })
  81. }
  82. },
  83. created() {
  84. localStorage.removeItem("token")
  85. }
  86. }
  87. </script>
  88. <style scoped>
  89. #login-main{
  90. margin-left: 15px;
  91. }
  92. .card-header {
  93. display: flex;
  94. justify-content: space-between;
  95. align-items: center;
  96. }
  97. .box-card {
  98. width: 480px;
  99. margin-left: 30%;
  100. margin-top: 10%;
  101. }
  102. .subm{
  103. margin-left: 35%;
  104. margin-top: 7%;
  105. }
  106. .footerbtn{
  107. margin-left: 580px;
  108. margin-top: 150px;
  109. }
  110. </style>

基于MindSpore的多模态股票价格预测系统研究 Informer,LSTM,RNN