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"
|
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
|
```bash
|
||||||
# 看完整 HTML 前几行(含 <head>)
|
# 看完整 HTML 前几行(含 <head>)
|
||||||
|
|||||||
@@ -1,8 +1,11 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { ref, computed, nextTick } from "vue";
|
import { ref, computed, nextTick } from "vue";
|
||||||
|
import { showToast } from "vant";
|
||||||
import { useDialogStore } from "@/stores/dialogStore";
|
import { useDialogStore } from "@/stores/dialogStore";
|
||||||
|
import { useAliyunCaptcha } from "@/composables/useAliyunCaptcha";
|
||||||
|
|
||||||
const emit = defineEmits(['bind-success'])
|
const emit = defineEmits(['bind-success'])
|
||||||
|
const { runWithCaptcha } = useAliyunCaptcha();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const dialogStore = useDialogStore();
|
const dialogStore = useDialogStore();
|
||||||
const agentStore = useAgentStore();
|
const agentStore = useAgentStore();
|
||||||
@@ -36,25 +39,26 @@ async function sendVerificationCode() {
|
|||||||
showToast({ message: "请输入有效的手机号" });
|
showToast({ message: "请输入有效的手机号" });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const { data, error } = await useApiFetch("auth/sendSms")
|
await runWithCaptcha(
|
||||||
.post({ mobile: phoneNumber.value, actionType: "bindMobile" })
|
(captchaVerifyParam) =>
|
||||||
.json();
|
useApiFetch("auth/sendSms")
|
||||||
|
.post({ mobile: phoneNumber.value, actionType: "bindMobile", captchaVerifyParam })
|
||||||
if (data.value && !error.value) {
|
.json(),
|
||||||
if (data.value.code === 200) {
|
(res) => {
|
||||||
showToast({ message: "获取成功" });
|
if (res && res.code === 200) {
|
||||||
startCountdown();
|
showToast({ message: "获取成功" });
|
||||||
// 聚焦到验证码输入框
|
startCountdown();
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
const verificationCodeInput = document.getElementById('verificationCode');
|
const verificationCodeInput = document.getElementById('verificationCode');
|
||||||
if (verificationCodeInput) {
|
if (verificationCodeInput) {
|
||||||
verificationCodeInput.focus();
|
verificationCodeInput.focus();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
showToast(data.value.msg);
|
showToast(res?.msg || "发送失败");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function startCountdown() {
|
function startCountdown() {
|
||||||
|
|||||||
@@ -1,11 +1,14 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { ref, computed } from "vue";
|
import { ref, computed } from "vue";
|
||||||
import { useDialogStore } from "@/stores/dialogStore";
|
import { useDialogStore } from "@/stores/dialogStore";
|
||||||
|
import { showToast } from "vant";
|
||||||
|
import { useAliyunCaptcha } from "@/composables/useAliyunCaptcha";
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const dialogStore = useDialogStore();
|
const dialogStore = useDialogStore();
|
||||||
const agentStore = useAgentStore();
|
const agentStore = useAgentStore();
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
import { showToast } from "vant";
|
const { runWithCaptcha } = useAliyunCaptcha();
|
||||||
// 表单数据
|
// 表单数据
|
||||||
const realName = ref("");
|
const realName = ref("");
|
||||||
const idCard = ref("");
|
const idCard = ref("");
|
||||||
@@ -47,25 +50,27 @@ const canSubmit = computed(() => {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
// 发送验证码
|
// 发送验证码(先通过图形验证滑块再请求接口)
|
||||||
async function sendVerificationCode() {
|
async function sendVerificationCode() {
|
||||||
if (isCountingDown.value || !isPhoneNumberValid.value) return;
|
if (isCountingDown.value || !isPhoneNumberValid.value) return;
|
||||||
if (!isPhoneNumberValid.value) {
|
if (!isPhoneNumberValid.value) {
|
||||||
showToast({ message: "请输入有效的手机号" });
|
showToast({ message: "请输入有效的手机号" });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const { data, error } = await useApiFetch("auth/sendSms")
|
await runWithCaptcha(
|
||||||
.post({ mobile: phoneNumber.value, actionType: "realName" })
|
(captchaVerifyParam) =>
|
||||||
.json();
|
useApiFetch("auth/sendSms")
|
||||||
|
.post({ mobile: phoneNumber.value, actionType: "realName", captchaVerifyParam })
|
||||||
if (data.value && !error.value) {
|
.json(),
|
||||||
if (data.value.code === 200) {
|
(res) => {
|
||||||
showToast({ message: "获取成功" });
|
if (res && res.code === 200) {
|
||||||
startCountdown();
|
showToast({ message: "获取成功" });
|
||||||
} else {
|
startCountdown();
|
||||||
showToast(data.value.msg);
|
} else {
|
||||||
|
showToast(res?.msg || "发送失败");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function startCountdown() {
|
function startCountdown() {
|
||||||
|
|||||||
Reference in New Issue
Block a user