|
|
@@ -101,7 +101,10 @@ watch(
|
|
|
const imgKey = ref(guid());
|
|
|
const refer = () => (imgKey.value = guid());
|
|
|
const codeImg = computed(() => baseURL + getCode + "?key=" + imgKey.value);
|
|
|
-
|
|
|
+function isHttpHttpsUrl(path) {
|
|
|
+ // 严格匹配:以http:// 开头 或者 以https:// 开头
|
|
|
+ return path && (path.startsWith('http://') || path.startsWith('https://'))
|
|
|
+}
|
|
|
// 表单提交
|
|
|
const submitClick = async () => {
|
|
|
if (verification.phone && verification.phone !== "88888888888") {
|
|
|
@@ -149,7 +152,11 @@ const submitClick = async () => {
|
|
|
url.searchParams.delete("token");
|
|
|
// url.searchParams.append("token", user.value.token);
|
|
|
window.localStorage.setItem("token", user.value.token);
|
|
|
- window.location.replace(url);
|
|
|
+ if(isHttpHttpsUrl(resolved)){ //判断内链还是外链
|
|
|
+ window.location.replace(url);
|
|
|
+ }else{
|
|
|
+ router.push(resolved);
|
|
|
+ }
|
|
|
} else {
|
|
|
router.replace({ name: RouteName.example });
|
|
|
}
|