update
This commit is contained in:
parent
372e393c58
commit
cb847a669d
|
|
@ -1,6 +1,5 @@
|
|||
{
|
||||
"extends": "standard",
|
||||
"installedESLint": true,
|
||||
"root": true,
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 6,
|
||||
|
|
|
|||
|
|
@ -14,8 +14,8 @@ util.title = function (title) {
|
|||
const ajaxUrl = env === 'development'
|
||||
? 'http://127.0.0.1:8888'
|
||||
: env === 'production'
|
||||
? 'https://www.url.com'
|
||||
: 'https://debug.url.com';
|
||||
? 'https://www.url.com'
|
||||
: 'https://debug.url.com';
|
||||
|
||||
util.ajax = axios.create({
|
||||
baseURL: ajaxUrl,
|
||||
|
|
@ -190,7 +190,7 @@ util.openNewPage = function (vm, name, argu, query) {
|
|||
let i = 0;
|
||||
let tagHasOpened = false;
|
||||
while (i < openedPageLen) {
|
||||
if (name === pageOpenedList[i].name) { // 页面已经打开
|
||||
if (name === pageOpenedList[i].name) { // 页面已经打开
|
||||
vm.$store.commit('pageOpenedList', {
|
||||
index: i,
|
||||
argu: argu,
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ export const router = new VueRouter(RouterConfig);
|
|||
router.beforeEach((to, from, next) => {
|
||||
iView.LoadingBar.start();
|
||||
Util.title(to.meta.title);
|
||||
if (Cookies.get('locking') === '1' && to.name !== 'locking') { // 判断当前是否是锁定状态
|
||||
if (Cookies.get('locking') === '1' && to.name !== 'locking') { // 判断当前是否是锁定状态
|
||||
next({
|
||||
replace: true,
|
||||
name: 'locking'
|
||||
|
|
@ -26,20 +26,20 @@ router.beforeEach((to, from, next) => {
|
|||
} else if (Cookies.get('locking') === '0' && to.name === 'locking') {
|
||||
next(false);
|
||||
} else {
|
||||
if (!Cookies.get('user') && to.name !== 'login') { // 判断是否已经登录且前往的页面不是登录页
|
||||
if (!Cookies.get('user') && to.name !== 'login') { // 判断是否已经登录且前往的页面不是登录页
|
||||
next({
|
||||
name: 'login'
|
||||
});
|
||||
} else if (Cookies.get('user') && to.name === 'login') { // 判断是否已经登录且前往的是登录页
|
||||
} else if (Cookies.get('user') && to.name === 'login') { // 判断是否已经登录且前往的是登录页
|
||||
Util.title();
|
||||
next({
|
||||
name: 'home_index'
|
||||
});
|
||||
} else {
|
||||
const curRouterObj = Util.getRouterObjByName([otherRouter, ...appRouter], to.name);
|
||||
if (curRouterObj && curRouterObj.access !== undefined) { // 需要判断权限的路由
|
||||
if (curRouterObj && curRouterObj.access !== undefined) { // 需要判断权限的路由
|
||||
if (curRouterObj.access === parseInt(Cookies.get('access'))) {
|
||||
Util.toDefaultPage([otherRouter, ...appRouter], to.name, router, next); // 如果在地址栏输入的是一级菜单则默认打开其第一个二级菜单的页面
|
||||
Util.toDefaultPage([otherRouter, ...appRouter], to.name, router, next); // 如果在地址栏输入的是一级菜单则默认打开其第一个二级菜单的页面
|
||||
} else {
|
||||
next({
|
||||
replace: true,
|
||||
|
|
|
|||
|
|
@ -58,8 +58,8 @@ export const otherRouter = {
|
|||
children: [
|
||||
{ path: 'home', title: {i18n: 'home'}, name: 'home_index', component: resolve => { require(['@/views/home/home.vue'], resolve); } },
|
||||
{ path: 'ownspace', title: '个人中心', name: 'ownspace_index', component: resolve => { require(['@/views/own-space/own-space.vue'], resolve); } },
|
||||
{ path: 'order/:order_id', title: '订单详情', name: 'order_info', component: resolve => { require(['@/views/advanced-router/component/order-info.vue'], resolve); } }, // 用于展示动态路由
|
||||
{ path: 'shopping', title: '购物详情', name: 'shopping', component: resolve => { require(['@/views/advanced-router/component/shopping-info.vue'], resolve); } }, // 用于展示带参路由
|
||||
{ path: 'order/:order_id', title: '订单详情', name: 'order_info', component: resolve => { require(['@/views/advanced-router/component/order-info.vue'], resolve); } }, // 用于展示动态路由
|
||||
{ path: 'shopping', title: '购物详情', name: 'shopping', component: resolve => { require(['@/views/advanced-router/component/shopping-info.vue'], resolve); } }, // 用于展示带参路由
|
||||
{ path: 'message', title: '消息中心', name: 'message_index', component: resolve => { require(['@/views/message/message.vue'], resolve); } }
|
||||
]
|
||||
};
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ const app = {
|
|||
cachePage: [],
|
||||
lang: '',
|
||||
isFullScreen: false,
|
||||
openedSubmenuArr: [], // 要展开的菜单数组
|
||||
openedSubmenuArr: [], // 要展开的菜单数组
|
||||
menuTheme: 'dark', // 主题
|
||||
themeColor: '',
|
||||
pageOpenedList: [{
|
||||
|
|
@ -23,7 +23,7 @@ const app = {
|
|||
path: '',
|
||||
name: 'home_index'
|
||||
}
|
||||
], // 面包屑数组
|
||||
], // 面包屑数组
|
||||
menuList: [],
|
||||
routers: [
|
||||
otherRouter,
|
||||
|
|
@ -31,7 +31,7 @@ const app = {
|
|||
],
|
||||
tagsList: [...otherRouter.children],
|
||||
messageCount: 0,
|
||||
dontCache: ['text-editor', 'artical-publish'] // 在这里定义你不想要缓存的页面的name属性值(参见路由配置router.js)
|
||||
dontCache: ['text-editor', 'artical-publish'] // 在这里定义你不想要缓存的页面的name属性值(参见路由配置router.js)
|
||||
},
|
||||
mutations: {
|
||||
setTagsList (state, list) {
|
||||
|
|
|
|||
|
|
@ -99,10 +99,10 @@
|
|||
return this.$store.state.app.menuList;
|
||||
},
|
||||
pageTagsList () {
|
||||
return this.$store.state.app.pageOpenedList; // 打开的页面的页面对象
|
||||
return this.$store.state.app.pageOpenedList; // 打开的页面的页面对象
|
||||
},
|
||||
currentPath () {
|
||||
return this.$store.state.app.currentPath; // 当前面包屑数组
|
||||
return this.$store.state.app.currentPath; // 当前面包屑数组
|
||||
},
|
||||
avatorPath () {
|
||||
return localStorage.avatorImgPath;
|
||||
|
|
@ -157,7 +157,7 @@
|
|||
return true;
|
||||
}
|
||||
});
|
||||
if (!openpageHasTag) { // 解决关闭当前标签后再点击回退按钮会退到当前页时没有标签的问题
|
||||
if (!openpageHasTag) { // 解决关闭当前标签后再点击回退按钮会退到当前页时没有标签的问题
|
||||
util.openNewPage(this, name, this.$route.params || {}, this.$route.query || {});
|
||||
}
|
||||
},
|
||||
|
|
@ -187,7 +187,7 @@
|
|||
localStorage.currentPageName = to.name;
|
||||
},
|
||||
lang () {
|
||||
util.setCurrentPath(this, this.$route.name); // 在切换语言时用于刷新面包屑
|
||||
util.setCurrentPath(this, this.$route.name); // 在切换语言时用于刷新面包屑
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
|
|
|
|||
|
|
@ -170,16 +170,16 @@ export default {
|
|||
topArticle: false,
|
||||
publishTime: '',
|
||||
publishTimeType: 'immediately',
|
||||
editPublishTime: false, // 是否正在编辑发布时间
|
||||
articleTagSelected: [], // 文章选中的标签
|
||||
articleTagList: [], // 所有标签列表
|
||||
editPublishTime: false, // 是否正在编辑发布时间
|
||||
articleTagSelected: [], // 文章选中的标签
|
||||
articleTagList: [], // 所有标签列表
|
||||
classificationList: [],
|
||||
classificationSelected: [], // 在所有分类目录中选中的目录数组
|
||||
classificationSelected: [], // 在所有分类目录中选中的目录数组
|
||||
offenUsedClass: [],
|
||||
offenUsedClassSelected: [], // 常用目录选中的目录
|
||||
classificationFinalSelected: [], // 最后实际选择的目录
|
||||
offenUsedClassSelected: [], // 常用目录选中的目录
|
||||
classificationFinalSelected: [], // 最后实际选择的目录
|
||||
publishLoading: false,
|
||||
addingNewTag: false, // 添加新标签
|
||||
addingNewTag: false, // 添加新标签
|
||||
newTagName: '' // 新建标签名
|
||||
};
|
||||
},
|
||||
|
|
@ -237,7 +237,7 @@ export default {
|
|||
this.classificationFinalSelected = selectedArray.map(item => {
|
||||
return item.title;
|
||||
});
|
||||
localStorage.classificationSelected = JSON.stringify(this.classificationFinalSelected); // 本地存储所选目录列表
|
||||
localStorage.classificationSelected = JSON.stringify(this.classificationFinalSelected); // 本地存储所选目录列表
|
||||
},
|
||||
setClassificationInOffen (selectedArray) {
|
||||
this.classificationFinalSelected = selectedArray;
|
||||
|
|
@ -280,7 +280,7 @@ export default {
|
|||
let second = date.getSeconds();
|
||||
localStorage.publishTime = year + ' 年 ' + month + ' 月 ' + day + ' 日 -- ' + hour + ' : ' + minute + ' : ' + second;
|
||||
} else {
|
||||
localStorage.publishTime = this.publishTime; // 本地存储发布时间
|
||||
localStorage.publishTime = this.publishTime; // 本地存储发布时间
|
||||
}
|
||||
localStorage.content = tinymce.activeEditor.getContent();
|
||||
this.$router.push({
|
||||
|
|
@ -306,13 +306,13 @@ export default {
|
|||
}
|
||||
},
|
||||
handleSelectTag () {
|
||||
localStorage.tagsList = JSON.stringify(this.articleTagSelected); // 本地存储文章标签列表
|
||||
localStorage.tagsList = JSON.stringify(this.articleTagSelected); // 本地存储文章标签列表
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
completeUrl () {
|
||||
let finalUrl = this.fixedLink + this.articlePath;
|
||||
localStorage.finalUrl = finalUrl; // 本地存储完整文章路径
|
||||
localStorage.finalUrl = finalUrl; // 本地存储完整文章路径
|
||||
return finalUrl;
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ export default {
|
|||
handleSwitch (lang) {
|
||||
this.lang = lang;
|
||||
localStorage.lang = lang;
|
||||
this.$store.commit('switchLang', lang); // 如果你要自己实现多语言切换,那么只需要执行这行代码即可,修改语言类型
|
||||
this.$store.commit('switchLang', lang); // 如果你要自己实现多语言切换,那么只需要执行这行代码即可,修改语言类型
|
||||
|
||||
this.columnsI18n = [
|
||||
{
|
||||
|
|
@ -116,7 +116,7 @@ export default {
|
|||
key: 'company',
|
||||
title: this.$t('company')
|
||||
}
|
||||
]; // 像iview的table组件这样一次渲染如果数据不更新视图就不更新的组件,如果切换语言需要更新一下数据才能切换组件内的多语言
|
||||
]; // 像iview的table组件这样一次渲染如果数据不更新视图就不更新的组件,如果切换语言需要更新一下数据才能切换组件内的多语言
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ export default {
|
|||
lockScreenBack.style.zIndex = -1;
|
||||
lockScreenBack.style.boxShadow = '0 0 0 0 #667aa6 inset';
|
||||
this.$router.push({
|
||||
name: Cookies.get('last_page_name') // 解锁之后跳转到锁屏之前的页面
|
||||
name: Cookies.get('last_page_name') // 解锁之后跳转到锁屏之前的页面
|
||||
});
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
validator () {
|
||||
return true; // 你可以在这里写密码验证方式,如发起ajax请求将用户输入的密码this.password与数据库用户密码对比
|
||||
return true; // 你可以在这里写密码验证方式,如发起ajax请求将用户输入的密码this.password与数据库用户密码对比
|
||||
},
|
||||
handleClickAvator () {
|
||||
this.avatorLeft = '-180px';
|
||||
|
|
|
|||
|
|
@ -164,7 +164,7 @@ export default {
|
|||
this.moveToView(tag);
|
||||
}
|
||||
});
|
||||
}, 1); // 这里不设定时器就会有偏移bug
|
||||
}, 1); // 这里不设定时器就会有偏移bug
|
||||
this.tagsCount = this.tagsList.length;
|
||||
},
|
||||
watch: {
|
||||
|
|
|
|||
|
|
@ -236,7 +236,7 @@ export default {
|
|||
let file = e.target.files[0];
|
||||
let reader = new FileReader();
|
||||
reader.onload = () => {
|
||||
this.cropper3.replace(reader.result, true); // 这里必须设置true这个参数,否则旋转会有bug
|
||||
this.cropper3.replace(reader.result, true); // 这里必须设置true这个参数,否则旋转会有bug
|
||||
reader.onload = null;
|
||||
};
|
||||
reader.readAsDataURL(file);
|
||||
|
|
|
|||
|
|
@ -102,17 +102,17 @@ export default {
|
|||
company: '',
|
||||
department: ''
|
||||
},
|
||||
uid: '', // 登录用户的userId
|
||||
securityCode: '', // 验证码
|
||||
phoneHasChanged: false, // 是否编辑了手机
|
||||
uid: '', // 登录用户的userId
|
||||
securityCode: '', // 验证码
|
||||
phoneHasChanged: false, // 是否编辑了手机
|
||||
save_loading: false,
|
||||
identifyError: '', // 验证码错误
|
||||
identifyError: '', // 验证码错误
|
||||
editPasswordModal: false, // 修改密码模态框显示
|
||||
savePassLoading: false,
|
||||
oldPassError: '',
|
||||
identifyCodeRight: false, // 验证码是否正确
|
||||
hasGetIdentifyCode: false, // 是否点了获取验证码
|
||||
canGetIdentifyCode: false, // 是否可点获取验证码
|
||||
identifyCodeRight: false, // 验证码是否正确
|
||||
hasGetIdentifyCode: false, // 是否点了获取验证码
|
||||
canGetIdentifyCode: false, // 是否可点获取验证码
|
||||
checkIdentifyCodeLoading: false,
|
||||
inforValidate: {
|
||||
name: [
|
||||
|
|
@ -144,7 +144,7 @@ export default {
|
|||
},
|
||||
inputCodeVisible: false, // 显示填写验证码box
|
||||
initPhone: '',
|
||||
gettingIdentifyCodeBtnContent: '获取验证码' // “获取验证码”按钮的文字
|
||||
gettingIdentifyCodeBtnContent: '获取验证码' // “获取验证码”按钮的文字
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
|
|
@ -188,9 +188,9 @@ export default {
|
|||
saveEdit () {
|
||||
this.$refs['userForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
if (this.phoneHasChanged && this.userForm.cellphone !== this.initPhone) { // 手机号码修改过了而且修改之后的手机号和原来的不一样
|
||||
if (this.phoneHasChanged && this.userForm.cellphone !== this.initPhone) { // 手机号码修改过了而且修改之后的手机号和原来的不一样
|
||||
if (this.hasGetIdentifyCode) { // 判断是否点了获取验证码
|
||||
if (this.identifyCodeRight) { // 判断验证码是否正确
|
||||
if (this.identifyCodeRight) { // 判断验证码是否正确
|
||||
this.saveInfoAjax();
|
||||
} else {
|
||||
this.$Message.error('验证码错误,请重新输入');
|
||||
|
|
|
|||
Loading…
Reference in New Issue