# 2022Competition-fe **Repository Path**: Sohu1024Tank/2022Competition-fe ## Basic Information - **Project Name**: 2022Competition-fe - **Description**: 1024AI坦克大赛 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-07-31 - **Last Updated**: 2023-08-09 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # competition-fe ## Project setup ``` npm install ``` ### Compiles and hot-reloads for development ``` npm run serve ``` ### Compiles and minifies for production ``` npm run build ``` ### Lints and fixes files ``` npm run lint ``` ### Customize configuration See [Configuration Reference](https://cli.vuejs.org/config/). ## 接口 mock 地址 见 `vue.config.js` 中的 `devServer.proxy` ## SSO 权限管理 ### 如何控制路由的 SSO 权限 找到文件 `src/main.js` 中的 `const pathForSSO` 变量。这个变量是个数组,在数组中填写需要登录 SSO 才能访问的路由 path. 例如:`const pathForSSO = ["/tank"]` ### 如何获取 SSO 的用户信息 在需要 SSO 用户信息的组件中引入: `import { getSSOTokenInfo } from "@/views/Tank/utils/index.js";` 然后调用该方法即可: `const userInfo = getSSOTokenInfo();` 用户信息格式如下: ``` { email: "xxxx@sohu-inc.com", uid: "233333", iat: 123456789 } ```