Merge branch 'main' of https://github.com/ccnetcore/Yi into main
This commit is contained in:
@@ -1,16 +1,11 @@
|
|||||||
import myaxios from '@/util/myaxios'
|
import myaxios from '@/util/myaxios'
|
||||||
export default {
|
export default {
|
||||||
OnPostUploadImage(file) {
|
Upload(file) {
|
||||||
return myaxios({
|
return myaxios({
|
||||||
url: '/File/OnPostUploadImage',
|
url: '/File/Upload',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
|
headers: { "Content-Type": "multipart/form-data" },
|
||||||
data: file
|
data: file
|
||||||
})
|
})
|
||||||
},
|
|
||||||
getLogs() {
|
|
||||||
return myaxios({
|
|
||||||
url: '/File/GetLogs',
|
|
||||||
method: 'get'
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4,13 +4,13 @@
|
|||||||
v-model="$store.state.home.drawer"
|
v-model="$store.state.home.drawer"
|
||||||
:dark="dark"
|
:dark="dark"
|
||||||
:right="$vuetify.rtl"
|
:right="$vuetify.rtl"
|
||||||
:src="$store.state.home.drawerImage ? image : ''"
|
:src="drawerImage ? image : ''"
|
||||||
:mini-variant.sync="$store.state.home.mini"
|
:mini-variant.sync="$store.state.home.mini"
|
||||||
mini-variant-width="80"
|
mini-variant-width="80"
|
||||||
app
|
app
|
||||||
width="260"
|
width="260"
|
||||||
>
|
>
|
||||||
<template v-if="$store.state.home.drawerImage" #img="props">
|
<template v-if="drawerImage" #img="props">
|
||||||
<v-img :key="image" :gradient="gradient" v-bind="props" />
|
<v-img :key="image" :gradient="gradient" v-bind="props" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -49,28 +49,41 @@
|
|||||||
<script>
|
<script>
|
||||||
// Utilities
|
// Utilities
|
||||||
// import { get, sync } from 'vuex-pathify'
|
// import { get, sync } from 'vuex-pathify'
|
||||||
import userApi from '@/api/userApi'
|
import userApi from "@/api/userApi";
|
||||||
export default {
|
export default {
|
||||||
methods: {
|
methods: {
|
||||||
init(){
|
init() {
|
||||||
userApi.GetMenuByHttpUser().then((resp)=>{
|
userApi.GetMenuByHttpUser().then((resp) => {
|
||||||
this.items=resp.data.children;
|
this.items = resp.data.children;
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
logout() {
|
logout() {
|
||||||
this.$store.dispatch("Logout").then((resp) => {
|
this.$store.dispatch("Logout").then((resp) => {
|
||||||
this.$router.push({ path: "/login" });
|
this.$router.push({ path: "/login" });
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
created(){this.init()},
|
created() {
|
||||||
|
this.init();
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
image() {
|
||||||
|
return this.$store.getters.image;
|
||||||
|
},
|
||||||
|
gradient() {
|
||||||
|
return this.$store.getters.gradient;
|
||||||
|
},
|
||||||
|
drawerImage()
|
||||||
|
{
|
||||||
|
return this.$store.state.home.drawerImage;
|
||||||
|
},
|
||||||
|
dark()
|
||||||
|
{
|
||||||
|
return this.$store.state.user.dark;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
data: () => ({
|
data: () => ({
|
||||||
image:
|
|
||||||
"https://demos.creative-tim.com/material-dashboard-pro/assets/img/sidebar-1.jpg",
|
|
||||||
|
|
||||||
gradient: "rgba(228, 226, 226, 1), rgba(255, 255, 255, 0.7)",
|
|
||||||
|
|
||||||
dark: null,
|
|
||||||
|
|
||||||
items: [],
|
items: [],
|
||||||
}),
|
}),
|
||||||
@@ -88,7 +101,6 @@ export default {
|
|||||||
"./List"
|
"./List"
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
|
||||||
// computed: {
|
// computed: {
|
||||||
// ...get('user', [
|
// ...get('user', [
|
||||||
// 'dark',
|
// 'dark',
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
>
|
>
|
||||||
<v-card class="text-center mb-0" width="300">
|
<v-card class="text-center mb-0" width="300">
|
||||||
<v-card-text>
|
<v-card-text>
|
||||||
<strong class="mb-3 d-inline-block">SIDEBAR FILTERS</strong>
|
<strong class="mb-3 d-inline-block">主题颜色</strong>
|
||||||
|
|
||||||
<v-item-group v-model="color" mandatory>
|
<v-item-group v-model="color" mandatory>
|
||||||
<v-item v-for="color in colors" :key="color" :value="color">
|
<v-item v-for="color in colors" :key="color" :value="color">
|
||||||
@@ -51,7 +51,7 @@
|
|||||||
|
|
||||||
<v-divider class="my-4 secondary" />
|
<v-divider class="my-4 secondary" />
|
||||||
|
|
||||||
<strong class="mb-3 d-inline-block">SIDEBAR BACKGROUND</strong>
|
<strong class="mb-3 d-inline-block">图层颜色</strong>
|
||||||
|
|
||||||
<v-item-group v-model="gradient" mandatory>
|
<v-item-group v-model="gradient" mandatory>
|
||||||
<v-item
|
<v-item
|
||||||
@@ -75,7 +75,7 @@
|
|||||||
<v-divider class="my-4 secondary" />
|
<v-divider class="my-4 secondary" />
|
||||||
|
|
||||||
<v-row align="center" no-gutters>
|
<v-row align="center" no-gutters>
|
||||||
<v-col cols="auto"> Dark Mode </v-col>
|
<v-col cols="auto"> 主题模式 </v-col>
|
||||||
|
|
||||||
<v-spacer />
|
<v-spacer />
|
||||||
|
|
||||||
@@ -92,7 +92,7 @@
|
|||||||
<v-divider class="my-4 secondary" />
|
<v-divider class="my-4 secondary" />
|
||||||
|
|
||||||
<v-row align="center" no-gutters>
|
<v-row align="center" no-gutters>
|
||||||
<v-col cols="auto"> Sidebar Mini </v-col>
|
<v-col cols="auto"> 迷你菜单 </v-col>
|
||||||
|
|
||||||
<v-spacer />
|
<v-spacer />
|
||||||
|
|
||||||
@@ -109,7 +109,7 @@
|
|||||||
<v-divider class="my-4 secondary" />
|
<v-divider class="my-4 secondary" />
|
||||||
|
|
||||||
<v-row align="center" no-gutters>
|
<v-row align="center" no-gutters>
|
||||||
<v-col cols="auto"> Sidebar Image </v-col>
|
<v-col cols="auto"> 图片菜单 </v-col>
|
||||||
|
|
||||||
<v-spacer />
|
<v-spacer />
|
||||||
|
|
||||||
@@ -125,7 +125,7 @@
|
|||||||
|
|
||||||
<v-divider class="my-4 secondary" />
|
<v-divider class="my-4 secondary" />
|
||||||
|
|
||||||
<strong class="mb-3 d-inline-block">IMAGES</strong>
|
<strong class="mb-3 d-inline-block">图片</strong>
|
||||||
|
|
||||||
<v-card :disabled="!drawerImage" flat>
|
<v-card :disabled="!drawerImage" flat>
|
||||||
<v-item-group
|
<v-item-group
|
||||||
@@ -156,27 +156,27 @@
|
|||||||
class="mb-3"
|
class="mb-3"
|
||||||
color="grey darken-1"
|
color="grey darken-1"
|
||||||
dark
|
dark
|
||||||
href="https://vuetifyjs.com/components/api-explorer"
|
href="https://github.com/ccnetcore/yi"
|
||||||
rel="noopener"
|
rel="noopener"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
>
|
>
|
||||||
Vuetify Documentation
|
Github 地址
|
||||||
</v-btn>
|
</v-btn>
|
||||||
|
|
||||||
<v-btn
|
<v-btn
|
||||||
block
|
block
|
||||||
color="info"
|
color="info"
|
||||||
href="https://store.vuetifyjs.com/products/vuetify-material-dashboard-free"
|
href="https://ccnetcore.com"
|
||||||
rel="noopener"
|
rel="noopener"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
>
|
>
|
||||||
Get Free Demo
|
加入我们
|
||||||
</v-btn>
|
</v-btn>
|
||||||
|
|
||||||
<div class="my-12" />
|
<div class="my-12" />
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<strong class="mb-3 d-inline-block">THANK YOU FOR SHARING!</strong>
|
<strong class="mb-3 d-inline-block">感谢你的支持!</strong>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<v-btn class="ma-1" color="#55acee" dark rounded>
|
<v-btn class="ma-1" color="#55acee" dark rounded>
|
||||||
@@ -205,28 +205,56 @@ export default {
|
|||||||
name: "DashboardCoreSettings",
|
name: "DashboardCoreSettings",
|
||||||
|
|
||||||
mixins: [Proxyable],
|
mixins: [Proxyable],
|
||||||
|
computed: {
|
||||||
|
|
||||||
|
|
||||||
|
gradients(){
|
||||||
|
return this.$store.state.user.gradients},
|
||||||
|
image:{
|
||||||
|
get(){
|
||||||
|
return this.$store.state.user.drawer.image;
|
||||||
|
},
|
||||||
|
set(value){
|
||||||
|
this.$store.commit('SetImage',value)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
gradient:{
|
||||||
|
get(){
|
||||||
|
return this.$store.state.user.drawer.gradient;
|
||||||
|
},
|
||||||
|
set(value){
|
||||||
|
this.$store.commit('SetGradient',value)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
images()
|
||||||
|
{
|
||||||
|
return this.$store.state.user.images;
|
||||||
|
},
|
||||||
|
drawerImage:
|
||||||
|
{
|
||||||
|
get(){
|
||||||
|
return this.$store.state.home.drawerImage;
|
||||||
|
},
|
||||||
|
set(value){
|
||||||
|
this.$store.commit('SetDrawerImage',value)
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
dark()
|
||||||
|
{
|
||||||
|
return this.$store.state.user.dark;
|
||||||
|
},
|
||||||
|
drawer()
|
||||||
|
{
|
||||||
|
return this.$store.state.home.drawer;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
data: () => ({
|
data: () => ({
|
||||||
image:
|
|
||||||
"https://demos.creative-tim.com/material-dashboard-pro/assets/img/sidebar-1.jpg",
|
|
||||||
drawer: null,
|
|
||||||
drawerImage: true,
|
|
||||||
gradient: "rgba(228, 226, 226, 1), rgba(255, 255, 255, 0.7)",
|
|
||||||
images: [
|
|
||||||
"https://demos.creative-tim.com/material-dashboard-pro/assets/img/sidebar-1.jpg",
|
|
||||||
"https://demos.creative-tim.com/material-dashboard-pro/assets/img/sidebar-2.jpg",
|
|
||||||
"https://demos.creative-tim.com/material-dashboard-pro/assets/img/sidebar-3.jpg",
|
|
||||||
"https://demos.creative-tim.com/material-dashboard-pro/assets/img/sidebar-4.jpg",
|
|
||||||
],
|
|
||||||
gradients: [
|
|
||||||
"rgba(0, 0, 0, .7), rgba(0, 0, 0, .7)",
|
|
||||||
"rgba(228, 226, 226, 1), rgba(255, 255, 255, 0.7)",
|
|
||||||
"rgba(244, 67, 54, .8), rgba(244, 67, 54, .8)",
|
|
||||||
],
|
|
||||||
dark: null,
|
|
||||||
|
|
||||||
color: "#E91E63",
|
color: "#E91E63",
|
||||||
colors: ["#9C27b0", "#00CAE3", "#4CAF50", "#ff9800", "#E91E63", "#FF5252"],
|
colors: ["#9C27b0", "#00CAE3", "#4CAF50", "#ff9800", "#E91E63", "#FF5252"],
|
||||||
menu: false,
|
menu: false,
|
||||||
@@ -251,7 +279,10 @@ export default {
|
|||||||
|
|
||||||
watch: {
|
watch: {
|
||||||
color(val) {
|
color(val) {
|
||||||
|
|
||||||
this.$vuetify.theme.themes[this.isDark ? "dark" : "light"].primary = val;
|
this.$vuetify.theme.themes[this.isDark ? "dark" : "light"].primary = val;
|
||||||
|
this.$vuetify.theme.dark=true;
|
||||||
|
this.$vuetify.theme.dark=false;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -15,7 +15,17 @@
|
|||||||
v-bind="attrs"
|
v-bind="attrs"
|
||||||
v-on="on"
|
v-on="on"
|
||||||
>
|
>
|
||||||
<v-icon>mdi-account</v-icon>
|
<!-- <v-icon>mdi-account</v-icon> -->
|
||||||
|
<v-avatar size="36" class="elevation-2">
|
||||||
|
<!-- <img src="https://z3.ax1x.com/2021/05/09/gJadhD.jpg" /> -->
|
||||||
|
<img
|
||||||
|
:src="
|
||||||
|
baseurl +
|
||||||
|
'/File/ShowNoticeImg?filePath=' +
|
||||||
|
$store.state.user.user.icon
|
||||||
|
"
|
||||||
|
/>
|
||||||
|
</v-avatar>
|
||||||
</v-btn>
|
</v-btn>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -24,6 +34,12 @@
|
|||||||
flat
|
flat
|
||||||
nav
|
nav
|
||||||
>
|
>
|
||||||
|
|
||||||
|
<app-bar-item to="/"><v-list-item-title v-text="'用户名:橙子'" /></app-bar-item>
|
||||||
|
<app-bar-item to="/"><v-list-item-title v-text="'称号:橙子'" /></app-bar-item>
|
||||||
|
|
||||||
|
<v-divider class="mb-2 mt-2"/>
|
||||||
|
|
||||||
<template v-for="(p, i) in profile">
|
<template v-for="(p, i) in profile">
|
||||||
<v-divider
|
<v-divider
|
||||||
v-if="p.divider"
|
v-if="p.divider"
|
||||||
|
|||||||
@@ -41,6 +41,9 @@ const state = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const mutations = { //变化//载荷
|
const mutations = { //变化//载荷
|
||||||
|
SetDrawerImage(state, drawerImage) {
|
||||||
|
state.drawerImage = drawerImage
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//在action中可以配合axios进行权限判断
|
//在action中可以配合axios进行权限判断
|
||||||
|
|||||||
@@ -17,10 +17,10 @@ const state = { //状态
|
|||||||
'rgba(244, 67, 54, .8), rgba(244, 67, 54, .8)',
|
'rgba(244, 67, 54, .8), rgba(244, 67, 54, .8)',
|
||||||
],
|
],
|
||||||
images: [
|
images: [
|
||||||
'https://demos.creative-tim.com/material-dashboard-pro/assets/img/sidebar-1.jpg',
|
'https://z3.ax1x.com/2021/05/09/gJadhD.jpg',
|
||||||
'https://demos.creative-tim.com/material-dashboard-pro/assets/img/sidebar-2.jpg',
|
'https://z3.ax1x.com/2021/05/09/gJadhD2.jpg',
|
||||||
'https://demos.creative-tim.com/material-dashboard-pro/assets/img/sidebar-3.jpg',
|
'https://z3.ax1x.com/2021/05/09/gJadhD3.jpg',
|
||||||
'https://demos.creative-tim.com/material-dashboard-pro/assets/img/sidebar-4.jpg',
|
'https://z3.ax1x.com/2021/05/09/gJadhD4.jpg',
|
||||||
],
|
],
|
||||||
notifications: [],
|
notifications: [],
|
||||||
rtl: false
|
rtl: false
|
||||||
@@ -34,6 +34,12 @@ const mutations = { //变化//载荷
|
|||||||
SET_USER(state, user) {
|
SET_USER(state, user) {
|
||||||
state.user = user
|
state.user = user
|
||||||
setUser(user)
|
setUser(user)
|
||||||
|
},
|
||||||
|
SetGradient(state, gradient) {
|
||||||
|
state.drawer.gradient = gradient
|
||||||
|
},
|
||||||
|
SetImage(state, image) {
|
||||||
|
state.drawer.image = image
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -17,8 +17,13 @@
|
|||||||
<h4 class="text-h4 mb-3 text--primary">{{ userInfo.nick }}</h4>
|
<h4 class="text-h4 mb-3 text--primary">{{ userInfo.nick }}</h4>
|
||||||
|
|
||||||
<p class="text--secondary">{{ userInfo.introduction }}</p>
|
<p class="text--secondary">{{ userInfo.introduction }}</p>
|
||||||
|
<input
|
||||||
<v-btn class="mr-4" color="primary" min-width="100" rounded>
|
type="file"
|
||||||
|
ref="imgFile"
|
||||||
|
@change="uploadImage()"
|
||||||
|
class="d-none"
|
||||||
|
/>
|
||||||
|
<v-btn class="mr-4" @click="choiceImg" color="primary" min-width="100" rounded>
|
||||||
编辑头像
|
编辑头像
|
||||||
</v-btn>
|
</v-btn>
|
||||||
<v-btn color="primary" min-width="100" rounded> 绑定QQ </v-btn>
|
<v-btn color="primary" min-width="100" rounded> 绑定QQ </v-btn>
|
||||||
@@ -57,17 +62,34 @@
|
|||||||
<div>Account Information</div>
|
<div>Account Information</div>
|
||||||
<v-row>
|
<v-row>
|
||||||
<v-col cols="12" md="4">
|
<v-col cols="12" md="4">
|
||||||
<v-text-field color="purple" label="用户名" v-model="editInfo.username" disabled />
|
<v-text-field
|
||||||
|
color="purple"
|
||||||
|
label="用户名"
|
||||||
|
v-model="editInfo.username"
|
||||||
|
disabled
|
||||||
|
/>
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col cols="12" md="4">
|
<v-col cols="12" md="4">
|
||||||
<v-text-field color="purple" label="昵称" v-model="editInfo.nick" />
|
<v-text-field
|
||||||
|
color="purple"
|
||||||
|
label="昵称"
|
||||||
|
v-model="editInfo.nick"
|
||||||
|
/>
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col cols="12" md="4">
|
<v-col cols="12" md="4">
|
||||||
<v-text-field color="purple" label="邮箱" v-model="editInfo.email"/>
|
<v-text-field
|
||||||
|
color="purple"
|
||||||
|
label="邮箱"
|
||||||
|
v-model="editInfo.email"
|
||||||
|
/>
|
||||||
</v-col>
|
</v-col>
|
||||||
|
|
||||||
<v-col cols="12" md="6">
|
<v-col cols="12" md="6">
|
||||||
<v-text-field color="purple" label="住址" v-model="editInfo.address" />
|
<v-text-field
|
||||||
|
color="purple"
|
||||||
|
label="住址"
|
||||||
|
v-model="editInfo.address"
|
||||||
|
/>
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col cols="12" md="6">
|
<v-col cols="12" md="6">
|
||||||
<v-text-field
|
<v-text-field
|
||||||
@@ -79,7 +101,7 @@
|
|||||||
</v-col>
|
</v-col>
|
||||||
<v-col cols="12">
|
<v-col cols="12">
|
||||||
<v-textarea
|
<v-textarea
|
||||||
v-model="editInfo.introduction"
|
v-model="editInfo.introduction"
|
||||||
color="purple"
|
color="purple"
|
||||||
label="简介"
|
label="简介"
|
||||||
value="空空如也,Ta什么也没有留下"
|
value="空空如也,Ta什么也没有留下"
|
||||||
@@ -135,10 +157,14 @@
|
|||||||
<v-list-item-title>拥有角色:</v-list-item-title>
|
<v-list-item-title>拥有角色:</v-list-item-title>
|
||||||
<v-list-item-subtitle>
|
<v-list-item-subtitle>
|
||||||
<v-row>
|
<v-row>
|
||||||
<v-col
|
<v-col
|
||||||
v-for="item in editInfo.roles"
|
v-for="item in editInfo.roles"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
cols="6" sm="3" md="1">{{item.role_name}}</v-col>
|
cols="6"
|
||||||
|
sm="3"
|
||||||
|
md="1"
|
||||||
|
>{{ item.role_name }}</v-col
|
||||||
|
>
|
||||||
</v-row>
|
</v-row>
|
||||||
</v-list-item-subtitle>
|
</v-list-item-subtitle>
|
||||||
</v-list-item-content>
|
</v-list-item-content>
|
||||||
@@ -150,10 +176,14 @@
|
|||||||
<v-list-item-title>拥有菜单:</v-list-item-title>
|
<v-list-item-title>拥有菜单:</v-list-item-title>
|
||||||
<v-list-item-subtitle>
|
<v-list-item-subtitle>
|
||||||
<v-row>
|
<v-row>
|
||||||
<v-col
|
<v-col
|
||||||
v-for="item in menuInfo"
|
v-for="item in menuInfo"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
cols="6" sm="3" md="1">{{item.menu_name}}</v-col>
|
cols="6"
|
||||||
|
sm="3"
|
||||||
|
md="1"
|
||||||
|
>{{ item.menu_name }}</v-col
|
||||||
|
>
|
||||||
</v-row>
|
</v-row>
|
||||||
</v-list-item-subtitle>
|
</v-list-item-subtitle>
|
||||||
</v-list-item-content>
|
</v-list-item-content>
|
||||||
@@ -224,7 +254,9 @@
|
|||||||
|
|
||||||
<v-col cols="12" class="text-right">
|
<v-col cols="12" class="text-right">
|
||||||
<v-btn color="primary" class="ma-4" min-width="100"> 清空 </v-btn>
|
<v-btn color="primary" class="ma-4" min-width="100"> 清空 </v-btn>
|
||||||
<v-btn color="secondary" @click="save()" min-width="100"> 保存 </v-btn>
|
<v-btn color="secondary" @click="save()" min-width="100">
|
||||||
|
保存
|
||||||
|
</v-btn>
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-form>
|
</v-form>
|
||||||
</material-card>
|
</material-card>
|
||||||
@@ -234,71 +266,79 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import fileApi from "../api/fileApi";
|
||||||
import userApi from "../api/userApi";
|
import userApi from "../api/userApi";
|
||||||
import menuApi from "../api/menuApi";
|
import menuApi from "../api/menuApi";
|
||||||
import accountApi from "../api/accountApi"
|
import accountApi from "../api/accountApi";
|
||||||
export default {
|
export default {
|
||||||
name: "UserProfileView",
|
name: "UserProfileView",
|
||||||
data: () => ({
|
data: () => ({
|
||||||
tab: "tab-1",
|
tab: "tab-1",
|
||||||
userInfo: {},
|
userInfo: {},
|
||||||
editInfo: {},
|
editInfo: {},
|
||||||
newPassword:"",
|
newPassword: "",
|
||||||
dis_newPassword:true,
|
dis_newPassword: true,
|
||||||
menuInfo:[]
|
menuInfo: [],
|
||||||
}),
|
}),
|
||||||
created() {
|
created() {
|
||||||
this.init();
|
this.init();
|
||||||
},
|
},
|
||||||
watch:{
|
watch: {
|
||||||
editInfo:{
|
editInfo: {
|
||||||
handler(val, oldVal){
|
handler(val, oldVal) {
|
||||||
if(val.password.length>0 )
|
if (val.password.length > 0) {
|
||||||
{
|
this.dis_newPassword = false;
|
||||||
this.dis_newPassword=false;
|
} else {
|
||||||
}
|
this.dis_newPassword = true;
|
||||||
else
|
}
|
||||||
{
|
},
|
||||||
this.dis_newPassword=true;
|
deep: true, //true 深度监听
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
deep:true //true 深度监听
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
save()
|
save() {
|
||||||
{
|
accountApi
|
||||||
accountApi.changePassword(this.editInfo,this.newPassword).then(resp=>{
|
.changePassword(this.editInfo, this.newPassword)
|
||||||
if(resp.status)
|
.then((resp) => {
|
||||||
{
|
if (resp.status) {
|
||||||
this.$dialog.notify.error(resp.msg, {
|
this.$dialog.notify.error(resp.msg, {
|
||||||
position: "top-right",
|
position: "top-right",
|
||||||
timeout: 5000,
|
timeout: 5000,
|
||||||
});
|
});
|
||||||
}
|
} else {
|
||||||
else
|
this.$dialog.notify.success(resp.msg, {
|
||||||
{
|
|
||||||
this.$dialog.notify.success(resp.msg, {
|
|
||||||
position: "top-right",
|
position: "top-right",
|
||||||
timeout: 5000,
|
timeout: 5000,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
this.init();
|
this.init();
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
init() {
|
init() {
|
||||||
this.newPassword="";
|
this.newPassword = "";
|
||||||
userApi.GetUserInRolesByHttpUser().then((resp) => {
|
userApi.GetUserInRolesByHttpUser().then((resp) => {
|
||||||
this.userInfo = resp.data;
|
this.userInfo = resp.data;
|
||||||
this.userInfo.password="";
|
this.userInfo.password = "";
|
||||||
this.editInfo= Object.assign({}, this.userInfo);
|
this.editInfo = Object.assign({}, this.userInfo);
|
||||||
});
|
});
|
||||||
|
|
||||||
menuApi.GetTopMenusByHttpUser().then(resp=>{
|
menuApi.GetTopMenusByHttpUser().then((resp) => {
|
||||||
this.menuInfo=resp.data;
|
this.menuInfo = resp.data;
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
|
choiceImg() {
|
||||||
|
this.$refs.imgFile.dispatchEvent(new MouseEvent("click"));
|
||||||
|
},
|
||||||
|
uploadImage() {
|
||||||
|
const file = this.$refs.imgFile.files[0];
|
||||||
|
let formData = new FormData();
|
||||||
|
formData.append("img", file);
|
||||||
|
fileApi.Upload(formData).then(resp=>{
|
||||||
|
this.init();
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user