兰宝车间质量管理系统-前端
疯狂的狮子Li
2023-07-02 cc69786fd18c67f829acc75a2e5b58e3a9f02300
update 优化 !pr382 修复一些问题 完事流程逻辑
已修改5个文件
已重命名1个文件
34 ■■■■ 文件已修改
src/api/login.ts 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/layout/components/SocialCallback/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/permission.ts 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/router/index.ts 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/login.vue 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/user/profile/thirdParty.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/login.ts
@@ -2,7 +2,9 @@
import { AxiosPromise } from 'axios';
import { LoginData, LoginResult, VerifyCodeResult, TenantInfo } from './types';
import { UserInfo } from '@/api/system/user/types';
import { da } from 'element-plus/es/locale';
// pc端固定客户端授权id
const clientId = 'e5cd7e4891bf95d1d19206ce24a7b32e';
/**
 * @param data {LoginData}
@@ -11,7 +13,7 @@
export function login(data: LoginData): AxiosPromise<LoginResult> {
  const params = {
    ...data,
    clientId: data.clientId || 'e5cd7e4891bf95d1d19206ce24a7b32e',
    clientId: data.clientId || clientId,
    grantType: data.grantType || 'password'
  };
  return request({
@@ -59,14 +61,14 @@
    timeout: 20000
  });
}
/**
 * ç¬¬ä¸‰æ–¹ç™»å½•
 * @param source ç¬¬ä¸‰æ–¹ç™»å½•类型
 * */
 */
export function callback(data: LoginData): AxiosPromise<any> {
  const LoginData = {
    ...data,
    clientId: 'e5cd7e4891bf95d1d19206ce24a7b32e',
    clientId: clientId,
    grantType: 'social'
  };
  return request({
src/layout/components/SocialCallback/index.vue
ÎļþÃû´Ó src/layout/components/SocialLogin/index.vue ÐÞ¸Ä
@@ -1,5 +1,5 @@
<template>
  <div v-loading="loading" class="social-login"></div>
  <div v-loading="loading" class="social-callback"></div>
</template>
<script setup lang="ts">
src/permission.ts
@@ -10,7 +10,7 @@
import usePermissionStore from '@/store/modules/permission';
NProgress.configure({ showSpinner: false });
const whiteList = ['/login', '/register', '/social-login'];
const whiteList = ['/login', '/register', '/social-callback'];
router.beforeEach(async (to, from, next) => {
  NProgress.start();
src/router/index.ts
@@ -38,9 +38,9 @@
    ]
  },
  {
    path: '/social-login',
    path: '/social-callback',
    hidden: true,
    component: () => import('@/layout/components/SocialLogin/index.vue')
    component: () => import('@/layout/components/SocialCallback/index.vue')
  },
  {
    path: '/login',
src/views/login.vue
@@ -4,8 +4,7 @@
      <h3 class="title">RuoYi-Vue-Plus多租户管理系统</h3>
      <el-form-item prop="tenantId" v-if="tenantEnabled">
        <el-select v-model="loginForm.tenantId" filterable placeholder="请选择/输入公司名称" style="width: 100%">
          <el-option v-for="item in tenantList" :key="item.tenantId" :label="item.companyName"
            :value="item.tenantId"></el-option>
          <el-option v-for="item in tenantList" :key="item.tenantId" :label="item.companyName" :value="item.tenantId"></el-option>
          <template #prefix><svg-icon icon-class="company" class="el-input__icon input-icon" /></template>
        </el-select>
      </el-form-item>
@@ -15,14 +14,12 @@
        </el-input>
      </el-form-item>
      <el-form-item prop="password">
        <el-input v-model="loginForm.password" type="password" size="large" auto-complete="off" placeholder="密码"
          @keyup.enter="handleLogin">
        <el-input v-model="loginForm.password" type="password" size="large" auto-complete="off" placeholder="密码" @keyup.enter="handleLogin">
          <template #prefix><svg-icon icon-class="password" class="el-input__icon input-icon" /></template>
        </el-input>
      </el-form-item>
      <el-form-item prop="code" v-if="captchaEnabled">
        <el-input v-model="loginForm.code" size="large" auto-complete="off" placeholder="验证码" style="width: 63%"
          @keyup.enter="handleLogin">
        <el-input v-model="loginForm.code" size="large" auto-complete="off" placeholder="验证码" style="width: 63%" @keyup.enter="handleLogin">
          <template #prefix><svg-icon icon-class="validCode" class="el-input__icon input-icon" /></template>
        </el-input>
        <div class="login-code">
@@ -193,7 +190,8 @@
const doSocialLogin = (type: string) => {
  authBinding(type).then((res: any) => {
    if (res.code === 200) {
      window.location.href = res.msg;
      // èŽ·å–æŽˆæƒåœ°å€è·³è½¬
      window.location.href = res.data;
    } else {
      ElMessage.error(res.msg);
    }
src/views/system/user/profile/thirdParty.vue
@@ -80,7 +80,7 @@
const authUrl = (source: string) => {
  authBinding(source).then((res: any) => {
    if (res.code === 200) {
      window.location.href = res.msg;
      window.location.href = res.data;
    } else {
      ElMessage.error(res.msg);
    }