Crunchy
2025-03-17 620c480b827bed90eb16a690f1f90421bf260cf0
浪潮单点登录修复
已修改4个文件
已添加1个文件
40 ■■■■ 文件已修改
package.json 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/permission.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/router/index.js 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/auth.js 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tideLogin.vue 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
package.json
@@ -1,7 +1,7 @@
{
  "name": "ruoyi",
  "version": "3.8.9",
  "description": "LIMS实验室管理系统",
  "description": "EAM资产管理系统",
  "author": "若依",
  "license": "MIT",
  "scripts": {
src/permission.js
@@ -9,7 +9,7 @@
NProgress.configure({ showSpinner: false })
const whiteList = ['/login', '/register']
const whiteList = ['/login', '/register', '/callbacklccpn']
const isWhiteList = (path) => {
  return whiteList.some(pattern => isPathMatch(pattern, path))
src/router/index.js
@@ -47,6 +47,11 @@
    hidden: true,
  },
  {
    path: "/callbacklccpn",
    component: () => import("@/views/tideLogin.vue"),
    hidden: true,
  },
  {
    path: "/register",
    component: () => import("@/views/register"),
    hidden: true,
src/utils/auth.js
@@ -1,15 +1,13 @@
import Cookies from 'js-cookie'
const TokenKey = 'Admin-Token'
export function getToken() {
  return Cookies.get(TokenKey)
  return localStorage.getItem(TokenKey)
}
export function setToken(token) {
  return Cookies.set(TokenKey, token)
  localStorage.setItem(TokenKey, token)
}
export function removeToken() {
  return Cookies.remove(TokenKey)
  localStorage.removeItem(TokenKey)
}
src/views/tideLogin.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,23 @@
<template>
  <div></div>
</template>
<script>
import store from "@/store";
export default {
  data() {
    return {}
  },
  created() {
    this.goLogin()
  },
  computed: {},
  methods: {
    async goLogin() {
      store.dispatch('TideLogin', this.$route.query.code).then(() => {
        this.$router.push({ path: this.redirect || "/" }).catch(() => { });
      })
    }
  }
}
</script>
<style scoped></style>