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