初始提交

This commit is contained in:
2026-01-04 11:09:06 +08:00
commit 8fa31df250
1326 changed files with 213907 additions and 0 deletions

21
utils/refreshCurrent.js Normal file
View File

@@ -0,0 +1,21 @@
// 将对象序列化为查询字符串
function stringifyQuery(obj) {
let ret = [];
for (let key in obj) {
if (obj.hasOwnProperty(key)) {
ret.push(encodeURIComponent(key) + '=' + encodeURIComponent(obj[key]));
}
}
return ret.join('&');
}
export function refreshCurrentPage() {
// 获取当前页面的路径
let currentPage = getCurrentPages().pop();
if (currentPage) {
// 重启当前页面
uni.reLaunch({
url: `/${currentPage.route}` + (currentPage.options ? `?${stringifyQuery(currentPage.options)}` :
'')
});
}
}