This commit is contained in:
zhigang.li 2017-12-04 15:59:00 +08:00
parent 372e393c58
commit cb847a669d
13 changed files with 44 additions and 45 deletions

View File

@ -1,6 +1,5 @@
{
"extends": "standard",
"installedESLint": true,
"root": true,
"parserOptions": {
"ecmaVersion": 6,

View File

@ -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,

View File

@ -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,

View File

@ -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); } }
]
};

View File

@ -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) {

View File

@ -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 () {

View File

@ -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;
}
},

View File

@ -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')
}
]; // iviewtable
]; // iviewtable
}
},
computed: {

View File

@ -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') //
});
}
},

View File

@ -51,7 +51,7 @@ export default {
},
methods: {
validator () {
return true; // ajaxthis.password
return true; // ajaxthis.password
},
handleClickAvator () {
this.avatorLeft = '-180px';

View File

@ -164,7 +164,7 @@ export default {
this.moveToView(tag);
}
});
}, 1); // bug
}, 1); // bug
this.tagsCount = this.tagsList.length;
},
watch: {

View File

@ -236,7 +236,7 @@ export default {
let file = e.target.files[0];
let reader = new FileReader();
reader.onload = () => {
this.cropper3.replace(reader.result, true); // truebug
this.cropper3.replace(reader.result, true); // truebug
reader.onload = null;
};
reader.readAsDataURL(file);

View 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('验证码错误,请重新输入');