123456789101112131415161718192021222324252627282930 |
- // import Snackbar from '@/plugins/snackbar'
- import Curtain from '@/plugins/curtain'
- const prefixList = ['/app-api', '/admin-api']
- export const getSuffixAfterPrefix = (str) => {
- const matchingPrefix = prefixList.find(prefix => str.startsWith(prefix))
- if (matchingPrefix) {
- const matchUrl = str.slice(matchingPrefix.length)
- const hasQuery = matchUrl.indexOf('?') !== -1
- if (hasQuery) {
- const arr = matchUrl.split('?')
- return arr[0]
- }
- else return matchUrl
- }
- return undefined
- }
- // 展示积分
- export function showNextAction (list) {
- const arr = list.reduce((newArr, action) => {
- // if (action.match) newArr.push(`+${action.point} 恭喜您【${action.title}】获得${action.point}积分`)
- if (action.match) newArr.push(`+${action.point} 恭喜您获得${action.point}积分`)
- return newArr
- }, [])
- if (arr?.length) Curtain('point', { list: arr })
- }
|