hookehuyr

docs: 更新文件描述并移除未使用的OAuth哈希恢复功能

更新src/api/fn.js的文件描述以更准确反映其功能
移除src/main.js中未使用的OAuth哈希恢复功能代码
/*
* @Date: 2022-05-18 22:56:08
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2025-12-27 23:06:36
* @LastEditTime: 2025-12-28 01:59:24
* @FilePath: /mlaj/src/api/fn.js
* @Description: 文件描述
* @Description: 网络请求功能函数
*/
import axios from '@/utils/axios';
import qs from 'qs'
......
/*
* @Date: 2025-03-20 20:36:36
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2025-12-27 22:06:35
* @LastEditTime: 2025-12-28 11:48:35
* @FilePath: /mlaj/src/main.js
* @Description: 文件描述
*/
......@@ -44,19 +44,19 @@ app.config.globalProperties.$http = axios; // 关键语句
* @description 前端复原 OAuth 回跳的 hash 路由位置:当 URL 中存在 ret_hash 参数且当前无 hash 时,将其拼回地址栏。
* @returns {void}
*/
function restoreHashAfterOAuth() {
const url = new URL(window.location.href);
const ret_hash = url.searchParams.get('ret_hash');
if (ret_hash && !window.location.hash) {
// 删除 ret_hash,保留其他查询参数
url.searchParams.delete('ret_hash');
const base = url.toString().split('#')[0];
const new_url = base + ret_hash;
// 使用 replaceState 避免再次刷新与历史记录污染
window.history.replaceState(null, '', new_url);
}
}
void restoreHashAfterOAuth
// function restoreHashAfterOAuth() {
// const url = new URL(window.location.href);
// const ret_hash = url.searchParams.get('ret_hash');
// if (ret_hash && !window.location.hash) {
// // 删除 ret_hash,保留其他查询参数
// url.searchParams.delete('ret_hash');
// const base = url.toString().split('#')[0];
// const new_url = base + ret_hash;
// // 使用 replaceState 避免再次刷新与历史记录污染
// window.history.replaceState(null, '', new_url);
// }
// }
// void restoreHashAfterOAuth
// 在安装路由前进行一次 hash 复原,确保初始路由正确
// restoreHashAfterOAuth()
......