forked from mt-fe-group/mt-yd-ui
add comments
This commit is contained in:
parent
edc8a10cc3
commit
0566808861
@ -30,7 +30,7 @@
|
|||||||
<!-- 开发环境 -->
|
<!-- 开发环境 -->
|
||||||
<% if (process.env.VUE_APP_NODE_ENV === 'dev') { %>
|
<% if (process.env.VUE_APP_NODE_ENV === 'dev') { %>
|
||||||
<script>
|
<script>
|
||||||
window.SITE_CONFIG['apiURL'] = 'http://localhost:8080/renren-admin';
|
window.SITE_CONFIG['apiURL'] = 'http://192.168.1.65:8080/yd-monitor';
|
||||||
</script>
|
</script>
|
||||||
<% } %>
|
<% } %>
|
||||||
<!-- 集成测试环境 -->
|
<!-- 集成测试环境 -->
|
||||||
|
@ -15,6 +15,7 @@ export const messages = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default new VueI18n({
|
export default new VueI18n({
|
||||||
locale: Cookies.get('language') || 'zh-CN',
|
// locale: Cookies.get('language') || 'zh-CN',
|
||||||
|
locale: 'zh-CN', // 先默认中文
|
||||||
messages
|
messages
|
||||||
})
|
})
|
||||||
|
@ -72,6 +72,7 @@ const router = new Router({
|
|||||||
})
|
})
|
||||||
|
|
||||||
router.beforeEach((to, from, next) => {
|
router.beforeEach((to, from, next) => {
|
||||||
|
console.log('[*] === router beforeEach: ', to, from)
|
||||||
// 添加动态(菜单)路由
|
// 添加动态(菜单)路由
|
||||||
// 已添加或者当前路由为页面路由, 可直接访问
|
// 已添加或者当前路由为页面路由, 可直接访问
|
||||||
if (window.SITE_CONFIG['dynamicMenuRoutesHasAdded'] || fnCurrentRouteIsPageRoute(to, pageRoutes)) {
|
if (window.SITE_CONFIG['dynamicMenuRoutesHasAdded'] || fnCurrentRouteIsPageRoute(to, pageRoutes)) {
|
||||||
|
@ -73,7 +73,7 @@ export function getIconList () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 树形数据转换
|
* 树形数据转换,把扁平的数据,转换为树形结构的数据
|
||||||
* @param {*} data
|
* @param {*} data
|
||||||
* @param {*} id
|
* @param {*} id
|
||||||
* @param {*} pid
|
* @param {*} pid
|
||||||
|
@ -89,8 +89,8 @@ export default {
|
|||||||
cancelButtonText: this.$t('cancel'),
|
cancelButtonText: this.$t('cancel'),
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.$http.post('/logout').then(({ data: res }) => {
|
this.$http.post('/doLogout').then(({ data: res }) => {
|
||||||
if (res.code !== 0) {
|
if (res.code !== 200) {
|
||||||
return this.$message.error(res.msg)
|
return this.$message.error(res.msg)
|
||||||
}
|
}
|
||||||
clearLoginInfo()
|
clearLoginInfo()
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
</span>
|
</span>
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item prop="captcha">
|
<!-- <el-form-item prop="captcha">
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="14">
|
<el-col :span="14">
|
||||||
<el-input v-model="dataForm.captcha" :placeholder="$t('login.captcha')">
|
<el-input v-model="dataForm.captcha" :placeholder="$t('login.captcha')">
|
||||||
@ -35,7 +35,7 @@
|
|||||||
<img :src="captchaPath" @click="getCaptcha()">
|
<img :src="captchaPath" @click="getCaptcha()">
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form-item>
|
</el-form-item> -->
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" @click="dataFormSubmitHandle()" class="w-percent-100">{{ $t('login.title') }}</el-button>
|
<el-button type="primary" @click="dataFormSubmitHandle()" class="w-percent-100">{{ $t('login.title') }}</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -55,7 +55,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import Cookies from 'js-cookie'
|
import Cookies from 'js-cookie'
|
||||||
import debounce from 'lodash/debounce'
|
import debounce from 'lodash/debounce'
|
||||||
import { getUUID } from '@/utils'
|
// import { getUUID } from '@/utils'
|
||||||
export default {
|
export default {
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
@ -64,7 +64,7 @@ export default {
|
|||||||
username: 'admin',
|
username: 'admin',
|
||||||
password: 'admin',
|
password: 'admin',
|
||||||
uuid: '',
|
uuid: '',
|
||||||
captcha: ''
|
// captcha: ''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -77,14 +77,14 @@ export default {
|
|||||||
password: [
|
password: [
|
||||||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
|
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
|
||||||
],
|
],
|
||||||
captcha: [
|
// captcha: [
|
||||||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
|
// { required: true, message: this.$t('validate.required'), trigger: 'blur' }
|
||||||
]
|
// ]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created () {
|
created () {
|
||||||
this.getCaptcha()
|
// this.getCaptcha()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 获取验证码
|
// 获取验证码
|
||||||
@ -99,8 +99,8 @@ export default {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
this.$http.post('/login', this.dataForm).then(({ data: res }) => {
|
this.$http.post('/login', this.dataForm).then(({ data: res }) => {
|
||||||
if (res.code !== 0) {
|
if (res.code !== 200) {
|
||||||
this.getCaptcha()
|
// this.getCaptcha()
|
||||||
return this.$message.error(res.msg)
|
return this.$message.error(res.msg)
|
||||||
}
|
}
|
||||||
Cookies.set('token', res.data.token)
|
Cookies.set('token', res.data.token)
|
||||||
|
Loading…
Reference in New Issue
Block a user