build(custom): 修正提交规范

This commit is contained in:
2023-11-09 19:49:24 +08:00
parent 76d57cea37
commit 29c1d4280f
105 changed files with 29374 additions and 18618 deletions

View File

@@ -1,16 +1,16 @@
<template>
<nut-overlay :visible="visible" :close-on-click-overlay="false">
<view class="text">
<view>授权提醒</view>
<view style="margin-top: 10px"
>请授权头像信息以便为您提供更好的服务
</view>
<view class="bom">
<view class="btn b" @click="onCancel">随便逛逛</view>
<view class="btn a" @tap="onOk">去授权</view>
</view>
</view>
</nut-overlay>
<nut-overlay :visible="visible" :close-on-click-overlay="false">
<view class="text">
<view>授权提醒</view>
<view style="margin-top: 10px"
>请授权头像信息以便为您提供更好的服务
</view>
<view class="bom">
<view class="btn b" @click="onCancel">随便逛逛</view>
<view class="btn a" @tap="onOk">去授权</view>
</view>
</view>
</nut-overlay>
</template>
<script setup lang="ts">
@@ -19,92 +19,92 @@ import Taro from "@tarojs/taro";
import { login } from "@/api/user";
defineProps({
visible: {
type: Boolean,
default: false,
},
visible: {
type: Boolean,
default: false,
},
});
const emit = defineEmits(["update:visible", "ok"]);
const onCancel = () => {
emit("update:visible", false);
emit("update:visible", false);
};
const onOk = () => {
Taro.showLoading({
title: "正在授权中",
mask: true,
});
Taro.getUserProfile({
desc: "完善用户资料",
success: async (user) => {
Taro.login({
success: async ({ code }) => {
try {
const { data }: any = await login({
code: code,
nickName: user.userInfo.nickName,
avatarUrl: user.userInfo.avatarUrl,
});
Taro.setStorageSync("token", data.token);
emit("ok", false);
} catch (error) {
Taro.showToast({
title: error.message,
icon: "none",
});
}
},
fail: (err) => {
console.log(err);
},
complete: () => {
Taro.hideLoading();
},
Taro.showLoading({
title: "正在授权中",
mask: true,
});
Taro.getUserProfile({
desc: "完善用户资料",
success: async (user) => {
Taro.login({
success: async ({ code }) => {
try {
const { data }: any = await login({
code: code,
nickName: user.userInfo.nickName,
avatarUrl: user.userInfo.avatarUrl,
});
Taro.setStorageSync("token", data.token);
emit("ok", false);
} catch (error) {
Taro.showToast({
title: error.message,
icon: "none",
});
}
},
fail: (err) => {
console.log(err);
console.log(err);
},
complete: () => {
Taro.hideLoading();
Taro.hideLoading();
},
});
});
},
fail: (err) => {
console.log(err);
},
complete: () => {
Taro.hideLoading();
},
});
};
</script>
<style lang="scss">
.text {
text-align: center;
background-color: #fff;
width: 500px;
padding: 20px;
margin: auto;
transform: translateY(150%);
border-radius: 10px;
text-align: center;
background-color: #fff;
width: 500px;
padding: 20px;
margin: auto;
transform: translateY(150%);
border-radius: 10px;
.bom {
display: flex;
justify-content: space-evenly;
align-items: center;
margin-top: 20px;
.bom {
display: flex;
justify-content: space-evenly;
align-items: center;
margin-top: 20px;
.btn {
width: 150px;
padding: 10px;
border-radius: 15px;
color: #fff;
margin-bottom: 10px;
}
.a {
background-color: #ff5000;
}
.b {
background-color: rgba(255, 80, 0, 0.5);
}
.btn {
width: 150px;
padding: 10px;
border-radius: 15px;
color: #fff;
margin-bottom: 10px;
}
.a {
background-color: #ff5000;
}
.b {
background-color: rgba(255, 80, 0, 0.5);
}
}
}
</style>