update axios response的解析
This commit is contained in:
parent
8b060b8bf1
commit
affea8af59
19
.prettierrc
19
.prettierrc
@ -1,11 +1,12 @@
|
|||||||
{
|
{
|
||||||
"singleQuote": true,
|
"singleQuote": true,
|
||||||
"tabWidth": 2,
|
"tabWidth": 2,
|
||||||
"bracketSameLine": true,
|
"bracketSameLine": true,
|
||||||
"embeddedLanguageFormatting": "auto",
|
"htmlWhitespaceSensitivity": "ignore",
|
||||||
"printWidth": 180,
|
"embeddedLanguageFormatting": "auto",
|
||||||
"quoteProps": "consistent",
|
"printWidth": 180,
|
||||||
"trailingComma": "none",
|
"quoteProps": "consistent",
|
||||||
"semi": false,
|
"trailingComma": "none",
|
||||||
"useTabs": true
|
"semi": false,
|
||||||
|
"useTabs": true
|
||||||
}
|
}
|
46
src/App.vue
46
src/App.vue
@ -1,34 +1,34 @@
|
|||||||
<template>
|
<template>
|
||||||
<transition name="el-fade-in-linear">
|
<transition name="el-fade-in-linear">
|
||||||
<router-view />
|
<router-view />
|
||||||
</transition>
|
</transition>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.el-table th.gutter{
|
.el-table th.gutter {
|
||||||
display: table-cell!important;
|
display: table-cell !important;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<script>
|
<script>
|
||||||
import Cookies from 'js-cookie'
|
import Cookies from 'js-cookie'
|
||||||
import { messages } from '@/i18n'
|
import { messages } from '@/i18n'
|
||||||
export default {
|
export default {
|
||||||
watch: {
|
watch: {
|
||||||
'$i18n.locale': 'i18nHandle'
|
'$i18n.locale': 'i18nHandle'
|
||||||
},
|
},
|
||||||
created () {
|
created() {
|
||||||
this.i18nHandle(this.$i18n.locale)
|
this.i18nHandle(this.$i18n.locale)
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
i18nHandle (val, oldVal) {
|
i18nHandle(val, oldVal) {
|
||||||
Cookies.set('language', val)
|
Cookies.set('language', val)
|
||||||
document.querySelector('html').setAttribute('lang', val)
|
document.querySelector('html').setAttribute('lang', val)
|
||||||
document.title = messages[val].brand.lg
|
document.title = messages[val].brand.lg
|
||||||
// 非登录页面,切换语言刷新页面
|
// 非登录页面,切换语言刷新页面
|
||||||
if (this.$route.name !== 'login' && oldVal) {
|
if (this.$route.name !== 'login' && oldVal) {
|
||||||
window.location.reload()
|
window.location.reload()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -1,96 +1,96 @@
|
|||||||
<template>
|
<template>
|
||||||
<main :class="['aui-content', { 'aui-content--tabs': $route.meta.isTab }]">
|
<main :class="['aui-content', { 'aui-content--tabs': $route.meta.isTab }]">
|
||||||
<!-- tab展示内容 -->
|
<!-- tab展示内容 -->
|
||||||
<template v-if="$route.meta.isTab">
|
<template v-if="$route.meta.isTab">
|
||||||
<el-dropdown class="aui-content--tabs-tools">
|
<el-dropdown class="aui-content--tabs-tools">
|
||||||
<i class="el-icon-arrow-down"></i>
|
<i class="el-icon-arrow-down"></i>
|
||||||
<el-dropdown-menu slot="dropdown" :show-timeout="0">
|
<el-dropdown-menu slot="dropdown" :show-timeout="0">
|
||||||
<el-dropdown-item @click.native="tabRemoveHandle($store.state.contentTabsActiveName)">{{ $t('contentTabs.closeCurrent') }}</el-dropdown-item>
|
<el-dropdown-item @click.native="tabRemoveHandle($store.state.contentTabsActiveName)">{{ $t('contentTabs.closeCurrent') }}</el-dropdown-item>
|
||||||
<el-dropdown-item @click.native="tabsCloseOtherHandle()">{{ $t('contentTabs.closeOther') }}</el-dropdown-item>
|
<el-dropdown-item @click.native="tabsCloseOtherHandle()">{{ $t('contentTabs.closeOther') }}</el-dropdown-item>
|
||||||
<el-dropdown-item @click.native="tabsCloseAllHandle()">{{ $t('contentTabs.closeAll') }}</el-dropdown-item>
|
<el-dropdown-item @click.native="tabsCloseAllHandle()">{{ $t('contentTabs.closeAll') }}</el-dropdown-item>
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
<el-tabs v-model="$store.state.contentTabsActiveName" @tab-click="tabSelectedHandle" @tab-remove="tabRemoveHandle">
|
<el-tabs v-model="$store.state.contentTabsActiveName" @tab-click="tabSelectedHandle" @tab-remove="tabRemoveHandle">
|
||||||
<el-tab-pane
|
<el-tab-pane
|
||||||
v-for="item in $store.state.contentTabs"
|
v-for="item in $store.state.contentTabs"
|
||||||
:key="item.name"
|
:key="item.name"
|
||||||
:name="item.name"
|
:name="item.name"
|
||||||
:label="item.title"
|
:label="item.title"
|
||||||
:closable="item.name !== 'home'"
|
:closable="item.name !== 'home'"
|
||||||
:class="{ 'is-iframe': tabIsIframe(item.iframeURL) }">
|
:class="{ 'is-iframe': tabIsIframe(item.iframeURL) }"
|
||||||
<template v-if="item.name === 'home'">
|
>
|
||||||
<svg slot="label" class="icon-svg aui-content--tabs-icon-nav" aria-hidden="true"><use xlink:href="#icon-home"></use></svg>
|
<template v-if="item.name === 'home'">
|
||||||
</template>
|
<svg slot="label" class="icon-svg aui-content--tabs-icon-nav" aria-hidden="true"><use xlink:href="#icon-home"></use></svg>
|
||||||
<iframe v-if="tabIsIframe(item.iframeURL)" :src="item.iframeURL" width="100%" height="100%" frameborder="0" scrolling="yes"></iframe>
|
</template>
|
||||||
<keep-alive v-else>
|
<iframe v-if="tabIsIframe(item.iframeURL)" :src="item.iframeURL" width="100%" height="100%" frameborder="0" scrolling="yes"></iframe>
|
||||||
<router-view v-if="item.name === $store.state.contentTabsActiveName" />
|
<keep-alive v-else>
|
||||||
</keep-alive>
|
<router-view v-if="item.name === $store.state.contentTabsActiveName" />
|
||||||
</el-tab-pane>
|
</keep-alive>
|
||||||
</el-tabs>
|
</el-tab-pane>
|
||||||
</template>
|
</el-tabs>
|
||||||
<!-- 其他方式, 展示内容 -->
|
</template>
|
||||||
<template v-else>
|
<!-- 其他方式, 展示内容 -->
|
||||||
<keep-alive>
|
<template v-else>
|
||||||
<router-view />
|
<keep-alive>
|
||||||
</keep-alive>
|
<router-view />
|
||||||
</template>
|
</keep-alive>
|
||||||
</main>
|
</template>
|
||||||
|
</main>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { isURL } from '@/utils/validate'
|
import { isURL } from '@/utils/validate'
|
||||||
export default {
|
export default {
|
||||||
data () {
|
data() {
|
||||||
return {
|
return {}
|
||||||
}
|
},
|
||||||
},
|
methods: {
|
||||||
methods: {
|
// tabs, 是否通过iframe展示
|
||||||
// tabs, 是否通过iframe展示
|
tabIsIframe(url) {
|
||||||
tabIsIframe (url) {
|
return isURL(url)
|
||||||
return isURL(url)
|
},
|
||||||
},
|
// tabs, 选中tab
|
||||||
// tabs, 选中tab
|
tabSelectedHandle(tab) {
|
||||||
tabSelectedHandle (tab) {
|
tab = this.$store.state.contentTabs.filter(item => item.name === tab.name)[0]
|
||||||
tab = this.$store.state.contentTabs.filter(item => item.name === tab.name)[0]
|
if (tab) {
|
||||||
if (tab) {
|
this.$router.push({
|
||||||
this.$router.push({
|
name: tab.name,
|
||||||
'name': tab.name,
|
params: { ...tab.params },
|
||||||
'params': { ...tab.params },
|
query: { ...tab.query }
|
||||||
'query': { ...tab.query }
|
})
|
||||||
})
|
}
|
||||||
}
|
},
|
||||||
},
|
// tabs, 删除tab
|
||||||
// tabs, 删除tab
|
tabRemoveHandle(tabName) {
|
||||||
tabRemoveHandle (tabName) {
|
if (tabName === 'home') {
|
||||||
if (tabName === 'home') {
|
return false
|
||||||
return false
|
}
|
||||||
}
|
this.$store.state.contentTabs = this.$store.state.contentTabs.filter(item => item.name !== tabName)
|
||||||
this.$store.state.contentTabs = this.$store.state.contentTabs.filter(item => item.name !== tabName)
|
if (this.$store.state.contentTabs.length <= 0) {
|
||||||
if (this.$store.state.contentTabs.length <= 0) {
|
this.$store.state.sidebarMenuActiveName = this.$store.state.contentTabsActiveName = 'home'
|
||||||
this.$store.state.sidebarMenuActiveName = this.$store.state.contentTabsActiveName = 'home'
|
return false
|
||||||
return false
|
}
|
||||||
}
|
// 当前选中tab被删除
|
||||||
// 当前选中tab被删除
|
if (tabName === this.$store.state.contentTabsActiveName) {
|
||||||
if (tabName === this.$store.state.contentTabsActiveName) {
|
let tab = this.$store.state.contentTabs[this.$store.state.contentTabs.length - 1]
|
||||||
let tab = this.$store.state.contentTabs[this.$store.state.contentTabs.length - 1]
|
this.$router.push({
|
||||||
this.$router.push({
|
name: tab.name,
|
||||||
name: tab.name,
|
params: { ...tab.params },
|
||||||
params: { ...tab.params },
|
query: { ...tab.query }
|
||||||
query: { ...tab.query }
|
})
|
||||||
})
|
}
|
||||||
}
|
},
|
||||||
},
|
// tabs, 关闭其它
|
||||||
// tabs, 关闭其它
|
tabsCloseOtherHandle() {
|
||||||
tabsCloseOtherHandle () {
|
this.$store.state.contentTabs = this.$store.state.contentTabs.filter(item => {
|
||||||
this.$store.state.contentTabs = this.$store.state.contentTabs.filter(item => {
|
return item.name === 'home' || item.name === this.$store.state.contentTabsActiveName
|
||||||
return item.name === 'home' || item.name === this.$store.state.contentTabsActiveName
|
})
|
||||||
})
|
},
|
||||||
},
|
// tabs, 关闭全部
|
||||||
// tabs, 关闭全部
|
tabsCloseAllHandle() {
|
||||||
tabsCloseAllHandle () {
|
this.$store.state.contentTabs = this.$store.state.contentTabs.filter(item => item.name === 'home')
|
||||||
this.$store.state.contentTabs = this.$store.state.contentTabs.filter(item => item.name === 'home')
|
this.$router.push({ name: 'home' })
|
||||||
this.$router.push({ name: 'home' })
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -1,30 +1,30 @@
|
|||||||
<template>
|
<template>
|
||||||
<aside :class="['aui-sidebar', `aui-sidebar--${$store.state.sidebarLayoutSkin}`]">
|
<aside :class="['aui-sidebar', `aui-sidebar--${$store.state.sidebarLayoutSkin}`]">
|
||||||
<div class="aui-sidebar__inner">
|
<div class="aui-sidebar__inner">
|
||||||
<el-menu
|
<el-menu
|
||||||
:default-active="$store.state.sidebarMenuActiveName"
|
:default-active="$store.state.sidebarMenuActiveName"
|
||||||
:collapse="$store.state.sidebarFold"
|
:collapse="$store.state.sidebarFold"
|
||||||
:unique-opened="true"
|
:unique-opened="true"
|
||||||
:collapseTransition="false"
|
:collapseTransition="false"
|
||||||
class="aui-sidebar__menu">
|
class="aui-sidebar__menu"
|
||||||
<sub-menu v-for="menu in $store.state.sidebarMenuList" :key="menu.id" :menu="menu" />
|
>
|
||||||
</el-menu>
|
<sub-menu v-for="menu in $store.state.sidebarMenuList" :key="menu.id" :menu="menu" />
|
||||||
</div>
|
</el-menu>
|
||||||
</aside>
|
</div>
|
||||||
|
</aside>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import SubMenu from './main-sidebar-sub-menu'
|
import SubMenu from './main-sidebar-sub-menu'
|
||||||
export default {
|
export default {
|
||||||
data () {
|
data() {
|
||||||
return {
|
return {}
|
||||||
}
|
},
|
||||||
},
|
components: {
|
||||||
components: {
|
SubMenu
|
||||||
SubMenu
|
},
|
||||||
},
|
created() {
|
||||||
created () {
|
this.$store.state.sidebarMenuList = window.SITE_CONFIG['menuList']
|
||||||
this.$store.state.sidebarMenuList = window.SITE_CONFIG['menuList']
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -187,8 +187,8 @@
|
|||||||
})
|
})
|
||||||
}).then(({data}) => {
|
}).then(({data}) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
this.dataList = data.list
|
this.dataList = data.data.list
|
||||||
this.totalPage = data.total
|
this.totalPage = data.data.total
|
||||||
} else {
|
} else {
|
||||||
this.dataList = []
|
this.dataList = []
|
||||||
this.totalPage = 0
|
this.totalPage = 0
|
@ -169,8 +169,8 @@
|
|||||||
})
|
})
|
||||||
}).then(({data}) => {
|
}).then(({data}) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
this.dataList = data.list
|
this.dataList = data.data.list
|
||||||
this.totalPage = data.total
|
this.totalPage = data.data.total
|
||||||
} else {
|
} else {
|
||||||
this.dataList = []
|
this.dataList = []
|
||||||
this.totalPage = 0
|
this.totalPage = 0
|
@ -163,8 +163,8 @@
|
|||||||
})
|
})
|
||||||
}).then(({data}) => {
|
}).then(({data}) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
this.dataList = data.list
|
this.dataList = data.data.list
|
||||||
this.totalPage = data.total
|
this.totalPage = data.data.total
|
||||||
} else {
|
} else {
|
||||||
this.dataList = []
|
this.dataList = []
|
||||||
this.totalPage = 0
|
this.totalPage = 0
|
@ -11,35 +11,39 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<el-table :data="dataList" border v-loading="dataListLoading" @selection-change="selectionChangeHandle" style="width: 100%;">
|
<el-table :data="dataList" border v-loading="dataListLoading" @selection-change="selectionChangeHandle" style="width: 100%;">
|
||||||
<el-table-column type="selection" header-align="center" align="center" width="50"> </el-table-column>
|
<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
|
||||||
<el-table-column prop="id" header-align="center" align="center" label="id"> </el-table-column>
|
<el-table-column prop="id" header-align="center" align="center" label="id"></el-table-column>
|
||||||
<el-table-column prop="code" header-align="center" align="center" label="编码"> </el-table-column>
|
<el-table-column prop="code" header-align="center" align="center" label="编码"></el-table-column>
|
||||||
<el-table-column prop="name" header-align="center" align="center" label="设备名称"> </el-table-column>
|
<el-table-column prop="name" header-align="center" align="center" label="设备名称"></el-table-column>
|
||||||
<el-table-column prop="enName" header-align="center" align="center" label="英文名称"> </el-table-column>
|
<el-table-column prop="enName" header-align="center" align="center" label="英文名称"></el-table-column>
|
||||||
<el-table-column prop="abbr" header-align="center" align="center" label="缩写"> </el-table-column>
|
<el-table-column prop="abbr" header-align="center" align="center" label="缩写"></el-table-column>
|
||||||
<el-table-column prop="enterTime" header-align="center" align="center" label="进厂日期"> </el-table-column>
|
<el-table-column prop="enterTime" header-align="center" align="center" label="进厂日期"></el-table-column>
|
||||||
<el-table-column prop="productionTime" header-align="center" align="center" label="生产日期"> </el-table-column>
|
<el-table-column prop="productionTime" header-align="center" align="center" label="生产日期"></el-table-column>
|
||||||
<el-table-column prop="equipmentTypeId" header-align="center" align="center" label="设备类型,关联设备类型表"> </el-table-column>
|
<el-table-column prop="equipmentTypeId" header-align="center" align="center" label="设备类型,关联设备类型表"></el-table-column>
|
||||||
<el-table-column prop="groupId" header-align="center" align="center" label="分组id (关联 T_EQUIPMENT_GROUP)"> </el-table-column>
|
<el-table-column prop="groupId" header-align="center" align="center" label="分组id (关联 T_EQUIPMENT_GROUP)"></el-table-column>
|
||||||
<el-table-column prop="dataType" header-align="center" align="center" label="0:无类别,1:上片数据设备,2:下片数据设备"> </el-table-column>
|
<el-table-column prop="dataType" header-align="center" align="center" label="0:无类别,1:上片数据设备,2:下片数据设备"></el-table-column>
|
||||||
<el-table-column prop="tvalue" header-align="center" align="center" label="每小时生产数量"> </el-table-column>
|
<el-table-column prop="tvalue" header-align="center" align="center" label="每小时生产数量"></el-table-column>
|
||||||
<el-table-column prop="processingTime" header-align="center" align="center" label="单件加工时间 s/件"> </el-table-column>
|
<el-table-column prop="processingTime" header-align="center" align="center" label="单件加工时间 s/件"></el-table-column>
|
||||||
<el-table-column prop="manufacturer" header-align="center" align="center" label="制造商"> </el-table-column>
|
<el-table-column prop="manufacturer" header-align="center" align="center" label="制造商"></el-table-column>
|
||||||
<el-table-column prop="spec" header-align="center" align="center" label="规格"> </el-table-column>
|
<el-table-column prop="spec" header-align="center" align="center" label="规格"></el-table-column>
|
||||||
<el-table-column prop="description" header-align="center" align="center" label="功能描述"> </el-table-column>
|
<el-table-column prop="description" header-align="center" align="center" label="功能描述"></el-table-column>
|
||||||
<el-table-column prop="enabled" header-align="center" align="center" label="启用状态:0 、停用,1、启用"> </el-table-column>
|
<el-table-column prop="enabled" header-align="center" align="center" label="启用状态:0 、停用,1、启用"></el-table-column>
|
||||||
<el-table-column prop="remark" header-align="center" align="center" label="备注"> </el-table-column>
|
<el-table-column prop="remark" header-align="center" align="center" label="备注"></el-table-column>
|
||||||
<el-table-column prop="valid" header-align="center" align="center" label="删除标志,是否有效:1 可用 0不可用"> </el-table-column>
|
<el-table-column prop="valid" header-align="center" align="center" label="删除标志,是否有效:1 可用 0不可用"></el-table-column>
|
||||||
<el-table-column prop="creatorId" header-align="center" align="center" label="创建人"> </el-table-column>
|
<el-table-column prop="creatorId" header-align="center" align="center" label="创建人"></el-table-column>
|
||||||
<el-table-column prop="creatorName" header-align="center" align="center" label="创建人姓名"> </el-table-column>
|
<el-table-column prop="creatorName" header-align="center" align="center" label="创建人姓名"></el-table-column>
|
||||||
<el-table-column prop="createTime" header-align="center" align="center" label="创建时间"> </el-table-column>
|
<el-table-column prop="createTime" header-align="center" align="center" label="创建时间"></el-table-column>
|
||||||
<el-table-column prop="updaterId" header-align="center" align="center" label="更新人"> </el-table-column>
|
<el-table-column prop="updaterId" header-align="center" align="center" label="更新人"></el-table-column>
|
||||||
<el-table-column prop="updaterName" header-align="center" align="center" label="更新人姓名"> </el-table-column>
|
<el-table-column prop="updaterName" header-align="center" align="center" label="更新人姓名"></el-table-column>
|
||||||
<el-table-column prop="updateTime" header-align="center" align="center" label="更新时间"> </el-table-column>
|
<el-table-column prop="updateTime" header-align="center" align="center" label="更新时间"></el-table-column>
|
||||||
<el-table-column prop="version" header-align="center" align="center" label="版本号"> </el-table-column>
|
<el-table-column prop="version" header-align="center" align="center" label="版本号"></el-table-column>
|
||||||
<el-table-column prop="externalCode" header-align="center" align="center" label="外部系统代码"> </el-table-column>
|
<el-table-column prop="externalCode" header-align="center" align="center" label="外部系统代码"></el-table-column>
|
||||||
<el-table-column prop="externalCodeStatis" header-align="center" align="center" label="统一用的外部代码,代表用哪个设备的数据代替该设备,目前用于生产数量统计">
|
<el-table-column
|
||||||
</el-table-column>
|
prop="externalCodeStatis"
|
||||||
|
header-align="center"
|
||||||
|
align="center"
|
||||||
|
label="统一用的外部代码,代表用哪个设备的数据代替该设备,目前用于生产数量统计"
|
||||||
|
></el-table-column>
|
||||||
<el-table-column fixed="right" header-align="center" align="center" width="150" label="操作">
|
<el-table-column fixed="right" header-align="center" align="center" width="150" label="操作">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
|
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
|
||||||
@ -55,8 +59,7 @@
|
|||||||
:page-size="pageSize"
|
:page-size="pageSize"
|
||||||
:total="totalPage"
|
:total="totalPage"
|
||||||
layout="total, sizes, prev, pager, next, jumper"
|
layout="total, sizes, prev, pager, next, jumper"
|
||||||
>
|
></el-pagination>
|
||||||
</el-pagination>
|
|
||||||
<!-- 弹窗, 新增 / 修改 -->
|
<!-- 弹窗, 新增 / 修改 -->
|
||||||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
|
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
|
||||||
</div>
|
</div>
|
||||||
@ -99,9 +102,10 @@ export default {
|
|||||||
key: this.dataForm.key
|
key: this.dataForm.key
|
||||||
})
|
})
|
||||||
}).then(({ data }) => {
|
}).then(({ data }) => {
|
||||||
|
console.log('===', data)
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
this.dataList = data.list
|
this.dataList = data.data.list
|
||||||
this.totalPage = data.total
|
this.totalPage = data.data.total
|
||||||
} else {
|
} else {
|
||||||
this.dataList = []
|
this.dataList = []
|
||||||
this.totalPage = 0
|
this.totalPage = 0
|
@ -169,8 +169,8 @@
|
|||||||
})
|
})
|
||||||
}).then(({data}) => {
|
}).then(({data}) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
this.dataList = data.list
|
this.dataList = data.data.list
|
||||||
this.totalPage = data.total
|
this.totalPage = data.data.total
|
||||||
} else {
|
} else {
|
||||||
this.dataList = []
|
this.dataList = []
|
||||||
this.totalPage = 0
|
this.totalPage = 0
|
@ -199,8 +199,8 @@
|
|||||||
})
|
})
|
||||||
}).then(({data}) => {
|
}).then(({data}) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
this.dataList = data.list
|
this.dataList = data.data.list
|
||||||
this.totalPage = data.total
|
this.totalPage = data.data.total
|
||||||
} else {
|
} else {
|
||||||
this.dataList = []
|
this.dataList = []
|
||||||
this.totalPage = 0
|
this.totalPage = 0
|
@ -217,8 +217,8 @@
|
|||||||
})
|
})
|
||||||
}).then(({data}) => {
|
}).then(({data}) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
this.dataList = data.list
|
this.dataList = data.data.list
|
||||||
this.totalPage = data.total
|
this.totalPage = data.data.total
|
||||||
} else {
|
} else {
|
||||||
this.dataList = []
|
this.dataList = []
|
||||||
this.totalPage = 0
|
this.totalPage = 0
|
@ -163,8 +163,8 @@
|
|||||||
})
|
})
|
||||||
}).then(({data}) => {
|
}).then(({data}) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
this.dataList = data.list
|
this.dataList = data.data.list
|
||||||
this.totalPage = data.total
|
this.totalPage = data.data.total
|
||||||
} else {
|
} else {
|
||||||
this.dataList = []
|
this.dataList = []
|
||||||
this.totalPage = 0
|
this.totalPage = 0
|
@ -247,8 +247,8 @@
|
|||||||
})
|
})
|
||||||
}).then(({data}) => {
|
}).then(({data}) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
this.dataList = data.list
|
this.dataList = data.data.list
|
||||||
this.totalPage = data.total
|
this.totalPage = data.data.total
|
||||||
} else {
|
} else {
|
||||||
this.dataList = []
|
this.dataList = []
|
||||||
this.totalPage = 0
|
this.totalPage = 0
|
@ -193,8 +193,8 @@
|
|||||||
})
|
})
|
||||||
}).then(({data}) => {
|
}).then(({data}) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
this.dataList = data.list
|
this.dataList = data.data.list
|
||||||
this.totalPage = data.total
|
this.totalPage = data.data.total
|
||||||
} else {
|
} else {
|
||||||
this.dataList = []
|
this.dataList = []
|
||||||
this.totalPage = 0
|
this.totalPage = 0
|
@ -187,8 +187,8 @@
|
|||||||
})
|
})
|
||||||
}).then(({data}) => {
|
}).then(({data}) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
this.dataList = data.list
|
this.dataList = data.data.list
|
||||||
this.totalPage = data.total
|
this.totalPage = data.data.total
|
||||||
} else {
|
} else {
|
||||||
this.dataList = []
|
this.dataList = []
|
||||||
this.totalPage = 0
|
this.totalPage = 0
|
@ -181,8 +181,8 @@
|
|||||||
})
|
})
|
||||||
}).then(({data}) => {
|
}).then(({data}) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
this.dataList = data.list
|
this.dataList = data.data.list
|
||||||
this.totalPage = data.total
|
this.totalPage = data.data.total
|
||||||
} else {
|
} else {
|
||||||
this.dataList = []
|
this.dataList = []
|
||||||
this.totalPage = 0
|
this.totalPage = 0
|
@ -187,8 +187,8 @@
|
|||||||
})
|
})
|
||||||
}).then(({data}) => {
|
}).then(({data}) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
this.dataList = data.list
|
this.dataList = data.data.list
|
||||||
this.totalPage = data.total
|
this.totalPage = data.data.total
|
||||||
} else {
|
} else {
|
||||||
this.dataList = []
|
this.dataList = []
|
||||||
this.totalPage = 0
|
this.totalPage = 0
|
@ -181,8 +181,8 @@
|
|||||||
})
|
})
|
||||||
}).then(({data}) => {
|
}).then(({data}) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
this.dataList = data.list
|
this.dataList = data.data.list
|
||||||
this.totalPage = data.totalCount
|
this.totalPage = data.data.totalCount
|
||||||
} else {
|
} else {
|
||||||
this.dataList = []
|
this.dataList = []
|
||||||
this.totalPage = 0
|
this.totalPage = 0
|
@ -187,8 +187,8 @@
|
|||||||
})
|
})
|
||||||
}).then(({data}) => {
|
}).then(({data}) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
this.dataList = data.list
|
this.dataList = data.data.list
|
||||||
this.totalPage = data.total
|
this.totalPage = data.data.total
|
||||||
} else {
|
} else {
|
||||||
this.dataList = []
|
this.dataList = []
|
||||||
this.totalPage = 0
|
this.totalPage = 0
|
@ -205,8 +205,8 @@
|
|||||||
})
|
})
|
||||||
}).then(({data}) => {
|
}).then(({data}) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
this.dataList = data.list
|
this.dataList = data.data.list
|
||||||
this.totalPage = data.total
|
this.totalPage = data.data.total
|
||||||
} else {
|
} else {
|
||||||
this.dataList = []
|
this.dataList = []
|
||||||
this.totalPage = 0
|
this.totalPage = 0
|
@ -193,8 +193,8 @@
|
|||||||
})
|
})
|
||||||
}).then(({data}) => {
|
}).then(({data}) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
this.dataList = data.list
|
this.dataList = data.data.list
|
||||||
this.totalPage = data.total
|
this.totalPage = data.data.total
|
||||||
} else {
|
} else {
|
||||||
this.dataList = []
|
this.dataList = []
|
||||||
this.totalPage = 0
|
this.totalPage = 0
|
@ -133,8 +133,8 @@
|
|||||||
})
|
})
|
||||||
}).then(({data}) => {
|
}).then(({data}) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
this.dataList = data.list
|
this.dataList = data.data.list
|
||||||
this.totalPage = data.total
|
this.totalPage = data.data.total
|
||||||
} else {
|
} else {
|
||||||
this.dataList = []
|
this.dataList = []
|
||||||
this.totalPage = 0
|
this.totalPage = 0
|
@ -163,8 +163,8 @@
|
|||||||
})
|
})
|
||||||
}).then(({data}) => {
|
}).then(({data}) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
this.dataList = data.list
|
this.dataList = data.data.list
|
||||||
this.totalPage = data.total
|
this.totalPage = data.data.total
|
||||||
} else {
|
} else {
|
||||||
this.dataList = []
|
this.dataList = []
|
||||||
this.totalPage = 0
|
this.totalPage = 0
|
@ -193,8 +193,8 @@
|
|||||||
})
|
})
|
||||||
}).then(({data}) => {
|
}).then(({data}) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
this.dataList = data.list
|
this.dataList = data.data.list
|
||||||
this.totalPage = data.total
|
this.totalPage = data.data.total
|
||||||
} else {
|
} else {
|
||||||
this.dataList = []
|
this.dataList = []
|
||||||
this.totalPage = 0
|
this.totalPage = 0
|
@ -157,8 +157,8 @@
|
|||||||
})
|
})
|
||||||
}).then(({data}) => {
|
}).then(({data}) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
this.dataList = data.list
|
this.dataList = data.data.list
|
||||||
this.totalPage = data.total
|
this.totalPage = data.data.total
|
||||||
} else {
|
} else {
|
||||||
this.dataList = []
|
this.dataList = []
|
||||||
this.totalPage = 0
|
this.totalPage = 0
|
@ -193,8 +193,8 @@
|
|||||||
})
|
})
|
||||||
}).then(({data}) => {
|
}).then(({data}) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
this.dataList = data.list
|
this.dataList = data.data.list
|
||||||
this.totalPage = data.total
|
this.totalPage = data.data.total
|
||||||
} else {
|
} else {
|
||||||
this.dataList = []
|
this.dataList = []
|
||||||
this.totalPage = 0
|
this.totalPage = 0
|
@ -175,8 +175,8 @@
|
|||||||
})
|
})
|
||||||
}).then(({data}) => {
|
}).then(({data}) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
this.dataList = data.list
|
this.dataList = data.data.list
|
||||||
this.totalPage = data.total
|
this.totalPage = data.data.total
|
||||||
} else {
|
} else {
|
||||||
this.dataList = []
|
this.dataList = []
|
||||||
this.totalPage = 0
|
this.totalPage = 0
|
@ -169,8 +169,8 @@
|
|||||||
})
|
})
|
||||||
}).then(({data}) => {
|
}).then(({data}) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
this.dataList = data.list
|
this.dataList = data.data.list
|
||||||
this.totalPage = data.total
|
this.totalPage = data.data.total
|
||||||
} else {
|
} else {
|
||||||
this.dataList = []
|
this.dataList = []
|
||||||
this.totalPage = 0
|
this.totalPage = 0
|
@ -157,8 +157,8 @@
|
|||||||
})
|
})
|
||||||
}).then(({data}) => {
|
}).then(({data}) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
this.dataList = data.list
|
this.dataList = data.data.list
|
||||||
this.totalPage = data.total
|
this.totalPage = data.data.total
|
||||||
} else {
|
} else {
|
||||||
this.dataList = []
|
this.dataList = []
|
||||||
this.totalPage = 0
|
this.totalPage = 0
|
@ -187,8 +187,8 @@
|
|||||||
})
|
})
|
||||||
}).then(({data}) => {
|
}).then(({data}) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
this.dataList = data.list
|
this.dataList = data.data.list
|
||||||
this.totalPage = data.total
|
this.totalPage = data.data.total
|
||||||
} else {
|
} else {
|
||||||
this.dataList = []
|
this.dataList = []
|
||||||
this.totalPage = 0
|
this.totalPage = 0
|
@ -163,8 +163,8 @@
|
|||||||
})
|
})
|
||||||
}).then(({data}) => {
|
}).then(({data}) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
this.dataList = data.list
|
this.dataList = data.data.list
|
||||||
this.totalPage = data.total
|
this.totalPage = data.data.total
|
||||||
} else {
|
} else {
|
||||||
this.dataList = []
|
this.dataList = []
|
||||||
this.totalPage = 0
|
this.totalPage = 0
|
@ -1,28 +1,28 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="aui-wrapper aui-page__login">
|
<div class="aui-wrapper aui-page__login">
|
||||||
<div class="aui-content__wrapper">
|
<div class="aui-content__wrapper">
|
||||||
<main class="aui-content">
|
<main class="aui-content">
|
||||||
<div class="login-header">
|
<div class="login-header">
|
||||||
<h2 class="login-brand">{{ $t('brand.lg') }}</h2>
|
<h2 class="login-brand">{{ $t('brand.lg') }}</h2>
|
||||||
</div>
|
</div>
|
||||||
<div class="login-body">
|
<div class="login-body">
|
||||||
<h3 class="login-title">{{ $t('login.title') }}</h3>
|
<h3 class="login-title">{{ $t('login.title') }}</h3>
|
||||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" status-icon>
|
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" status-icon>
|
||||||
<el-form-item prop="username">
|
<el-form-item prop="username">
|
||||||
<el-input v-model="dataForm.username" :placeholder="$t('login.username')">
|
<el-input v-model="dataForm.username" :placeholder="$t('login.username')">
|
||||||
<span slot="prefix" class="el-input__icon">
|
<span slot="prefix" class="el-input__icon">
|
||||||
<svg class="icon-svg" aria-hidden="true"><use xlink:href="#icon-user"></use></svg>
|
<svg class="icon-svg" aria-hidden="true"><use xlink:href="#icon-user"></use></svg>
|
||||||
</span>
|
</span>
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item prop="password">
|
<el-form-item prop="password">
|
||||||
<el-input v-model="dataForm.password" type="password" :placeholder="$t('login.password')">
|
<el-input v-model="dataForm.password" type="password" :placeholder="$t('login.password')">
|
||||||
<span slot="prefix" class="el-input__icon">
|
<span slot="prefix" class="el-input__icon">
|
||||||
<svg class="icon-svg" aria-hidden="true"><use xlink:href="#icon-lock"></use></svg>
|
<svg class="icon-svg" aria-hidden="true"><use xlink:href="#icon-lock"></use></svg>
|
||||||
</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')">
|
||||||
@ -36,20 +36,23 @@
|
|||||||
</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>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
<div class="login-footer">
|
<div class="login-footer">
|
||||||
<p>
|
<p>
|
||||||
<a href="http://demo.open.renren.io/renren-security" target="_blank">{{ $t('login.demo') }}</a>
|
<a href="http://demo.open.renren.io/renren-security" target="_blank">{{ $t('login.demo') }}</a>
|
||||||
</p>
|
</p>
|
||||||
<p><a href="https://www.renren.io/" target="_blank">{{ $t('login.copyright') }}</a>2022 © renren.io</p>
|
<p>
|
||||||
</div>
|
<a href="https://www.renren.io/" target="_blank">{{ $t('login.copyright') }}</a>
|
||||||
</main>
|
2022 © renren.io
|
||||||
</div>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
</main>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@ -57,57 +60,60 @@ 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 {
|
||||||
captchaPath: '',
|
captchaPath: '',
|
||||||
dataForm: {
|
dataForm: {
|
||||||
username: 'admin',
|
username: 'admin',
|
||||||
password: 'admin',
|
password: 'admin',
|
||||||
uuid: '',
|
uuid: ''
|
||||||
// captcha: ''
|
// captcha: ''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
dataRule () {
|
dataRule() {
|
||||||
return {
|
return {
|
||||||
username: [
|
username: [{ required: true, message: this.$t('validate.required'), trigger: 'blur' }],
|
||||||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
|
password: [{ required: true, message: this.$t('validate.required'), trigger: 'blur' }]
|
||||||
],
|
// captcha: [
|
||||||
password: [
|
// { required: true, message: this.$t('validate.required'), trigger: 'blur' }
|
||||||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
|
// ]
|
||||||
],
|
}
|
||||||
// captcha: [
|
}
|
||||||
// { required: true, message: this.$t('validate.required'), trigger: 'blur' }
|
},
|
||||||
// ]
|
created() {
|
||||||
}
|
// this.getCaptcha()
|
||||||
}
|
},
|
||||||
},
|
methods: {
|
||||||
created () {
|
// 获取验证码
|
||||||
// this.getCaptcha()
|
getCaptcha() {
|
||||||
},
|
this.dataForm.uuid = getUUID()
|
||||||
methods: {
|
this.captchaPath = `${window.SITE_CONFIG['apiURL']}/captcha?uuid=${this.dataForm.uuid}`
|
||||||
// 获取验证码
|
},
|
||||||
getCaptcha () {
|
// 表单提交
|
||||||
this.dataForm.uuid = getUUID()
|
dataFormSubmitHandle: debounce(
|
||||||
this.captchaPath = `${window.SITE_CONFIG['apiURL']}/captcha?uuid=${this.dataForm.uuid}`
|
function() {
|
||||||
},
|
this.$refs['dataForm'].validate(valid => {
|
||||||
// 表单提交
|
if (!valid) {
|
||||||
dataFormSubmitHandle: debounce(function () {
|
return false
|
||||||
this.$refs['dataForm'].validate((valid) => {
|
}
|
||||||
if (!valid) {
|
this.$http
|
||||||
return false
|
.post(this.$http.adornUrl('/login'), this.dataForm)
|
||||||
}
|
.then(({ data: res }) => {
|
||||||
this.$http.post(this.$http.adornUrl('/login'), this.dataForm).then(({ data: res }) => {
|
if (res.code !== 200) {
|
||||||
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)
|
this.$router.replace({ name: 'home' })
|
||||||
this.$router.replace({ name: 'home' })
|
})
|
||||||
}).catch(() => {})
|
.catch(() => {})
|
||||||
})
|
})
|
||||||
}, 1000, { 'leading': true, 'trailing': false })
|
},
|
||||||
}
|
1000,
|
||||||
|
{ leading: true, trailing: false }
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
Reference in New Issue
Block a user