Selaa lähdekoodia

admin中后台新增登录按钮,直接免登录跳转company服务

luolinsong 2 kuukautta sitten
vanhempi
commit
2ebb5ec63c
1 muutettua tiedostoa jossa 27 lisäystä ja 0 poistoa
  1. 27 0
      src/views/his/company/index.vue

+ 27 - 0
src/views/his/company/index.vue

@@ -194,6 +194,14 @@
             @click="handleRevenue(scope.row)"
             v-hasPermi="['company:company:revenue']"
           >分账配置</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-login"
+            @click="handleLoginByUser(scope.row)"
+            v-hasPermi="['his:company:remove']"
+          >登录
+          </el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -902,6 +910,25 @@ export default {
       }
       this.revenue.open = true
     },
+    // A系统中的调用方法
+    handleLoginByUser(row) {
+      const bSystemUrl = "http://localhost:81/loginByUserName"
+
+      const params = new URLSearchParams({
+        username: row.userName,
+        t: Date.now()
+      })
+
+      // 修正:移除 /username
+      const editUrl = `${bSystemUrl}?${params}`
+      console.log('访问URL路劲:', editUrl);
+      // 直接在右侧打开
+      const left = (window.screenLeft ?? window.screen.left) + (window.outerWidth ?? 800) + 10
+      const top = window.screenTop ?? window.screen.top
+
+      window.open(editUrl, '_blank',
+         `width=1400,height=800,left=${left},top=${top},resizable=yes`)
+    },
     handleRecharge(row) {
       const companyId = row.companyId
       this.rechargeForm.companyId = row.companyId