Commit 11106b7d authored by 李苏's avatar 李苏 💬

头像

parent 18dc1f16
...@@ -16,8 +16,9 @@ ...@@ -16,8 +16,9 @@
</template> </template>
<el-dropdown class="avatar-container right-menu-item hover-effect" trigger="click"> <el-dropdown class="avatar-container right-menu-item hover-effect" trigger="click">
<div class="avatar-wrapper"> <div class="avatar-wrapper">
<img :src="'https://p9-passport.byteacctimg.com/img/user-avatar/9e20870d6d673cafe6a0e22aa2f2aa96~300x300.image'" class="user-avatar"> <el-avatar> {{user}} </el-avatar>
<!-- <img :src="'https://p9-passport.byteacctimg.com/img/user-avatar/9e20870d6d673cafe6a0e22aa2f2aa96~300x300.image'" class="user-avatar"> -->
<i class="el-icon-caret-bottom" /> <i class="el-icon-caret-bottom" />
</div> </div>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
...@@ -58,6 +59,14 @@ export default { ...@@ -58,6 +59,14 @@ export default {
RuoYiGit, RuoYiGit,
RuoYiDoc RuoYiDoc
}, },
mounted(){
this.user=localStorage.getItem('username')||'用户'
},
data(){
return{
user:'用户'
}
},
computed: { computed: {
...mapGetters([ ...mapGetters([
'sidebar', 'sidebar',
......
import Vue from 'vue' import Vue from 'vue'
/* 引入公用UI插件 */ /* 引入公用UI插件 */
import Element from 'element-ui' import Element from 'element-ui'
import Cookies from 'js-cookie' import Cookies from 'js-cookie'
import './assets/styles/element-variables.scss' import './assets/styles/element-variables.scss'
import '@/assets/styles/index.scss' // global css import '@/assets/styles/index.scss' // global css
import '@/assets/styles/ruoyi.scss' // ruoyi css import '@/assets/styles/ruoyi.scss' // ruoyi css
import store from './store' import store from './store'
import router from './router' import router from './router'
import plugins from './plugins' // plugins import plugins from './plugins' // plugins
/* 引入公用主页面 */ /* 引入公用主页面 */
import {App} from 'common' import {App} from 'common'
/* 注册common */ /* 注册common */
import framework from "common" import framework from "common"
import { import {
download download
} from '@/utils/request' } from '@/utils/request'
import './assets/icons' // icon
import './permission' // permission control
import {
getDicts
} from "@/api/system/dict/data";
import {
getConfigKey
} from "@/api/system/config";
import {
parseTime,
resetForm,
addDateRange,
selectDictLabel,
selectDictLabels,
handleTree
} from "@/utils/ruoyi";
// 分页组件
import Pagination from "@/components/Pagination";
// 自定义表格工具组件
import RightToolbar from "@/components/RightToolbar"
// 富文本组件
import Editor from "@/components/Editor"
// 文件上传组件
import FileUpload from "@/components/FileUpload"
// 图片上传组件
import ImageUpload from "@/components/ImageUpload"
// 图片预览组件
import ImagePreview from "@/components/ImagePreview"
// 字典标签组件
import DictTag from '@/components/DictTag'
// 头部标签组件
import VueMeta from 'vue-meta'
// 字典数据组件
import DictData from '@/components/DictData'
import './assets/icons' // icon
import './permission' // permission control
import {
getDicts
} from "@/api/system/dict/data";
import {
getConfigKey
} from "@/api/system/config";
import {
parseTime,
resetForm,
addDateRange,
selectDictLabel,
selectDictLabels,
handleTree
} from "@/utils/ruoyi";
// 分页组件
import Pagination from "@/components/Pagination";
// 自定义表格工具组件
import RightToolbar from "@/components/RightToolbar"
// 富文本组件
import Editor from "@/components/Editor"
// 文件上传组件
import FileUpload from "@/components/FileUpload"
// 图片上传组件
import ImageUpload from "@/components/ImageUpload"
// 图片预览组件
import ImagePreview from "@/components/ImagePreview"
// 字典标签组件
import DictTag from '@/components/DictTag'
// 头部标签组件
import VueMeta from 'vue-meta'
// 字典数据组件
import DictData from '@/components/DictData'
/* */
/* */
// 全局方法挂载
Vue.prototype.getDicts = getDicts // 全局方法挂载
Vue.prototype.getConfigKey = getConfigKey Vue.prototype.getDicts = getDicts
Vue.prototype.parseTime = parseTime Vue.prototype.getConfigKey = getConfigKey
Vue.prototype.resetForm = resetForm Vue.prototype.parseTime = parseTime
Vue.prototype.addDateRange = addDateRange Vue.prototype.resetForm = resetForm
Vue.prototype.selectDictLabel = selectDictLabel Vue.prototype.addDateRange = addDateRange
Vue.prototype.selectDictLabels = selectDictLabels Vue.prototype.selectDictLabel = selectDictLabel
Vue.prototype.download = download Vue.prototype.selectDictLabels = selectDictLabels
Vue.prototype.handleTree = handleTree Vue.prototype.download = download
Vue.prototype.handleTree = handleTree
// 全局组件挂载
Vue.component('DictTag', DictTag) // 全局组件挂载
Vue.component('Pagination', Pagination) Vue.component('DictTag', DictTag)
Vue.component('RightToolbar', RightToolbar) Vue.component('Pagination', Pagination)
Vue.component('Editor', Editor) Vue.component('RightToolbar', RightToolbar)
Vue.component('FileUpload', FileUpload) Vue.component('Editor', Editor)
Vue.component('ImageUpload', ImageUpload) Vue.component('FileUpload', FileUpload)
Vue.component('ImageUpload', ImageUpload)
Vue.component('ImagePreview', ImagePreview) Vue.component('ImagePreview', ImagePreview)
Vue.use(framework) Vue.use(framework)
Vue.use(plugins) Vue.use(plugins)
Vue.use(VueMeta) Vue.use(VueMeta)
DictData.install() DictData.install()
/** /**
* If you don't want to use mock-server * If you don't want to use mock-server
* you want to use MockJs for mock api * you want to use MockJs for mock api
* you can execute: mockXHR() * you can execute: mockXHR()
* *
* Currently MockJs will be used in the production environment, * Currently MockJs will be used in the production environment,
* please remove it before going online! ! ! * please remove it before going online! ! !
*/ */
Vue.use(Element, { Vue.use(Element, {
size: Cookies.get('size') || 'medium' // set element-ui default size size: Cookies.get('size') || 'medium' // set element-ui default size
}) })
/* */ /* */
Vue.prototype.$asyncRun = (arr, fn) => { Vue.prototype.$asyncRun = (arr, fn) => {
if (!arr || !fn) { if (!arr || !fn) {
console.warn('$asyncRun方法参数必填') console.warn('$asyncRun方法参数必填')
return return
} }
let isArray = arr instanceof Array let isArray = arr instanceof Array
let isFn = fn instanceof Function let isFn = fn instanceof Function
if (isArray && isFn) { if (isArray && isFn) {
return Promise.all(arr).then(fn) return Promise.all(arr).then(fn)
} else { } else {
console.warn('$asyncRun方法参数1需要数组,参数2为回调方法') console.warn('$asyncRun方法参数1需要数组,参数2为回调方法')
} }
} }
Vue.prototype.$asRun = function() { Vue.prototype.$asRun = function() {
let csArr = [] let csArr = []
let fnArr = [] let fnArr = []
let length = arguments.length let length = arguments.length
for (let i = 0; i < length; i++) { for (let i = 0; i < length; i++) {
let arr = arguments[i] let arr = arguments[i]
csArr.push(arr[0]) csArr.push(arr[0])
fnArr.push(arr[1]) fnArr.push(arr[1])
} }
return Promise.all(csArr).then(e => { return Promise.all(csArr).then(e => {
for (let i = 0; i < length; i++) { for (let i = 0; i < length; i++) {
fnArr[i](e[i]) fnArr[i](e[i])
} }
}) }
} )
/* alert */
Vue.prototype.$warning = function(text) { }
var text = text || '警告' /* alert */
this.$message({ showClose: true, message: text, type: 'warning' Vue.prototype.$warning = function(text) {
}); var text = text || '警告'
} this.$message({ showClose: true, message: text,
Vue.prototype.$success = function(text) { type: 'warning'
var text = text || 'no info' });
this.$message({ showClose: true, message: text, type: 'success' }
}); Vue.prototype.$success = function(text) {
} var text = text || 'no info'
Vue.prototype.$error = function(text) { this.$message({ showClose: true, message: text, type: 'success'
var text = text || 'no info' });
this.$message({ showClose: true, message: text, type: 'error' }
}); Vue.prototype.$error = function(text) {
} var text = text || 'no info'
this.$message({ showClose: true,
message: text,
Vue.config.productionTip = false type: 'error'
});
new Vue({ }
el: '#app',
router,
store, Vue.config.productionTip = false
render: h => h(App)
new Vue({
el: '#app',
router,
store,
render:function(h){
return h(App)
}
}) })
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment