docs: annotate all shared frontend modules in Chinese
This commit is contained in:
1 parent
2be21c1c62
commit
408f8e5c98
55 files changed
+349
No files matched your search
@@ -1,3 +1,4 @@
|
||||
/** OAuth 授权发起器:校验提供商和返回 URL,再整页跳转;不在前端构造第三方授权参数。 */
|
||||
import { onBeforeUnmount } from "vue";
|
||||
import { ref } from "vue";
|
||||
import { useApi } from "~/lib/auth.js";
|
||||
@@ -10,6 +11,7 @@ function i() {
|
||||
onBeforeUnmount(() => {
|
||||
s = !1;
|
||||
});
|
||||
// busy 防止重复发起,卸载标记防止用户离开页面后被迟到的授权响应再次跳走。
|
||||
async function c(e) {
|
||||
if (s && !a.value) {
|
||||
if (((o.value = ``), !/^[a-z][a-z0-9_]*$/i.test(e))) {
|
||||
@@ -23,6 +25,7 @@ function i() {
|
||||
let n = oauth_r(t?.url, window.location.origin);
|
||||
if (!n) throw Error(`授权地址无效,请联系支持`);
|
||||
try {
|
||||
// 仅记录当前标签页曾发起授权,不存储 OAuth 凭证或 JWT。
|
||||
sessionStorage.setItem(`console-oauth-pending`, `1`);
|
||||
} catch {}
|
||||
window.location.assign(n);
|
||||
|
||||
Reference in new issue
Block a user