spring
2025-11-29 057c13502ecedf49d85d47ab23f3492859f16653
src/pages/login/index.vue
@@ -75,6 +75,11 @@
          <text class="text">和</text>
          <text class="link" @click="navigateToPrivacy">《隐私政策》</text>
        </view>
        <!-- 版本号 -->
        <view class="version">
          <text class="version-text">版本号:{{ versionName }}</text>
        </view>
      </view>
    </view>
@@ -87,18 +92,49 @@
import { type LoginFormData } from "@/api/auth";
import { useUserStore } from "@/store/modules/user";
import { useToast } from "wot-design-uni";
import { ref } from "vue";
import { ref, onMounted } from "vue";
const loginFormRef = ref();
const toast = useToast();
const loading = ref(false);
const userStore = useUserStore();
// 版本号
const versionName = ref("1.0.16");
// 获取版本号
onMounted(() => {
  // #ifdef MP-WEIXIN
  try {
    const accountInfo = uni.getAccountInfoSync();
    if (accountInfo?.miniProgram?.version) {
      versionName.value = accountInfo.miniProgram.version;
    }
  } catch (e) {
    // 获取失败时使用默认值
  }
  // #endif
  // #ifdef APP-PLUS
  try {
    // @ts-ignore
    if (plus?.runtime?.version) {
      // @ts-ignore
      versionName.value = plus.runtime.version;
    }
  } catch (e) {
    // 获取失败时使用默认值
  }
  // #endif
});
// 登录表单数据
const loginFormData = ref<LoginFormData>({
  // username: "31601016",
  username: "32308027",
  password: "cxjt1234",
  username: "",
  password: "",
  // username: "32408083",
  // username: "32308027",
  // password: "cxjt1234",
});
// 获取重定向参数
@@ -382,4 +418,16 @@
.agreement .link {
  color: #165dff;
}
.version {
  display: flex;
  justify-content: center;
  margin-top: 20rpx;
  margin-bottom: 20rpx;
}
.version-text {
  font-size: 22rpx;
  color: #9ca3af;
}
</style>