| | |
| | | <view class="LoginBg"></view> |
| | | <view class=""> </view> |
| | | </view> |
| | | |
| | | <el-form :hide-required-asterisk="true" ref="formLogin1" label-position="top" :rules="rules1" |
| | | :model="loginData"> |
| | | <el-form-item label="登录账号" prop="loginID"> |
| | |
| | | |
| | | <script> |
| | | import { |
| | | encryptAES,decryptAES |
| | | } from '@/utils/Crypto.js' |
| | | import { |
| | | nextTick |
| | | } from "vue"; |
| | | import { |
| | | getLogin,getUserInfo |
| | | getLogin, |
| | | getUserInfo |
| | | } from '@/api/index.js' |
| | | import Footer1 from '@/components/footer/footer.vue' |
| | | export default { |
| | |
| | | required: true, |
| | | message: '请输入登录账号', |
| | | trigger: 'blur' |
| | | }], |
| | | }, |
| | | |
| | | ], |
| | | pass: [{ |
| | | required: true, |
| | | message: '请输入密码', |
| | |
| | | // 登录用户账号 |
| | | loginData: { |
| | | // 账号 |
| | | loginID: 'bbb', |
| | | pass: 'acy2jnwt/loR44ytIPPZBg==' |
| | | loginID: '', |
| | | pass: '' |
| | | }, |
| | | // 书籍数据 |
| | | listData: [{ |
| | | name: '历代医家传记库', |
| | | name: '中医人物数据库', |
| | | id: 1, |
| | | }, { |
| | | name: '世医医家库', |
| | | name: '世医医家数据库', |
| | | id: 2, |
| | | }, { |
| | | name: '医学学术流派', |
| | | name: '中医学术流派', |
| | | id: 3, |
| | | }, { |
| | | name: '中国地域医谱', |
| | | name: '中医地域医谱', |
| | | id: 4, |
| | | }, { |
| | | name: '中国医事制度', |
| | | name: '中医医事制度', |
| | | id: 5, |
| | | }, |
| | | |
| | |
| | | // uni.setStorageSync('globalData', { id: 123, name: 'example' }); |
| | | if (item.id == 1) { |
| | | uni.navigateTo({ |
| | | url: '/pages/repository/repository?id=' + item.id |
| | | url: '/pages/character/detail?id=' + item.id |
| | | }) |
| | | } else if (item.id == 2) { |
| | | console.log(item.name); |
| | | // uni.navigateTo({ |
| | | // url:'/pages/repository/repository?id='+item.id |
| | | // url:'/pages/character/detail?id='+item.id |
| | | // }) |
| | | } else if (item.id == 3) { |
| | | uni.navigateTo({ |
| | | url: '/pages/dataDisplay/dataDisplay?id=' + item.id |
| | | url: '/pages/academicGenres/index?id=' + item.id |
| | | }) |
| | | } else if (item.id == 4) { |
| | | uni.navigateTo({ |
| | |
| | | }, |
| | | // 用户登录 |
| | | async Login(formName) { |
| | | console.log(decryptAES(this.loginData.pass),'this.loginData.pass'); |
| | | let Obj = { |
| | | username: this.loginData.loginID, |
| | | password: this.loginData.pass, |
| | | // encryptAES(this.loginData.pass) | this.loginData.pass |
| | | password: encryptAES(this.loginData.pass), |
| | | } |
| | | console.log(Obj, 'Obj'); |
| | | |
| | | let res = await getLogin(Obj) |
| | | console.log(res, 'sfdsf'); |
| | | if (res.success) { |
| | |
| | | }) |
| | | // 将token存储再本地中 |
| | | window.localStorage.setItem("access_token", res.results.token) |
| | | await getUserInfo().then(res=>{ |
| | | console.log(res,'rrrrrrrrrrsd'); |
| | | await getUserInfo().then(res => { |
| | | console.log(res, 'rrrrrrrrrrsd'); |
| | | }) |
| | | // 将账号存入到vuex中 |
| | | this.$store.dispatch('setUserName',res.object.username) |
| | | |
| | | uni.redirectTo({ |
| | | url: '/pages/index/index' |
| | | }) |
| | |
| | | icon: 'error' |
| | | }) |
| | | // alert("sdfdsf") |
| | | this.loginData.pass= '' |
| | | this.loginData.pass = '' |
| | | } |
| | | this.$refs[formName].validate(async (valid) => { |
| | | if (valid) { |
| | |
| | | width: 1.2rem; |
| | | height: .37rem; |
| | | background: url(@/static/image/用户登录.png) no-repeat 0 0; |
| | | background-size: 100% 100%; |
| | | background-size: 100%; |
| | | margin-bottom: .47rem; |
| | | } |
| | | |