Skip to content

Commit

Permalink
feature(login): qq login
Browse files Browse the repository at this point in the history
  • Loading branch information
Hacker233 committed Sep 19, 2023
1 parent eb66cbb commit 78ba1f7
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 2 deletions.
Binary file added src/assets/images/qq.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 28 additions & 0 deletions src/components/LoginDialog/LoginDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,11 @@
@click="login(loginRuleFormRef)"
>登 录</el-button
>
<!-- 其它登录方式 -->
<!-- <div class="other-login-box">
<el-divider> 其它方式 </el-divider>
<img @click="toQQLogin" src="@/assets/images/qq.png" alt="QQ登录" title="QQ登录" />
</div> -->
</div>
<!-- 注册登录浮窗切换 -->
<div class="overlay-container">
Expand Down Expand Up @@ -323,6 +328,15 @@
const signIn = () => {
isSignUp.value = false;
};
// qq登录
// const toQQLogin = () => {
// window.open(
// 'oauth/index.php',
// 'TencentLogin',
// 'width=450,height=320,menubar=0,scrollbars=1,resizable=1,status=1,titlebar=0,toolbar=0,location=1'
// );
// };
</script>
<style lang="scss" scoped>
.login-dialog-form-box {
Expand Down Expand Up @@ -557,6 +571,20 @@
color: #ff4b2b;
}
}
.other-login-box {
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
img {
cursor: pointer;
transition: all 0.3s;
&:hover {
opacity: 0.8;
}
}
}
}
</style>
<style lang="scss">
Expand Down
9 changes: 9 additions & 0 deletions src/http/api/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,3 +123,12 @@ export const updatePersonInfoAsync: any = (data: any) => {
data: data
});
};

// QQ登录
export const qqLoginASync: any = (params: any) => {
return http.request({
url: 'https://graph.qq.com/oauth2.0/authorize',
method: 'get',
params: params
});
};
13 changes: 13 additions & 0 deletions src/router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ const SoftDetail = () => import('@/views/softDetail/index.vue');
// 网站分享
const WebsiteShare = () => import('@/views/websiteShare/index.vue');
const WebsiteDetail = () => import('@/views/websiteDetail/index.vue');
// QQ登录临时审核页面
const QQLogin = () => import('@/views/QQLoginTemp/qqLogin.vue');

// 图片压缩
const ImgCompress = () => import('@/views/imgCompress/index.vue');
Expand Down Expand Up @@ -276,6 +278,17 @@ const routes: Array<RouteRecordRaw> = [
},
component: WebsiteDetail
},
{
path: '/QQLogin',
name: 'QQLogin',
meta: {
title: '网站详情',
keepAlive: true,
isShowComNav: true,
requireLogin: false
},
component: QQLogin
},
{
path: '/imgCompress',
name: 'ImgCompress',
Expand Down
28 changes: 28 additions & 0 deletions src/views/QQLoginTemp/qqLogin.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<template>
<div class="qq-login-temp">
<span>qq登录</span>
<img src="@/assets/images/qq.png" alt="QQ登录" title="QQ登录" @click="qqLogin" />
</div>
</template>
<script lang="ts" setup>
import { qqLoginASync } from '@/http/api/user';
const qqLogin = async () => {
const params = {
response_type: 'code',
client_id: '102066932',
redirect_uri: encodeURI('https://91huajian.cn/person'),
state: 'hello'
};
const data = await qqLoginASync(params);
console.log(data);
};
</script>
<style lang="scss" scoped>
.qq-login-temp {
display: flex;
align-items: center;
justify-content: center;
height: 200px;
width: 100%;
}
</style>
2 changes: 0 additions & 2 deletions src/views/person/integralDetail/components/OrderList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
</el-table-column>
<el-table-column prop="totalAmount" label="订单金额" />
<el-table-column prop="buyerPayAmount" label="实付金额" />
<el-table-column prop="receiptAmount" label="实收金额" />

<el-table-column prop="createDate" label="创建日期" :width="180">
<template #default="scope">
<div>
Expand Down

1 comment on commit 78ba1f7

@vercel
Copy link

@vercel vercel bot commented on 78ba1f7 Sep 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

resume-design – ./

resume-design-kappa.vercel.app

Please sign in to comment.