This commit is contained in:
molong
2022-10-18 21:09:17 +08:00
parent 96319f0898
commit f8927e3193
15 changed files with 2041 additions and 146 deletions

View File

@@ -3,7 +3,7 @@ import http from "@/utils/request"
export default {
upload: {
url: `${config.API_URL}file/upload`,
url: `${config.API_URL}system/file/upload`,
name: "文件上传",
post: async function(data, config={}){
return await http.post(this.url, data, config);

View File

@@ -12,7 +12,7 @@ const DEFAULT_CONFIG = {
CORE_VER: "1.6.6",
//接口地址
API_URL: "http://211.149.201.113:88/",
API_URL: "http://127.0.0.1:8000/",
//请求超时
TIMEOUT: 10000,

View File

@@ -47,7 +47,7 @@
</div>
<el-dropdown class="user panel-item" trigger="click" @command="handleUser">
<div class="user-avatar">
<el-avatar :size="30">{{ userNameF }}</el-avatar>
<el-avatar :src="userInfo.avatar" :size="30">{{ userNameF }}</el-avatar>
<label>{{ userName }}</label>
<el-icon class="el-icon--right"><el-icon-arrow-down /></el-icon>
</div>
@@ -82,6 +82,7 @@
},
data(){
return {
userInfo: {},
userName: "",
userNameF: "",
searchVisible: false,
@@ -119,8 +120,8 @@
}
},
created() {
var userInfo = this.$TOOL.data.get("USER_INFO");
this.userName = userInfo.username;
this.userInfo = this.$TOOL.data.get("USER_INFO");
this.userName = this.userInfo.username;
this.userNameF = this.userName.substring(0,1);
},
methods: {

View File

@@ -185,6 +185,7 @@
//表单注入数据
setData(data, pid){
this.form = data
this.form.sort = parseInt(this.form.sort);
this.form.apiList = data.apiList || []
this.form.parent_id = pid
}

View File

@@ -27,11 +27,11 @@
data(){
return {
pageLoading: true,
dashboard: '1'
dashboard: '0'
}
},
created(){
this.dashboard = this.$TOOL.data.get("USER_INFO").dashboard || '1';
this.dashboard = this.$TOOL.data.get("USER_INFO").dashboard || '0';
},
mounted(){

View File

@@ -2,7 +2,7 @@
<el-card shadow="never" header="个人信息">
<el-form ref="form" :rules="rules" :model="form" label-width="120px" style="margin-top:20px;">
<el-form-item label="头像">
<sc-upload v-model="form.avatar" title="头像上传" :cropper="true" :compress="1" :aspectRatio="1/1"></sc-upload>
<sc-upload v-model="form.avatar" :data="{type: 'avatar'}" title="头像上传" :cropper="true" :compress="1" :aspectRatio="1/1"></sc-upload>
</el-form-item>
<el-form-item label="账号">
<el-input v-model="form.username" disabled></el-input>
@@ -36,6 +36,7 @@ export default {
data() {
return {
form: {
avatar: '',
username: "admin",
nickname: "Sakuya",
email: "",
@@ -59,7 +60,7 @@ export default {
async getUserInfo(){
let res = await this.$API.user.userinfo.get();
if(res.code == 1){
this.form = {username: res.data.username, nickname: res.data.nickname, email: res.data.email, sex: res.data.sex, about: res.data.about, uid: res.data.uid}
this.form = {avatar: res.data.avatar,username: res.data.username, nickname: res.data.nickname, email: res.data.email, sex: res.data.sex, about: res.data.about, uid: res.data.uid}
}
},
async submit(){