This commit is contained in:
Ling53666
2025-08-18 09:11:51 +08:00
commit 02554225da
2516 changed files with 133155 additions and 0 deletions

View File

@ -0,0 +1,44 @@
page {
background-color: white;
}
.tupian{
width: 500rpx;
height: 500rpx;
border-radius: 250rpx;
overflow: hidden;
margin-left: auto;
margin-right: auto;
display: block;
}
.wenzi{
font-size: 40rpx;
display: flex;
justify-content: center;
align-items: center;
margin-top: 30px;
}
.container{
display: flex;
flex-direction: column;
justify-content: flex-end;
align-items: center;
margin-top: 50px;
}
navigator {
background-color: blue;
color: #fff;
margin-bottom: 10rpx;
padding: 20rpx;
text-align: center;
}
.navigator-hover {
background-color: lightskyblue;
color: #fff;
}
.image{
width: 80rpx;
height: 80rpx;
position: relative;
left: 330rpx;
}

View File

@ -0,0 +1,7 @@
<view>
<image class="tupian" mode="scaleToFill" src="../image/logo.png" />
<image mode="scaleToFill" class="image" src="/pages/image/login.png" />
<text class="wenzi">请完成授权以继续使用</text>
</view>
<button type="primary" onTap="Login">支付宝一键登录</button>

View File

@ -0,0 +1,77 @@
import {url} from '../request'
Page({
data: {
authCode: '',
},
Login() {
my.getAuthCode({
scopes: 'auth_user',
success: res => {
const authCode = res.authCode;
console.log(typeof authCode);
console.log(authCode);
my.setStorage({
key: 'userInfo',
data: {
username: username,
avatarUrl: avatarUrl,
cookie:setCookie,
id:id
},
success: function () {
console.log('用户信息已存储',cookie);
},
fail: function (err) {
console.error('存储失败:', err);
}
});
// 请求后端接口进行用户登录
// my.request({
// url: url + '/api/Alipay/parseCode',
// data: {
// authCode,
// },
// success: (res) => {
// const { username, avatarUrl,id} = res.data.data;
// const setCookie = res.header['set-cookie'] || res.header['Set-Cookie'];
// console.log('Set-Cookie:', setCookie+'这是这个码');
// // 存储用户信息到本地存储
// my.setStorage({
// key: 'userInfo',
// data: {
// username: username,
// avatarUrl: avatarUrl,
// cookie:setCookie,
// id:id
// },
// success: function () {
// console.log('用户信息已存储',cookie);
// },
// fail: function (err) {
// console.error('存储失败:', err);
// }
// });
// // 登录成功后的处理逻辑
// console.log(res);
// my.alert({
// title: '登录成功',
// });
// my.navigateBack();
// },
// fail: (res) => {
// console.log("登录失败:", res);
// }
// });
}
});
},
});

View File

@ -0,0 +1,5 @@
{
"defaultTitle": "登录测试",
"usingComponents": {},
"styleIsolation": "apply-shared"
}