兰宝车间质量管理系统-前端
疯狂的狮子Li
2023-06-20 7340997cf50882ff9d576eeca4e175d15aa17957
update 优化 !pr370 完成三方登录授权功能
已修改5个文件
已重命名1个文件
32 ■■■■■ 文件已修改
src/api/login.ts 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/system/social/auth.ts 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/layout/components/SocialLogin/index.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/router/index.ts 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/login.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/user/profile/thirdParty.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/login.ts
@@ -74,9 +74,6 @@
  return request({
    url: '/auth/social-login/' + source,
    method: 'get',
    headers: {
      isToken: true
    },
    params: data
  });
}
src/api/system/social/auth.ts
@@ -4,10 +4,7 @@
export function authBinding(source: string) {
  return request({
    url: '/auth/binding/' + source,
    method: 'get',
    headers: {
      isToken: true
    }
    method: 'get'
  });
}
@@ -15,19 +12,13 @@
export function authUnlock(authId: string) {
  return request({
    url: '/auth/unlock/' + authId,
    method: 'delete',
    headers: {
      isToken: true
    }
    method: 'delete'
  });
}
//获取授权列表
export function getAuthList() {
  return request({
    url: '/system/social/list',
    method: 'get',
    headers: {
      isToken: true
    }
    method: 'get'
  });
}
src/layout/components/SocialLogin/index.vue
ÎļþÃû´Ó src/layout/components/socialLogin/index.vue ÐÞ¸Ä
@@ -3,8 +3,8 @@
</template>
<script setup lang="ts">
import { socialLogin } from '@/api/login';
import { setToken } from '@/utils/auth';
import {socialLogin} from '@/api/login';
import {setToken} from '@/utils/auth';
const route = useRoute();
const router = useRouter();
src/router/index.ts
@@ -40,7 +40,7 @@
  {
    path: '/social-login',
    hidden: true,
    component: () => import('@/layout/components/socialLogin/index.vue')
    component: () => import('@/layout/components/SocialLogin/index.vue')
  },
  {
    path: '/login',
src/views/login.vue
@@ -38,10 +38,10 @@
      </el-form-item>
      <div style="display: flex;justify-content: flex-end;flex-direction: row;">
        <el-button circle>
          <svg-icon icon-class="qq" @click="doSocialLogin('QQ')" />
          <svg-icon icon-class="qq" @click="doSocialLogin('qq')" />
        </el-button>
        <el-button circle>
          <svg-icon icon-class="wechat" @click="doSocialLogin('Wechat')" />
          <svg-icon icon-class="wechat" @click="doSocialLogin('wechat')" />
        </el-button>
        <el-button circle>
          <svg-icon icon-class="gitee" @click="doSocialLogin('gitee')" />
src/views/system/user/profile/thirdParty.vue
@@ -34,14 +34,14 @@
          <span class="app-name">Github</span>
        </a>
        <a class="third-app" href="#" title="功能开发中...">
        <a class="third-app" href="#" @click="authUrl('wechar');" title="使用 å¾®ä¿¡ è´¦å·æŽˆæƒç™»å½•">
          <div class="git-other-login-icon">
            <svg-icon icon-class="wechat" />
          </div>
          <span class="app-name">WeiXin</span>
        </a>
        <a class="third-app" href="#" title="功能开发中...">
        <a class="third-app" href="#" @click="authUrl('qq');" title="使用 QQ è´¦å·æŽˆæƒç™»å½•">
          <div class="git-other-login-icon">
            <svg-icon icon-class="qq" />
          </div>