ZBZ
zhaobenzhi 3 months ago
commit f3ddfcb253

@ -0,0 +1,17 @@
const api = {
// 积分订单
orderpage: 'orders/page',
orderdelete: 'orders/delete',
orderinfo: 'orders/info/',
ordersave: 'orders/save',
orderupdate: 'orders/update',
// 配置
configpage: 'config/page',
configdelete: 'config/delete',
configinfo: 'config/info/',
configsave: 'config/save',
configupdate: 'config/update'
}
export default api

@ -0,0 +1,16 @@
const base = {
get() {
return {
url : "http://localhost:8080/shuiguozaixianxiaoshou/",
name: "shuiguozaixianxiaoshou",
// 退出到首页链接
indexUrl: 'http://localhost:8080/shuiguozaixianxiaoshou/front/index.html'
};
},
getProjectName(){
return {
projectName: "精品水果线上销售网站"
}
}
}
export default base

@ -0,0 +1,29 @@
import axios from 'axios'
import router from '@/router/router-static'
import storage from '@/utils/storage'
const http = axios.create({
timeout: 1000 * 86400,
withCredentials: true,
baseURL: '/shuiguozaixianxiaoshou',
headers: {
'Content-Type': 'application/json; charset=utf-8'
}
})
// 请求拦截
http.interceptors.request.use(config => {
config.headers['Token'] = storage.get('Token') // 请求头带上token
return config
}, error => {
return Promise.reject(error)
})
// 响应拦截
http.interceptors.response.use(response => {
if (response.data && response.data.code === 401) { // 401, token失效
router.push({ name: 'login' })
}
return response
}, error => {
return Promise.reject(error)
})
export default http

@ -0,0 +1,12 @@
// translate router.meta.title, be used in breadcrumb sidebar tagsview
export function generateTitle(title) {
const hasKey = this.$te('route.' + title)
if (hasKey) {
// $t :this method from vue-i18n, inject in @/lang/index.js
const translatedTitle = this.$t('route.' + title)
return translatedTitle
}
return title
}

@ -0,0 +1,306 @@
const menu = {
list() {
return [
{
"backMenu":[
{
"child":[
{
"buttons":[
"查看",
"新增",
"删除",
"修改"
],
"menu":"公告类型管理",
"menuJump":"列表",
"tableName":"dictionaryGonggao"
}
,
{
"buttons":[
"查看",
"新增",
"删除",
"修改"
],
"menu":"商家信用类型管理",
"menuJump":"列表",
"tableName":"dictionaryShangjiaXingji"
}
,
{
"buttons":[
"查看",
"新增",
"删除",
"修改"
],
"menu":"一级分类管理",
"menuJump":"列表",
"tableName":"dictionaryShuiguo"
}
],
"menu":"基础数据管理"
}
,{
"child":[
{
"buttons":[
"查看",
"新增",
"修改",
"删除"
],
"menu":"公告管理",
"menuJump":"列表",
"tableName":"gonggao"
}
],
"menu":"公告管理"
}
,{
"child":[
{
"buttons":[
"查看",
"新增",
"修改",
"删除"
],
"menu":"水果管理",
"menuJump":"列表",
"tableName":"shuiguo"
}
,
{
"buttons":[
"查看",
"修改",
"删除"
],
"menu":"水果评价管理",
"menuJump":"列表",
"tableName":"shuiguoCommentback"
}
,
{
"buttons":[
"查看",
"删除"
],
"menu":"水果收藏管理",
"menuJump":"列表",
"tableName":"shuiguoCollection"
}
,
{
"buttons":[
"订单",
"查看",
"删除"
],
"menu":"水果订单管理",
"menuJump":"列表",
"tableName":"shuiguoOrder"
}
],
"menu":"水果管理"
}
,{
"child":[
{
"buttons":[
"查看",
"新增",
"修改",
"删除"
],
"menu":"单页数据管理",
"menuJump":"列表",
"tableName":"singleSeach"
}
],
"menu":"单页数据管理"
}
,{
"child":[
{
"buttons":[
"查看",
"新增",
"修改",
"删除"
],
"menu":"用户管理",
"menuJump":"列表",
"tableName":"yonghu"
}
],
"menu":"用户管理"
}
,{
"child":[
{
"buttons":[
"查看",
"新增",
"审核",
"修改",
"删除"
],
"menu":"商家管理",
"menuJump":"列表",
"tableName":"shangjia"
}
],
"menu":"商家管理"
}
,{
"child":[
{
"buttons":[
"查看",
"新增",
"修改",
"删除"
],
"menu":"轮播图管理",
"menuJump":"列表",
"tableName":"config"
}
],
"menu":"轮播图信息"
}
],
"frontMenu":[],
"hasBackLogin":"是",
"hasBackRegister":"否",
"hasFrontLogin":"否",
"hasFrontRegister":"否",
"roleName":"管理员",
"tableName":"users"
}
,
{
"backMenu":[
{
"child":[
{
"buttons":[
"查看"
],
"menu":"公告管理",
"menuJump":"列表",
"tableName":"gonggao"
}
],
"menu":"公告管理"
}
,{
"child":[
{
"buttons":[
"查看",
"新增",
"修改",
"删除"
],
"menu":"水果管理",
"menuJump":"列表",
"tableName":"shuiguo"
}
,
{
"buttons":[
"查看",
"修改"
],
"menu":"水果评价管理",
"menuJump":"列表",
"tableName":"shuiguoCommentback"
}
,
{
"buttons":[
"订单",
"查看"
],
"menu":"水果订单管理",
"menuJump":"列表",
"tableName":"shuiguoOrder"
}
],
"menu":"水果管理"
}
],
"frontMenu":[],
"hasBackLogin":"是",
"hasBackRegister":"否",
"hasFrontLogin":"否",
"hasFrontRegister":"否",
"roleName":"商家",
"tableName":"shangjia"
}
,
{
"backMenu":[
{
"child":[
{
"buttons":[
"查看"
],
"menu":"公告管理",
"menuJump":"列表",
"tableName":"gonggao"
}
],
"menu":"公告管理"
}
,{
"child":[
{
"buttons":[
"查看"
],
"menu":"水果评价管理",
"menuJump":"列表",
"tableName":"shuiguoCommentback"
}
,
{
"buttons":[
"查看",
"删除"
],
"menu":"水果收藏管理",
"menuJump":"列表",
"tableName":"shuiguoCollection"
}
,
{
"buttons":[
"订单",
"查看"
],
"menu":"水果订单管理",
"menuJump":"列表",
"tableName":"shuiguoOrder"
}
],
"menu":"水果管理"
}
],
"frontMenu":[],
"hasBackLogin":"是",
"hasBackRegister":"否",
"hasFrontLogin":"否",
"hasFrontRegister":"否",
"roleName":"用户",
"tableName":"yonghu"
}
]
}
}
export default menu;

@ -0,0 +1,18 @@
const storage = {
set(key, value) {
localStorage.setItem(key, JSON.stringify(value));
},
get(key) {
return localStorage.getItem(key)?localStorage.getItem(key).replace('"','').replace('"',''):"";
},
getObj(key) {
return localStorage.getItem(key)?JSON.parse(localStorage.getItem(key)):null;
},
remove(key) {
localStorage.removeItem(key);
},
clear() {
localStorage.clear();
}
}
export default storage;

@ -0,0 +1,94 @@
/* 全局list页面按钮样式 */
.slt {
margin: 0 !important;
display: flex;
}
.ad {
margin: 0 !important;
display: flex;
}
.pages {
& /deep/ el-pagination__sizes{
& /deep/ el-input__inner {
height: 22px;
line-height: 22px;
}
}
}
.el-button+.el-button {
margin:0;
}
.tables {
& /deep/ .el-button--success {
height: 36px;
color: rgba(40, 167, 69, 1);
font-size: 10px;
border-width: 0px;
border-style: solid;
border-color: #DCDFE6;
border-radius: 0px;
background-color: rgba(255, 255, 255, 1);
}
& /deep/ .el-button--primary {
height: 36px;
color: rgba(255, 193, 7, 1);
font-size: 10px;
border-width: 0px;
border-style: solid;
border-color: #DCDFE6;
border-radius: 0px;
background-color: #fff;
}
& /deep/ .el-button--danger {
height: 36px;
color: rgba(220, 53, 69, 1);
font-size: 10px;
border-width: 0px;
border-style: solid;
border-color: #DCDFE6;
border-radius: 0px;
background-color: #fff;
}
& /deep/ .el-button {
margin: 4px;
}
}
/* 全局add-or-update页面按钮样式 */
.editor{
height: 500px;
& /deep/ .ql-container {
height: 310px;
}
}
.amap-wrapper {
width: 100%;
height: 500px;
}
.search-box {
position: absolute;
}
.addEdit-block {
margin: -10px;
}
.detail-form-content {
padding: 12px;
}
.btn .el-button {
padding: 0;
}
/*IndexMain.vue list
//
.el-main
//list
.router-view
*/

@ -0,0 +1,9 @@
const style = {
listStyle(){
return {"searchBtnFontColor":"rgba(106, 0, 138, 1)","pagePosition":"1","inputFontSize":"14px","inputBorderRadius":"0px","tableBtnDelFontColor":"rgba(88, 179, 81, 1)","tableBtnIconPosition":"1","searchBtnHeight":"40px","inputIconColor":"rgba(88, 179, 81, 1)","searchBtnBorderRadius":"4px","tableStripe":true,"btnAdAllWarnFontColor":"rgba(88, 179, 81, 1)","tableBtnDelBgColor":"#fff","searchBtnIcon":"1","tableSize":"mini","searchBtnBorderStyle":"solid","tableSelection":false,"searchBtnBorderWidth":"2px","tableContentFontSize":"14px","searchBtnBgColor":"#fff","inputTitleSize":"14px","btnAdAllBorderColor":"rgba(88, 179, 81, 1)","pageJumper":true,"btnAdAllIconPosition":"1","searchBoxPosition":"3","tableBtnDetailFontColor":"rgba(88, 179, 81, 1)","tableBtnHeight":"30px","pagePager":true,"searchBtnBorderColor":"rgba(88, 179, 81, 1)","tableHeaderFontColor":"rgba(255, 255, 255, 1)","inputTitle":"1","tableBtnBorderRadius":"0px","btnAdAllFont":"1","btnAdAllDelFontColor":"rgba(88, 179, 81, 1)","tableBtnIcon":"1","btnAdAllHeight":"40px","btnAdAllWarnBgColor":"#fff","btnAdAllBorderWidth":"2px","tableStripeFontColor":"#606266","tableBtnBorderStyle":"none none solid none","inputHeight":"40px","btnAdAllBorderRadius":"4px","btnAdAllDelBgColor":"#fff","pagePrevNext":true,"btnAdAllAddBgColor":"rgba(250, 212, 0, 1)","searchBtnFont":"1","tableIndex":true,"btnAdAllIcon":"1","tableSortable":false,"pageSizes":true,"tableFit":true,"pageBtnBG":true,"searchBtnFontSize":"14px","tableBtnEditBgColor":"#fff","inputBorderWidth":"1px","inputFontPosition":"1","inputFontColor":"rgba(88, 179, 81, 1)","pageEachNum":10,"tableHeaderBgColor":"rgba(88, 179, 81, 1)","inputTitleColor":"rgba(88, 179, 81, 1)","btnAdAllBoxPosition":"1","tableBtnDetailBgColor":"#fff","inputIcon":"1","searchBtnIconPosition":"1","btnAdAllFontSize":"10px","inputBorderStyle":"none none solid none ","inputBgColor":"#fff","pageStyle":false,"pageTotal":true,"btnAdAllAddFontColor":"rgba(88, 179, 81, 1)","tableBtnFont":"1","tableContentFontColor":"#606266","inputBorderColor":"rgba(88, 179, 81, 1)","tableShowHeader":true,"tableBtnFontSize":"12px","tableBtnBorderColor":"rgba(88, 179, 81, 1)","inputIconPosition":"2","tableBorder":true,"btnAdAllBorderStyle":"solid","tableBtnBorderWidth":"1px","tableStripeBgColor":"rgba(227, 225, 225, 1)","tableBtnEditFontColor":"rgba(88, 179, 81, 1)","tableAlign":"left"}
},
addStyle(){
return {"btnSaveFontColor":"#fff","selectFontSize":"14px","btnCancelBorderColor":"#DCDFE6","inputBorderRadius":"4px","inputFontSize":"14px","textareaBgColor":"#fff","btnSaveFontSize":"14px","textareaBorderRadius":"4px","uploadBgColor":"#fff","textareaBorderStyle":"solid","btnCancelWidth":"88px","textareaHeight":"120px","dateBgColor":"#fff","btnSaveBorderRadius":"4px","uploadLableFontSize":"14px","textareaBorderWidth":"1px","inputLableColor":"rgba(199, 21, 133, 1)","addEditBoxColor":"rgba(242, 241, 242, 1)","dateIconFontSize":"14px","btnSaveBgColor":"rgba(199, 21, 133, 1)","uploadIconFontColor":"#8c939d","textareaBorderColor":"#DCDFE6","btnCancelBgColor":"rgba(253, 252, 254, 1)","selectLableColor":"rgba(199, 21, 133, 1)","btnSaveBorderStyle":"solid","dateBorderWidth":"1px","dateLableFontSize":"14px","dateBorderRadius":"4px","btnCancelBorderStyle":"solid","selectLableFontSize":"14px","selectBorderStyle":"solid","selectIconFontColor":"#C0C4CC","btnCancelHeight":"44px","inputHeight":"40px","btnCancelFontColor":"rgba(106, 0, 138, 1)","dateBorderColor":"#DCDFE6","dateIconFontColor":"#C0C4CC","uploadBorderStyle":"solid","dateBorderStyle":"solid","dateLableColor":"rgba(199, 21, 133, 1)","dateFontSize":"14px","inputBorderWidth":"1px","uploadIconFontSize":"28px","selectHeight":"40px","inputFontColor":"#606266","uploadHeight":"148px","textareaLableColor":"rgba(199, 21, 133, 1)","textareaLableFontSize":"14px","btnCancelFontSize":"14px","inputBorderStyle":"solid","btnCancelBorderRadius":"4px","inputBgColor":"#fff","inputLableFontSize":"14px","uploadLableColor":"rgba(199, 21, 133, 1)","uploadBorderRadius":"4px","btnSaveHeight":"44px","selectBgColor":"rgba(255, 255, 255, 1)","btnSaveWidth":"88px","selectIconFontSize":"14px","dateHeight":"40px","selectBorderColor":"#DCDFE6","inputBorderColor":"#DCDFE6","uploadBorderColor":"#DCDFE6","textareaFontColor":"#606266","selectBorderWidth":"1px","dateFontColor":"#606266","btnCancelBorderWidth":"1px","uploadBorderWidth":"1px","textareaFontSize":"14px","selectBorderRadius":"4px","selectFontColor":"rgba(10, 10, 10, 1)","btnSaveBorderColor":"#409EFF","btnSaveBorderWidth":"0px"}
}
}
export default style;

@ -0,0 +1,61 @@
import storage from './storage';
import menu from './menu';
/**
* 是否有权限
* @param {*} key
*/
export function isAuth(tableName,key) {
let role = storage.get("role");
if(!role){
role = '管理员';
}
let menus = menu.list();
for(let i=0;i<menus.length;i++){
if(menus[i].roleName==role){
for(let j=0;j<menus[i].backMenu.length;j++){
for(let k=0;k<menus[i].backMenu[j].child.length;k++){
if(tableName==menus[i].backMenu[j].child[k].tableName){
let buttons = menus[i].backMenu[j].child[k].buttons.join(',');
return buttons.indexOf(key) !== -1 || false
}
}
}
}
}
// for(let i=0;i<menus.length;i++){
// if(menus[i].roleName==role){
// for(let j=0;j<menus[i].backMenu.length;j++){
// if(menus[i].backMenu[j].tableName==tableName){
// let buttons = menus[i].backMenu[j].child[0].buttons.join(',');
// return buttons.indexOf(key) !== -1 || false
// }
// }
// }
// }
return false;
}
/**
* * 获取当前时间yyyy-MM-dd hh:mm:ss
* */
export function getCurDateTime() {
let currentTime = new Date(),
year = currentTime.getFullYear(),
month = currentTime.getMonth() + 1 < 10 ? '0' + (currentTime.getMonth() + 1) : currentTime.getMonth() + 1,
day = currentTime.getDate() < 10 ? '0' + currentTime.getDate() : currentTime.getDate(),
hour = currentTime.getHours(),
minute = currentTime.getMinutes(),
second = currentTime.getSeconds();
return year + "-" + month + "-" + day + " " +hour +":" +minute+":"+second;
}
/**
* * 获取当前日期yyyy-MM-dd
* */
export function getCurDate() {
let currentTime = new Date(),
year = currentTime.getFullYear(),
month = currentTime.getMonth() + 1 < 10 ? '0' + (currentTime.getMonth() + 1) : currentTime.getMonth() + 1,
day = currentTime.getDate() < 10 ? '0' + currentTime.getDate() : currentTime.getDate();
return year + "-" + month + "-" + day;
}

@ -0,0 +1,57 @@
/**
* 邮箱
* @param {*} s
*/
export function isEmail (s) {
return /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((.[a-zA-Z0-9_-]{2,3}){1,2})$/.test(s)
}
/**
* 手机号码
* @param {*} s
*/
export function isMobile (s) {
return /^1[0-9]{10}$/.test(s)
}
/**
* 电话号码
* @param {*} s
*/
export function isPhone (s) {
return /^([0-9]{3,4}-)?[0-9]{7,8}$/.test(s)
}
/**
* URL地址
* @param {*} s
*/
export function isURL (s) {
return /^http[s]?:\/\/.*/.test(s)
}
/**
* 匹配数字可以是小数不可以是负数,可以为空
* @param {*} s
*/
export function isNumber(s){
return /(^-?[+-]?([0-9]*\.?[0-9]+|[0-9]+\.?[0-9]*)([eE][+-]?[0-9]+)?$)|(^$)/.test(s);
}
/**
* 匹配整数可以为空
* @param {*} s
*/
export function isIntNumer(s){
return /(^-?\d+$)|(^$)/.test(s);
}
/**
* 身份证校验
*/
export function checkIdCard(idcard) {
const regIdCard = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
if (!regIdCard.test(idcard)) {
return false;
} else {
return true;
}
}
Loading…
Cancel
Save