fix:项目初始化

This commit is contained in:
ouyangxiu
2025-06-10 17:11:41 +07:00
commit db9bffd2c5
713 changed files with 159746 additions and 0 deletions
+63
View File
@@ -0,0 +1,63 @@
/*
* @Descripttion:
* @Author: voanit
* @Date: 2020-09-18 14:50:42
* @LastEditors: Please set LastEditors
* @LastEditTime: 2022-03-14 15:00:53
*/
import Cookies from 'js-cookie'
const TokenKey = 'Comics-Token'
const roleIdKey = 'Comics-RoleId'
const ACCOUNT = 'Comics-Account'
const CHARTOPTIONS = 'Comics-ChartOptions'
export function getToken() {
return Cookies.get(TokenKey)
}
export function getRoleId() {
return Cookies.get(roleIdKey)
}
export function getAccount() {
return Cookies.get(ACCOUNT)
}
export function getChartOptions() {
return Cookies.get(CHARTOPTIONS)
}
export function setToken(token) {
if (token === '') {
return Cookies.remove(TokenKey)
} else {
return Cookies.set(TokenKey, token)
}
}
export function setAccount(account) {
if (account === '') {
return Cookies.remove(ACCOUNT)
} else {
return Cookies.set(ACCOUNT, account)
}
}
export function setRoleId(roleId) {
if (roleId === '') {
return Cookies.remove(roleIdKey)
} else {
return Cookies.set(roleIdKey, roleId)
}
}
export function setChartOptions(options) {
return Cookies.set(CHARTOPTIONS, options)
}
export function removeToken() {
return Cookies.remove(TokenKey)
}
export function removeRoleId() {
return Cookies.remove(roleIdKey)
}
export function removeAccount() {
return Cookies.remove(ACCOUNT)
}
+35
View File
@@ -0,0 +1,35 @@
import settings from '@/settings'
import store from '@/store'
import { isArray, isString } from '@/utils/validate'
import Vue from 'vue'
// you can set in settings.js
// errorLog:'production' | ['production', 'development']
const { errorLog: needErrorLog } = settings
function checkNeed() {
const env = process.env.NODE_ENV
if (isString(needErrorLog)) {
return env === needErrorLog
}
if (isArray(needErrorLog)) {
return needErrorLog.includes(env)
}
return false
}
if (checkNeed()) {
Vue.config.errorHandler = function(err, vm, info, a) {
// Don't ask me why I use Vue.nextTick, it just a hack.
// detail see https://forum.vuejs.org/t/dispatch-in-vue-config-errorhandler-has-some-problem/23500
Vue.nextTick(() => {
store.dispatch('errorLog/addErrorLog', {
err,
vm,
info,
url: window.location.href
})
console.error(err, info)
})
}
}
+46
View File
@@ -0,0 +1,46 @@
/*
* @Author: your name
* @Date: 2021-09-02 16:04:05
* @LastEditTime: 2021-09-06 23:11:49
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: /zhihu-admin/src/utils/get-page-title.js
*/
import defaultSettings from '@/settings'
const title = defaultSettings.title || 'pao fu Admin'
export default function getPageTitle(pageTitle) {
if (pageTitle) {
return `${pageTitle} - ${title}`
}
return `${title}`
}
export function getFilterRoutes(routeList, filterRouts) {
const accessRoutes = routeList
filterRouts.map(key => {
const noChildArr = key.split('/')
if (noChildArr.length === 1) {
const index = accessRoutes.findIndex((item) => {
return item.path === `/${noChildArr[0]}`
})
if (index !== -1) {
accessRoutes.splice(index, 1)
}
} else if (noChildArr.length === 2) {
const index = accessRoutes.findIndex((item) => {
return item.path === `/${noChildArr[0]}`
})
if (index !== -1 && accessRoutes[index].children) {
const childrenIndex = accessRoutes[index].children.findIndex(item => {
return item.path === `${noChildArr[1]}`
})
if (childrenIndex !== -1) {
accessRoutes[index].children.splice(childrenIndex, 1)
}
}
}
})
return accessRoutes
}
+229
View File
@@ -0,0 +1,229 @@
/**
* Created by PanJiaChen on 16/11/18.
*/
/**
* Parse the time to string
* @param {(Object|string|number)} time
* @param {string} cFormat
* @returns {string | null}
*/
export function parseTime(time, cFormat) {
if (arguments.length === 0) {
return null
}
const format = cFormat || '{y}-{m}-{d}'
let date
if (typeof time === 'object') {
date = time
} else {
if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) {
time = parseInt(time)
}
if ((typeof time === 'number') && (time.toString().length === 10)) {
time = time * 1000
}
date = new Date(time)
}
const formatObj = {
y: date.getFullYear(),
m: date.getMonth() + 1,
d: date.getDate(),
h: date.getHours(),
i: date.getMinutes(),
s: date.getSeconds(),
a: date.getDay()
}
const time_str = format.replace(/{([ymdhisa])+}/g, (result, key) => {
const value = formatObj[key]
// Note: getDay() returns 0 on Sunday
if (key === 'a') { return ['日', '一', '二', '三', '四', '五', '六'][value ] }
return value.toString().padStart(2, '0')
})
return time_str
}
/**
* @param {number} time
* @param {string} option
* @returns {string}
*/
export function formatTime(time, option) {
if (('' + time).length === 10) {
time = parseInt(time) * 1000
} else {
time = +time
}
const d = new Date(time)
const now = Date.now()
const diff = (now - d) / 1000
if (diff < 30) {
return '刚刚'
} else if (diff < 3600) {
// less 1 hour
return Math.ceil(diff / 60) + '分钟前'
} else if (diff < 3600 * 24) {
return Math.ceil(diff / 3600) + '小时前'
} else if (diff < 3600 * 24 * 2) {
return '1天前'
}
if (option) {
return parseTime(time, option)
} else {
return (
d.getMonth() +
1 +
'月' +
d.getDate() +
'日' +
d.getHours() +
'时' +
d.getMinutes() +
'分'
)
}
}
/**
* @param {string} url
* @returns {Object}
*/
export function getQueryObject(url) {
url = url == null ? window.location.href : url
const search = url.substring(url.lastIndexOf('?') + 1)
const obj = {}
const reg = /([^?&=]+)=([^?&=]*)/g
search.replace(reg, (rs, $1, $2) => {
const name = decodeURIComponent($1)
let val = decodeURIComponent($2)
val = String(val)
obj[name] = val
return rs
})
return obj
}
/**
* @param {string} input value
* @returns {number} output value
*/
export function byteLength(str) {
// returns the byte length of an utf8 string
let s = str.length
for (var i = str.length - 1; i >= 0; i--) {
const code = str.charCodeAt(i)
if (code > 0x7f && code <= 0x7ff) s++
else if (code > 0x7ff && code <= 0xffff) s += 2
if (code >= 0xDC00 && code <= 0xDFFF) i--
}
return s
}
/**
* @param {Array} actual
* @returns {Array}
*/
export function cleanArray(actual) {
const newArray = []
for (let i = 0; i < actual.length; i++) {
if (actual[i]) {
newArray.push(actual[i])
}
}
return newArray
}
/**
* @param {Object} json
* @returns {Array}
*/
export function param(json) {
if (!json) return ''
return cleanArray(
Object.keys(json).map(key => {
if (json[key] === undefined) return ''
return encodeURIComponent(key) + '=' + encodeURIComponent(json[key])
})
).join('&')
}
/**
* @param {string} type
* @returns {Date}
*/
export function getTime(type) {
if (type === 'start') {
return new Date().getTime() - 3600 * 1000 * 24 * 90
} else {
return new Date(new Date().toDateString())
}
}
/**
* This is just a simple version of deep copy
* Has a lot of edge cases bug
* If you want to use a perfect deep copy, use lodash's _.cloneDeep
* @param {Object} source
* @returns {Object}
*/
export function deepClone(source) {
if (!source && typeof source !== 'object') {
throw new Error('error arguments', 'deepClone')
}
const targetObj = source.constructor === Array ? [] : {}
Object.keys(source).forEach(keys => {
if (source[keys] && typeof source[keys] === 'object') {
targetObj[keys] = deepClone(source[keys])
} else {
targetObj[keys] = source[keys]
}
})
return targetObj
}
/**
* Check if an element has a class
* @param {HTMLElement} elm
* @param {string} cls
* @returns {boolean}
*/
export function hasClass(ele, cls) {
return !!ele.className.match(new RegExp('(\\s|^)' + cls + '(\\s|$)'))
}
/**
* Add class to element
* @param {HTMLElement} elm
* @param {string} cls
*/
export function addClass(ele, cls) {
if (!hasClass(ele, cls)) ele.className += ' ' + cls
}
/**
* Remove class from element
* @param {HTMLElement} elm
* @param {string} cls
*/
export function removeClass(ele, cls) {
if (hasClass(ele, cls)) {
const reg = new RegExp('(\\s|^)' + cls + '(\\s|$)')
ele.className = ele.className.replace(reg, ' ')
}
}
/**
* 截取url参数
* @param {*} name 截取url参数名称
* @returns
*/
export function getQueryString(name) {
const reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i')
const r = window.location.search.substring(1).match(reg)
if (r != null) {
return decodeURIComponent(r[2])
}
return null
}
+133
View File
@@ -0,0 +1,133 @@
/*
* @Author: 江涛
* @Mail: jt213219216@gmail.com
* @Date: 2021-02-22 10:36:38
* @LastEditTime: 2022-06-06 17:41:10
* @LastEditors: Please set LastEditors
* @FilePath: /comics-admin/src/utils/request.js
*/
import qs from 'qs'
import { paramsFilter } from '@/filters/index'
import store from '@/store'
import {
getToken, setToken
} from '@/utils/auth'
import router from '../router'
import axios from 'axios'
import {
Message,
MessageBox
} from 'element-ui'
// create an axios instance
const service = axios.create({
// baseURL: process.env.VUE_APP_BASE_API, // url = base url + request url
// withCredentials: true, // send cookies when cross-domain requests
timeout: 60000 // request timeout
// headers: { Pragma: 'no-cache' }
})
// request interceptor
service.interceptors.request.use(
config => {
if (store.getters.token) {
config.headers['Authorization'] = getToken()
}
if (config.method === 'get') {
config.params = paramsFilter(config.params)
// 如果是get请求,且params是数组类型如arr=[1,2],则转换成arr=1&arr=2
config.paramsSerializer = function (params) {
return qs.stringify(params, { arrayFormat: 'repeat' })
}
}
if (config.method === 'post') {
// 过滤参数
if (config.filterParam) {
if (config.data.param) {
Object.keys(config.data.param).forEach((key) => {
if (config.data.param[key] === '' || config.data.param[key] === null) {
config.data.param[key] = undefined
}
})
} else {
Object.keys(config.data).forEach((key) => {
if (config.data[key] === '' || config.data[key] === null) {
config.data[key] = undefined
}
})
}
}
}
return config
},
error => {
return Promise.reject(error)
}
)
// response interceptor
service.interceptors.response.use(
response => {
const res = response
// if the custom code is not 20000, it is judged as an error.
if (res.status !== 200) {
if (res.data.code !== 1000) {
Message({
message: '请求错误,请重试',
type: 'error',
duration: 5 * 1000
})
}
// 50008: Illegal token; 50012: Other clients logged in; 50014: Token expired;
if (res.data === 400 || res.status === 50012 || res.status === 50014) {
// to re-login
MessageBox.confirm(
'您已注销,可以取消以保留在该页面上,或者再次登录',
'确认登出', {
confirmButtonText: 'Re-Login',
cancelButtonText: 'Cancel',
type: 'warning'
}
).then(() => {
store.dispatch('user/resetToken').then(() => {
location.reload(true)
})
})
}
return Promise.reject(new Error(res.data.msg || 'Error'))
} else {
return res.data
}
}, error => {
if (error.response) {
if (error.response.data.code === 1004) {
Message({
message: 'token过期或账号被踢下线,请重新登陆',
type: 'error',
duration: 5 * 1000
})
setToken('')
router.push('/login')
} else if (error.response.status === 502 || error.response.status === 500) {
Message({
message: '服务端错误。',
type: 'error',
duration: 8 * 1000
})
} else {
Message({
message: '请求错误,请刷新重试',
type: 'error',
duration: 5 * 1000
})
}
} else {
return Promise.reject(error)
}
}
)
export default service
File diff suppressed because it is too large Load Diff
+28
View File
@@ -0,0 +1,28 @@
/*
* @Author: your name
* @Date: 2020-05-23 17:16:04
* @LastEditTime: 2020-05-23 17:25:28
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: /sz-web-client/src/utils/router.js
*/
/**
* 单页面权限判断
*/
export function generatePerData(allRoute, permissArr) {
const permissions = {}
allRoute.meta.apiArr.forEach((item, index) => {
for (let i = 0; i < permissArr.length; i++) {
if (item.description === permissArr[i].title) {
const codeName = permissArr[i].codeName
permissions[codeName] = {
...item,
...{ name: item.description }
}
break
}
}
})
return permissions
}
+209
View File
@@ -0,0 +1,209 @@
/*
* @Descripttion:
* @Author: voanit
* @Date: 2020-05-30 16:25:39
* @LastEditors: Please set LastEditors
* @LastEditTime: 2022-07-18 15:24:05
*/
import Layout from '@/layout'
const map = {
// Home: Layout,
// HomeIndex: () => import('@/views/home/index'),
// 用户管理
User: Layout,
UserList: () => import('@/views/user/userList/index.vue'), // 用户列表
UserAgentList: () => import('@/views/user/userAgentList/index.vue'), // 代理管理
BanList: () => import('@/views/user/banList/index.vue'), // 封禁列表
UserStat: () => import('@/views/user/userStat/index.vue'), // 用户收支统计
TpList: () => import('@/views/user/tpList/index.vue'), // 用户积分统计
CircleList: () => import('@/views/user/circleList/index.vue'), // 圈子列表
FeedbackList: () => import('@/views/user/feedbackList/index.vue'), // 用户反馈
SubscribedCircleList: () => import('@/views/user/subscribedCircleList'), // 圈子订阅列表
// 账号管理
Account: Layout,
AccountList: () => import('@/views/account/accountList/index.vue'), // 账号列表
RoleList: () => import('@/views/account/roleList/index.vue'), // 角色列表
// 资源管理
ResourceManagement: Layout,
ResourceManagementMediaList: () => import('@/views/resourceManagement/videoList/index.vue'), // 视频管理
ResourceManagementMediaTagsList: () => import('@/views/resourceManagement/videoTagType/index.vue'), // 视频标签管理
ResourceManagementComicsList: () => import('@/views/resourceManagement/comics/index.vue'), // 漫画管理
ResourceManagementComicTagsList: () => import('@/views/resourceManagement/comicTagType/index.vue'), // 漫画标签管理
ResourceManagementNovelList: () => import('@/views/resourceManagement/novels/index.vue'), // 小说管理
ResourceManagementNovelTagsList: () => import('@/views/resourceManagement/novelTagType/index.vue'), // 小说标签管理
// 媒资库管理
MediaLibrary: Layout,
MediaLibraryVideoList: () => import('@/views/mediaLibrary/videoList/index.vue'), // 影片列表
MediaLibraryVideoListV1: () => import('@/views/mediaLibrary/videoListV1/index.vue'), // 影片列表V1
MediaLibraryVideoListV2: () => import('@/views/mediaLibrary/videoListV2/index.vue'), // 影片列表V2
// 视频管理
VideoManagement: Layout,
VideoList: () => import('@/views/videoManagement/videoList/index.vue'), // 视频列表
VideoType: () => import('@/views/videoManagement/videoType/index.vue'), // 视频分类
// VideoCollectCategory: () => import('@/views/videoManagement/videoCollectCategory/index.vue'), // 视合集分类
CollectionList: () => import('@/views/videoManagement/collectionList/index.vue'), // 合集列表
Topic: () => import('@/views/videoManagement/topic/index.vue'), // 主题列表
VideoTagType: () => import('@/views/videoManagement/videoTagType/index.vue'), // 视频标签
// Recommend: () => import('@/views/videoManagement/recommend/index.vue'), // 推荐列表
Mediaepisode: () => import('@/views/videoManagement/mediaepisode/index.vue'), // 选集列表
// ActressList: () => import('@/views/videoManagement/actressList/index.vue'), // 女优列表
CommentManage: () => import('@/views/videoManagement/commentManage/index.vue'), // 评论管理
CommentLib: () => import('@/views/videoManagement/commentLib/index.vue'), // 评论库
FilterWordList: () => import('@/views/videoManagement/filterWordList/index.vue'), // 非法词列表
// 小说管理
NovelsManagement: Layout,
Novels: () => import('@/views/novelsManagement/novels/index.vue'), // 小说列表
NovelsTopic: () => import('@/views/novelsManagement/novelsTopic/index.vue'), // 小说主题
NovelsCategory: () => import('@/views/novelsManagement/novelsCategory/index.vue'), // 小说分类
NovelsTag: () => import('@/views/novelsManagement/novelsTag/index.vue'), // 小说标签
NovelsCV: () => import('@/views/novelsManagement/novelsCV/index.vue'), // 小说CV
// NovelsVideo: () => import('@/views/novelsManagement/novelsVideo/index.vue'), // 小说CV
// 漫画管理
ComicsManagement: Layout,
Comics: () => import('@/views/comicsManagement/comics/index.vue'), // 漫画列表
ComicsTopic: () => import('@/views/comicsManagement/comicsTopic/index.vue'), // 漫画主题
YsmComicsTopic: () => import('@/views/comicsManagement/ysmComicsTopic/index.vue'), // 有声漫主题
ComicsCategory: () => import('@/views/comicsManagement/comicsCategory/index.vue'), // 漫画分类
ComicsTag: () => import('@/views/comicsManagement/comicsTag/index.vue'), // 漫画标签
ComicsCV: () => import('@/views/comicsManagement/comicsCV/index.vue'), // 漫画CV
ComicsDayRecommend: () => import('@/views/comicsManagement/comicsDayRecommend/index.vue'), // 每日推荐
SingleRecommend: () => import('@/views/comicsManagement/singleRecommend/index.vue'), // 单行本
// ComicsVideo: () => import('@/views/comicsManagement/comicsVideo/index.vue'), // 漫画CV
// ComicsNotUpList: () => import('@/views/comicsManagement/comicNotUpList/index.vue'), // 每日更新列表
// AudioList: () => import('@/views/novelsManagement/audioList/index.vue'), // 音频列表
// 排行榜管理
RankManagement: Layout,
Rank: () => import('@/views/rankManagement/rank/index.vue'), // 漫画列表
// 社区管理
PostManagement: Layout,
InfoList: () => import('@/views/postManagement/infoList/index.vue'), // 帖子列表
PostReport: () => import('@/views/postManagement/postReport/index.vue'), // 帖子举报列表
PostCategory: () => import('@/views/postManagement/postCategory/index'), // 社区分类
PostUser: () => import('@/views/postManagement/postUser/index'), // 社区达人
PostDiscussactivit: () => import('@/views/postManagement/postDiscussactivit/index.vue'), // 帖子话题
PostTag: () => import('@/views/postManagement/postTag/index.vue'), // 帖子标签
// 约炮管理
DatingManagement: Layout,
DatingBoss: () => import('@/views/datingManagement/datingBoss/index.vue'), // 经纪人列表
DatingCity: () => import('@/views/datingManagement/datingCity/index.vue'), // 城市列表
Complaint: () => import('@/views/datingManagement/complaint/index.vue'), // 举报列表
AdminLoufeng: () => import('@/views/datingManagement/adminLoufeng/index.vue'), // 管理员权限楼风
AdminModel: () => import('@/views/datingManagement/adminModel/index.vue'), // 管理员权限嫩模
Loufeng: () => import('@/views/datingManagement/loufeng/index.vue'), // 楼风列表
DatingModel: () => import('@/views/datingManagement/datingModel/index.vue'), // 嫩模列表
DatingReport: () => import('@/views/datingManagement/datingReport/index.vue'), // 体验报告列表
DatingOrder: () => import('@/views/datingManagement/datingOrder/index.vue'), // 订单列表
DatingConfig: () => import('@/views/datingManagement/datingConfig/index.vue'), // 约炮配置
DinkUrlList: () => import('@/views/datingManagement/linkUrlList/index.vue'), // 经纪人链接
// 商品管理
Commodity: Layout,
Vipcode: () => import('@/views/commodity/vipcode/index.vue'), // 兑换码列表
ListRecord: () => import('@/views/commodity/listRecord/index.vue'), // 兑换记录
RedeemRecord: () => import('@/views/commodity/redeemRecord/index.vue'), // 积分兑换记录
Redeem: () => import('@/views/commodity/redeem/index.vue'), // 兑换记录
VipCard: () => import('@/views/commodity/vipcard/index.vue'), // 卡片管理
Discountcard: () => import('@/views/commodity/discountcard/index.vue'), // 折扣卡片管理
UserDiscountcard: () => import('@/views/commodity/userDiscountcard/index.vue'), // 用户折扣卡片管理
Gold: () => import('@/views/commodity/gold/index.vue'), // 金币管理
// CardType: () => import('@/views/commodity/cardType/index.vue'), // 卡类型管理
ListOfBenefits: () => import('@/views/commodity/listOfBenefits/index.vue'), // 权益管理
GiftBag: () => import('@/views/commodity/giftBag/index.vue'), // 礼包列表
// 抽奖管理
Lottery: Layout,
PrizeManagement: () => import('@/views/lottery/prizeManagement/index.vue'), // 奖品管理
LotteryList: () => import('@/views/lottery/lotteryList/index.vue'), // 抽奖列表
PrizeLotteryList: () => import('@/views/lottery/prizeLotteryList/index.vue'), // 抽奖活动列表
// 交易管理
Tran: Layout,
Saleinfo: () => import('@/views/tran/saleinfo/index.vue'), // 分组分页查询视频售卖统计
TickeSaleinfo: () => import('@/views/tran/ticketSaleinfo/index.vue'), // 分组分页查询观影券售卖统计
GoldSaleinfo: () => import('@/views/tran/goldSaleInfo/index.vue'), // 金币售卖统计
Recharge: () => import('@/views/tran/recharge/index.vue'), // 充值列表
RunningList: () => import('@/views/tran/runningList/index.vue'), // 流水列表
HourStat: () => import('@/views/tran/hourStat/index.vue'), // 每小时充值成功率
Stat: () => import('@/views/tran/stat/index.vue'), // 充值成功率统计
WithdrawList: () => import('@/views/tran/withdrawList/index.vue'), // 提现列表
// 活动管理
Activity: Layout,
Announcement: () => import('@/views/activity/announcement/index.vue'), // 公告列表
Advertise: () => import('@/views/activity/advertise/index.vue'), // 活动广告
CardActivity: () => import('@/views/activity/cardActivity/index.vue'), // 集卡活动
CardcolletList: () => import('@/views/activity/cardcolletList/index.vue'), // 抽卡结果列表
HopeActivity: () => import('@/views/activity/hopeActivity/index.vue'), // 许愿活动列表
HopeDetails: () => import('@/views/activity/hopeDetails/index.vue'), // 许愿活动愿望列表
Notification: () => import('@/views/activity/notification/index.vue'), // 通知列表
ActivityList: () => import('@/views/activity/activityList/index.vue'), // 活动列表
Broadcast: () => import('@/views/activity/broadcast/index.vue'), // 跑马灯配置管理,
NoviceTaskList: () => import('@/views/activity/noviceTaskList/index.vue'), // 任务列表
NoviceTaskCfg: () => import('@/views/activity/noviceTaskCfg/index.vue'), // 任务配置列表
MsgList: () => import('@/views/activity/msgList/index.vue'), // 系统公告
Contact: () => import('@/views/activity/contact/index.vue'), // 联系方式
CheckInList: () => import('@/views/activity/checkInList/index.vue'), // 签到历史列表
CheckInCfgList: () => import('@/views/activity/checkInCfgList/index.vue'), // 签到奖品配置列表
CheckInCfg: () => import('@/views/activity/checkInCfg/index.vue'), // 签到奖品配置列表
WorksPrize: () => import('@/views/activity/worksPrize/index.vue'), // 任务奖品列表
Redeemprize: () => import('@/views/activity/redeemprize/index.vue'), // 奖品兑换记录
HGame: () => import('@/views/activity/hGame/index.vue'), // 禁游
ProxyPrizeList: () => import('@/views/activity/proxyPrizeList/index.vue'), // 邀请好友奖品配置
ProxyPrizeHistoryList: () => import('@/views/activity/proxyPrizeHistoryList/index.vue'), // 邀请好友奖品领取记录
// 隐藏福利管理
CouponsActivity: Layout,
List: () => import('@/views/couponsActivity/list/index.vue'), // 活动列表
HistoryList: () => import('@/views/couponsActivity/historyList/index.vue'), // 历史发放列表
CouponsActivityUserList: () => import('@/views/couponsActivity/userList/index.vue'), // 用户列表
// 搜索管理
SearchManagement: Layout,
Hotsearch: () => import('@/views/searchManagement/hotsearch/index.vue'), // 热搜列表
// 系统管理
System: Layout,
OperationLog: () => import('@/views/system/operationLog/index.vue'), // 操作日志
SystemConfig: () => import('@/views/system/systemConfig/index.vue'), // 系统配置
// up主管理
UpManagement: Layout,
// UpStatistic: () => import('@/views/upManagement/upStatistic/index.vue'), // 操作日志
UpRelease: () => import('@/views/upManagement/upRelease/index.vue'), // 系统配置
UpList: () => import('@/views/upManagement/upList/index.vue'), // up主列表
NoticeList: () => import('@/views/upManagement/notice/index.vue'), // 系统公告列表
UpStatlist: () => import('@/views/upManagement/upStatlist/index.vue'), // up主日收益列表
UpMasterlist: () => import('@/views/upManagement/upMasterlist/index.vue'), // up主认证列表
// 应用管理
AppManagement: Layout,
AppList: () => import('@/views/appManagement/appList/index.vue'), // 应用列表
// AI管理
AiManagement: Layout,
AiGirlFriendConfig: () => import('@/views/aiManagement/aiGirlFriendConfig/index.vue'), // ai女友
AiTemplate: () => import('@/views/aiManagement/aiTemplate/index.vue'), // ai模版
AiCategory: () => import('@/views/aiManagement/aiCategory/index.vue'), // ai模版分类
AiFaceOrderPhoto: () => import('@/views/aiManagement/aiFaceOrder/photo.vue'), // ai换脸ss
AiFaceOrderVideo: () => import('@/views/aiManagement/aiFaceOrder/video.vue'), // ai换脸ss
AiStripOrder: () => import('@/views/aiManagement/aiStripOrder/index.vue'), // ai脱衣订单
AiImgToVideo: () => import('@/views/aiManagement/aiImgToVideo/index.vue'), // ai图生视频
// 其他管理
OtherConfig: Layout,
Jumptab: () => import('@/views/otherConfig/jumptab/index.vue'), // 首页跳转按钮
DiscountCardConfig: () => import('@/views/otherConfig/discountCardConfig/index.vue'),
AicustomerService: () => import('@/views/otherConfig/aicustomerservice/index.vue'), // 智能客服配置
OfficialGroup: () => import('@/views/otherConfig/officialGroup/index.vue'), // 官方群组
Weblive: Layout,
WebliveCategory: () => import('@/views/weblive/webliveCategory/index.vue'), // 直播分类
WebliveStreamlist: () => import('@/views/weblive/webliveStreamlist/index.vue') // 直播列表
}
export const assemblyRoute = file => {
return map[file] || null
}
+208
View File
@@ -0,0 +1,208 @@
/**
* Created by PanJiaChen on 16/11/18.
*/
/**
* @param {string} path
* @returns {Boolean}
*/
export function isExternal(path) {
return /^(https?:|mailto:|tel:)/.test(path)
}
/**
* @param {string} str
* @returns {Boolean}
*/
export function validUsername(str) {
const valid_map = ['admin', 'editor']
return valid_map.indexOf(str.trim()) >= 0
}
/**
* @param {string} url
* @returns {Boolean}
*/
export function validURL(url) {
const reg = /^(https?|ftp):\/\/([a-zA-Z0-9.-]+(:[a-zA-Z0-9.&%$-]+)*@)*((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(:[0-9]+)*(\/($|[a-zA-Z0-9.,?'\\+&%$#=~_-]+))*$/
return reg.test(url)
}
/**
* @param {string} str
* @returns {Boolean}
*/
export function validLowerCase(str) {
const reg = /^[a-z]+$/
return reg.test(str)
}
/**
* @param {string} str
* @returns {Boolean}
*/
export function validUpperCase(str) {
const reg = /^[A-Z]+$/
return reg.test(str)
}
/**
* @param {string} str
* @returns {Boolean}
*/
export function validAlphabets(str) {
const reg = /^[A-Za-z]+$/
return reg.test(str)
}
/**
* @param {string} email
* @returns {Boolean}
*/
export function validEmail(email) {
const reg = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
return reg.test(email)
}
/**
* @param {string} str
* @returns {Boolean}
*/
export function isString(str) {
if (typeof str === 'string' || str instanceof String) {
return true
}
return false
}
/**
* @param {Array} arg
* @returns {Boolean}
*/
export function isArray(arg) {
if (typeof Array.isArray === 'undefined') {
return Object.prototype.toString.call(arg) === '[object Array]'
}
return Array.isArray(arg)
}
// import { IsPhone } from './phone'
import { parsePhoneNumberFromString } from 'libphonenumber-js'
function IsPhone(phoneNumber) {
const p = parsePhoneNumberFromString(phoneNumber, 'CN')
return p.isValid()
}
// 正整数验证
const validatorIndex = (rule, value, callback) => {
const reg = /^[0-9]*[1-9][0-9]*$/
if (reg.test(value) || !value) {
callback()
} else {
callback(new Error('请输入正整数'))
}
}
// 正整数验证
const validatorOver3 = (rule, value, callback) => {
const reg = /^[3-9]|[1-9]\d+/
if (reg.test(value) || !value) {
callback()
} else {
callback(new Error('请输入3以上的正整数'))
}
}
// 非汉字验证
const validatorHanzi = (rule, value, callback) => {
const reg = /[^\u4e00-\u9fa5]/
if (reg.test(value) || !value) {
callback()
} else {
callback(new Error('请输入非汉字字符'))
}
}
// 01小数验证
const validatorDecimal = (rule, value, callback) => {
const reg = /^(0(\.\d{1,2})?|1(\.0{1,2})?)$/
if (reg.test(value) || !value) {
callback()
} else {
callback(new Error('请输入0~1的两位小数'))
}
}
// 数字,字母,汉字校验 只含有汉字、数字、字母、下划线不能以下划线开头和结尾
const validatorLanguage = (rule, value, callback) => {
const reg = /^[\w\u4E00-\u9FA5\uF900-\uFA2D]*$/
if (reg.test(value) || !value) {
callback()
} else {
callback(new Error('请输入汉字,字母,数字集合的字符串'))
}
}
// 版本号规则
const validatorVerName = (rule, value, callback) => {
const reg = /^[1-9][0-9]{0,}\.[0-9]{1,3}\.[0-9]{1,3}$/
if (reg.test(value) || !value) {
callback()
} else {
callback(new Error('请输入[正整数].[0~999].[0~999]格式的字符'))
}
}
// 手机号码规则
const validatorMobile = (rule, value, callback) => {
const reg = /^1[3456789]\d{9}$/
if (reg.test(value) || !value) {
callback()
} else {
callback(new Error('请输入正确的手机号码'))
}
}
// 手机号码规则2
const validatorMobile2 = (rule, value, callback) => {
if (value && IsPhone(value) || value === '') {
callback()
} else {
callback(new Error('请输入带有效的手机号码'))
}
}
// 限制只能输入数字(可以输入两位小数)
const validatorFloat = (rule, value, callback) => {
const reg = /^(([1-9][0-9]*)|(([0]\.\d{1,2}|[1-9][0-9]*\.\d{1,2})))$/
if (reg.test(value) || !value) {
callback()
} else {
callback(new Error('请输入最多带两位小数的实数'))
}
}
// 验证当前number只能为负数
const validatorCutNumber = (rule, value, callback) => {
if (value <= 0) {
callback()
} else {
callback(new Error('当前金币只能为负数'))
}
}
// 验证 只能输入数字、英文逗号
const validatorNumber = (rule, value, callback) => {
const reg = /^[^,](([1-9,])(?!\2))+[^,]$/
if (reg.test(value) || !value) {
callback()
} else {
callback(new Error('请输入输入数字、英文逗号'))
}
}
export {
validatorIndex,
validatorOver3,
validatorFloat,
validatorDecimal,
validatorLanguage,
validatorHanzi,
validatorVerName,
validatorMobile,
validatorMobile2,
validatorCutNumber,
validatorNumber
}