index.vue 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <template>
  2. <view class="content">
  3. <image class="logo" src="/static/logo.png"></image>
  4. <view class="text-area">
  5. <text class="title">{{title}}6666</text>
  6. <input @click="denglu" placeholder="自动获得焦点" />
  7. </view>
  8. </view>
  9. </template>
  10. <script setup>
  11. import {
  12. getAppConfig,
  13. login,
  14. kaoshiList
  15. } from '@/api/login.js'
  16. import {
  17. ref
  18. } from 'vue';
  19. let title = ref('Hello')
  20. //console.log(this)
  21. // getAppConfig();
  22. const denglu = () => {
  23. let req = {
  24. password: 'sVXqow3/+jG5kIDVGqoezXoK/Pceal1cf/kiojvUdvSU0qTjm5ikUz9CHcsu05I9whRxeep/TDVAcNl2dEqAgSUr5Ufq1FDdHr5Pn/HA5LfoZV+n5j82RE93cwcrCJw6/MwW3ZWgISzvG5qN8t9IzkRX2qMB/7SJxnh3NzoaxX4=',
  25. userName: 'root'
  26. }
  27. login(req).then(res => {
  28. let obj = JSON.stringify(res.data)
  29. console.log(obj)
  30. uni.setStorage({
  31. key: 'Mta-Auth',
  32. data: obj // 假设 this.userInputValue 是用户输入的数据
  33. });
  34. setTimeout(() => {
  35. let req = {
  36. 'page': 1,
  37. 'size': 4,
  38. 'status': 1,
  39. }
  40. kaoshiList(req).then(res=>{
  41. console.log(res)
  42. })
  43. }, 5000)
  44. })
  45. }
  46. </script>
  47. <style>
  48. .content {
  49. display: flex;
  50. flex-direction: column;
  51. align-items: center;
  52. justify-content: center;
  53. }
  54. .logo {
  55. height: 200rpx;
  56. width: 200rpx;
  57. margin-top: 200rpx;
  58. margin-left: auto;
  59. margin-right: auto;
  60. margin-bottom: 50rpx;
  61. }
  62. .text-area {
  63. display: flex;
  64. justify-content: center;
  65. }
  66. .title {
  67. font-size: 36rpx;
  68. color: #8f8f94;
  69. }
  70. </style>