f
This commit is contained in:
@@ -59,7 +59,27 @@ $env:SEO_TEST_URL="https://www.xingfucha.cn"; node test-seo.js
|
||||
curl -s -A "Baiduspider/2.0" http://localhost:3000/ | findstr /i "title description keywords canonical"
|
||||
```
|
||||
|
||||
应能看到包含「幸福查」的 title,以及 description、keywords、canonical 等标签。
|
||||
应能看到包含「天远数据」的 title,以及 description、keywords、canonical 等标签。
|
||||
|
||||
**Windows 下中文乱码说明**:服务器返回的是 UTF-8,CMD 默认是 GBK,直接 `curl … | findstr` 会看到乱码(如 `澶╄繙鏁版嵁`)或出现 “FINDSTR: 写入错误”。可任选一种方式解决:
|
||||
|
||||
```cmd
|
||||
:: 方式 1:先切到 UTF-8 再执行(CMD)
|
||||
chcp 65001
|
||||
curl -s -A "Baiduspider/2.0" https://www.tianyuandb.com/ | findstr /i "title description"
|
||||
```
|
||||
|
||||
```powershell
|
||||
# 方式 2:PowerShell 下指定输出编码
|
||||
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
|
||||
curl -s -A "Baiduspider/2.0" https://www.tianyuandb.com/ | Select-String -Pattern "title|description"
|
||||
```
|
||||
|
||||
```cmd
|
||||
:: 方式 3:保存到文件后用编辑器打开(任意编码都行)
|
||||
curl -s -A "Baiduspider/2.0" https://www.tianyuandb.com/ -o seo-test.html
|
||||
:: 用记事本/VSCode 打开 seo-test.html,选 UTF-8 即可看到正确中文
|
||||
```
|
||||
|
||||
```bash
|
||||
# 看完整 HTML 前几行(含 <head>)
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
<script setup>
|
||||
import { ref, computed, nextTick } from "vue";
|
||||
import { showToast } from "vant";
|
||||
import { useDialogStore } from "@/stores/dialogStore";
|
||||
import { useAliyunCaptcha } from "@/composables/useAliyunCaptcha";
|
||||
|
||||
const emit = defineEmits(['bind-success'])
|
||||
const { runWithCaptcha } = useAliyunCaptcha();
|
||||
const router = useRouter();
|
||||
const dialogStore = useDialogStore();
|
||||
const agentStore = useAgentStore();
|
||||
@@ -36,15 +39,15 @@ async function sendVerificationCode() {
|
||||
showToast({ message: "请输入有效的手机号" });
|
||||
return;
|
||||
}
|
||||
const { data, error } = await useApiFetch("auth/sendSms")
|
||||
.post({ mobile: phoneNumber.value, actionType: "bindMobile" })
|
||||
.json();
|
||||
|
||||
if (data.value && !error.value) {
|
||||
if (data.value.code === 200) {
|
||||
await runWithCaptcha(
|
||||
(captchaVerifyParam) =>
|
||||
useApiFetch("auth/sendSms")
|
||||
.post({ mobile: phoneNumber.value, actionType: "bindMobile", captchaVerifyParam })
|
||||
.json(),
|
||||
(res) => {
|
||||
if (res && res.code === 200) {
|
||||
showToast({ message: "获取成功" });
|
||||
startCountdown();
|
||||
// 聚焦到验证码输入框
|
||||
nextTick(() => {
|
||||
const verificationCodeInput = document.getElementById('verificationCode');
|
||||
if (verificationCodeInput) {
|
||||
@@ -52,9 +55,10 @@ async function sendVerificationCode() {
|
||||
}
|
||||
});
|
||||
} else {
|
||||
showToast(data.value.msg);
|
||||
showToast(res?.msg || "发送失败");
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
function startCountdown() {
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
<script setup>
|
||||
import { ref, computed } from "vue";
|
||||
import { useDialogStore } from "@/stores/dialogStore";
|
||||
import { showToast } from "vant";
|
||||
import { useAliyunCaptcha } from "@/composables/useAliyunCaptcha";
|
||||
|
||||
const router = useRouter();
|
||||
const dialogStore = useDialogStore();
|
||||
const agentStore = useAgentStore();
|
||||
const userStore = useUserStore();
|
||||
import { showToast } from "vant";
|
||||
const { runWithCaptcha } = useAliyunCaptcha();
|
||||
// 表单数据
|
||||
const realName = ref("");
|
||||
const idCard = ref("");
|
||||
@@ -47,25 +50,27 @@ const canSubmit = computed(() => {
|
||||
);
|
||||
});
|
||||
|
||||
// 发送验证码
|
||||
// 发送验证码(先通过图形验证滑块再请求接口)
|
||||
async function sendVerificationCode() {
|
||||
if (isCountingDown.value || !isPhoneNumberValid.value) return;
|
||||
if (!isPhoneNumberValid.value) {
|
||||
showToast({ message: "请输入有效的手机号" });
|
||||
return;
|
||||
}
|
||||
const { data, error } = await useApiFetch("auth/sendSms")
|
||||
.post({ mobile: phoneNumber.value, actionType: "realName" })
|
||||
.json();
|
||||
|
||||
if (data.value && !error.value) {
|
||||
if (data.value.code === 200) {
|
||||
await runWithCaptcha(
|
||||
(captchaVerifyParam) =>
|
||||
useApiFetch("auth/sendSms")
|
||||
.post({ mobile: phoneNumber.value, actionType: "realName", captchaVerifyParam })
|
||||
.json(),
|
||||
(res) => {
|
||||
if (res && res.code === 200) {
|
||||
showToast({ message: "获取成功" });
|
||||
startCountdown();
|
||||
} else {
|
||||
showToast(data.value.msg);
|
||||
showToast(res?.msg || "发送失败");
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
function startCountdown() {
|
||||
|
||||
Reference in New Issue
Block a user