add comments

This commit is contained in:
lb 2022-08-02 17:06:11 +08:00
parent edc8a10cc3
commit 0566808861
6 changed files with 17 additions and 15 deletions

View File

@ -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>
<% } %> <% } %>
<!-- 集成测试环境 --> <!-- 集成测试环境 -->

View File

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

View File

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

View File

@ -73,7 +73,7 @@ export function getIconList () {
} }
/** /**
* 树形数据转换 * 树形数据转换把扁平的数据转换为树形结构的数据
* @param {*} data * @param {*} data
* @param {*} id * @param {*} id
* @param {*} pid * @param {*} pid

View File

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

View File

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