罗广辉
2025-11-06 5cfd98e57bcd99c0c97888236e6f683efe4741cc
feat: 跳登录的时候关闭其他页面
4 files modified
26 ■■■■ changed files
src/components/WebViewPlus.vue 2 ●●● patch | view | raw | blame | history
src/pages/user/index.vue 2 ●●● patch | view | raw | blame | history
src/subPackages/userDetail/password/index.vue 20 ●●●● patch | view | raw | blame | history
src/utils/request/interceptors.js 2 ●●● patch | view | raw | blame | history
src/components/WebViewPlus.vue
@@ -22,7 +22,7 @@
function messageFun(e) {
  if (e.data.type === "WEB_INVOKE_APPSERVICE") {
    if (e.data.data.arg.type === "tokenExpired") {
      return uni.redirectTo({
      return uni.reLaunch({
        url: "/pages/login/index",
      });
    }
src/pages/user/index.vue
@@ -71,7 +71,7 @@
  function logOut() {
    userStore.setUserInfo(null)
    uni.redirectTo({
    uni.reLaunch({
      url: '/pages/login/index'
    })
  }
src/subPackages/userDetail/password/index.vue
@@ -13,7 +13,7 @@
                    <div class="rowTitle">新密码</div>
                    <u-input input-align="right" v-model="passwordForm.newPassword" placeholder="请输入"
                        class="input-item" />
                </div>
                <div class="orderRow">
                    <div class="rowTitle">确认密码</div>
@@ -53,7 +53,7 @@
    const validatePasswordNoChinese = (password) => {
      const chineseRegex = /[\u4e00-\u9fa5]/;
      if (chineseRegex.test(password)) {
        uni.showToast({
            title: '密码不能包含中文字符',
            icon: 'none',
@@ -66,7 +66,7 @@
    // 校验密码复杂度(长度≥6位,包含字母和数字)
    const validatePasswordStrength = (password) => {
      if (password.length < 6) {
        uni.showToast({
            title: '密码长度不能少于6位',
            icon: 'none',
@@ -95,7 +95,7 @@
    const submit = () => {
// 原始密码校验
    if (!passwordForm.value.oldPassword) {
      uni.showToast({
          title: '请输入原始密码',
          icon: 'none',
@@ -107,7 +107,7 @@
    if (!validatePasswordNoChinese(passwordForm.value.newPassword)) return;
    // 新密码校验
    if (!passwordForm.value.newPassword) {
      uni.showToast({
          title: '请输入新密码',
          icon: 'none',
@@ -125,7 +125,7 @@
      });
      return;
    }
    // 复杂度校验
    if (!validatePasswordStrength(passwordForm.value.newPassword)) return;
        updatePassword(md5(passwordForm.value.oldPassword),
@@ -139,7 +139,7 @@
                });
                clearForm();
                userStore.setUserInfo(null)
                uni.redirectTo({
                uni.reLaunch({
                    url: '/pages/login/index'
                })
@@ -186,7 +186,7 @@
        height: 96rpx;
        border-bottom: 2rpx solid #f5f5f5;
        color: #7b7b7b;
            .rowTitle {
                font-family: Source Han Sans CN, Source Han Sans CN;
@@ -219,9 +219,9 @@
    .u-button:first-child{
        margin-right: 30rpx;
    }
    .custom-style {
        width: 276rpx;
        height: 76rpx;
    }
</style>
</style>
src/utils/request/interceptors.js
@@ -82,7 +82,7 @@
    if (response.statusCode === 401) {
      const pages = getCurrentPages()
      const currentPage = pages[pages.length - 1]
      uni.redirectTo({
      uni.reLaunch({
        url: `/pages/login/index?redirect=/${currentPage.route}`
      })
    }