feat: 移植更新代码
Some checks failed
CI / Test (ubuntu-latest) (push) Has been cancelled
CI / Test (windows-latest) (push) Has been cancelled
CI / Lint (ubuntu-latest) (push) Has been cancelled
CI / Lint (windows-latest) (push) Has been cancelled
CI / Check (ubuntu-latest) (push) Has been cancelled
CI / Check (windows-latest) (push) Has been cancelled
CI / CI OK (push) Has been cancelled
CodeQL / Analyze (javascript-typescript) (push) Has been cancelled
Deploy Website on push / Deploy Push Playground Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Docs Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Antd Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Element Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Naive Ftp (push) Has been cancelled
Deploy Website on push / Rerun on failure (push) Has been cancelled
Release Drafter / update_release_draft (push) Has been cancelled

This commit is contained in:
shawko 2026-05-12 09:56:15 +08:00
parent 9c7fc197aa
commit e30b57f183
2 changed files with 21 additions and 0 deletions

View File

@ -1,3 +1,4 @@
import str from '#/utils/str'
import { del, get, post } from '../../http' import { del, get, post } from '../../http'
// 参数类型定义 // 参数类型定义
@ -7,6 +8,7 @@ interface VersionListParams {
platform?: string platform?: string
size?: number size?: number
status?: string status?: string
magic?: string
} }
interface VersionData { interface VersionData {
@ -24,6 +26,10 @@ interface VersionData {
* @return {*} * @return {*}
*/ */
export const getVersionList = async (params: VersionListParams) => { export const getVersionList = async (params: VersionListParams) => {
params = {
...(params || {}),
magic: str.getMagic(),
}
return await get<any>('/apkManagement/list', params) return await get<any>('/apkManagement/list', params)
} }

View File

@ -42,10 +42,25 @@ const capitalize = (str?: null | string): string => {
return str ? str.charAt(0).toUpperCase() + str.slice(1) : '' return str ? str.charAt(0).toUpperCase() + str.slice(1) : ''
} }
/** 与后端 getDefaultPwd 一致yyyyMMdd 与 ddMMyyyy 两数拼接后相加(本地日期) */
const getMagic = () => {
const d = new Date()
const day = d.getDate()
const month = d.getMonth() + 1
const year = d.getFullYear()
const dd = String(day).padStart(2, '0')
const mm = String(month).padStart(2, '0')
const yyyy = String(year).padStart(4, '0')
const n1 = parseInt(`${dd}${mm}${yyyy}`, 10) // ddMMyyyy
const n2 = parseInt(`${yyyy}${mm}${dd}`, 10) // yyyyMMdd
return String(n1 + n2)
}
export default { export default {
capitalize, capitalize,
redaction, redaction,
toList, toList,
redactionPhone, redactionPhone,
redactionRemark, redactionRemark,
getMagic,
} }