修改登录页面信息

This commit is contained in:
izory 2021-09-26 17:01:52 +08:00
parent 59911ece6e
commit 92071f41f7
3 changed files with 22 additions and 22 deletions

View File

@ -1,4 +1,5 @@
using Infrastructure; using Infrastructure;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;
@ -13,10 +14,11 @@ namespace ZR.Admin.WebApi.Controllers
{ {
private NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger(); private NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();
private OptionsSetting OptionsSetting; private OptionsSetting OptionsSetting;
private IWebHostEnvironment WebHostEnvironment;
public UploadController(IOptions<OptionsSetting> optionsSetting) public UploadController(IOptions<OptionsSetting> optionsSetting, IWebHostEnvironment webHostEnvironment)
{ {
OptionsSetting = optionsSetting.Value; OptionsSetting = optionsSetting.Value;
WebHostEnvironment = webHostEnvironment;
} }
/// <summary> /// <summary>
/// 存储文件 /// 存储文件
@ -28,7 +30,7 @@ namespace ZR.Admin.WebApi.Controllers
{ {
if (formFile == null) throw new CustomException(ResultCode.PARAM_ERROR, "上传图片不能为空"); if (formFile == null) throw new CustomException(ResultCode.PARAM_ERROR, "上传图片不能为空");
string fileExt = Path.GetExtension(formFile.FileName); string fileExt = Path.GetExtension(formFile.FileName);
string savePath = Path.Combine("wwwroot", FileUtil.GetdirPath("uploads")); string savePath = Path.Combine(WebHostEnvironment.WebRootPath, FileUtil.GetdirPath("uploads"));
if (!Directory.Exists(savePath)) { Directory.CreateDirectory(savePath); } if (!Directory.Exists(savePath)) { Directory.CreateDirectory(savePath); }

View File

@ -9,7 +9,7 @@
<script> <script>
const version = require('element-ui/package.json').version // element-ui version from node_modules const version = require('element-ui/package.json').version // element-ui version from node_modules
const ORIGINAL_THEME = '#13C2C2' // default color const ORIGINAL_THEME = '#409EFF' // default color
export default { export default {
data() { data() {
@ -31,19 +31,21 @@ export default {
immediate: true immediate: true
}, },
async theme(val) { async theme(val) {
await this.setTheme(val)
}
},
created() {
if(this.defaultTheme !== ORIGINAL_THEME) {
this.setTheme(this.defaultTheme)
}
},
methods: {
async setTheme(val) {
const oldVal = this.chalk ? this.theme : ORIGINAL_THEME const oldVal = this.chalk ? this.theme : ORIGINAL_THEME
if (typeof val !== 'string') return if (typeof val !== 'string') return
const themeCluster = this.getThemeCluster(val.replace('#', '')) const themeCluster = this.getThemeCluster(val.replace('#', ''))
const originalCluster = this.getThemeCluster(oldVal.replace('#', '')) const originalCluster = this.getThemeCluster(oldVal.replace('#', ''))
console.log(themeCluster, originalCluster)
const $message = this.$message({
message: ' Compiling the theme',
customClass: 'theme-message',
type: 'success',
duration: 0,
iconClass: 'el-icon-loading'
})
const getHandler = (variable, id) => { const getHandler = (variable, id) => {
return () => { return () => {
@ -81,12 +83,8 @@ export default {
}) })
this.$emit('change', val) this.$emit('change', val)
$message.close()
}
}, },
methods: {
updateStyle(style, oldCluster, newCluster) { updateStyle(style, oldCluster, newCluster) {
let newStyle = style let newStyle = style
oldCluster.forEach((color, index) => { oldCluster.forEach((color, index) => {

View File

@ -1,7 +1,7 @@
<template> <template>
<div class="login"> <div class="login">
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form"> <el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form">
<h3 class="title">ZrAdmin.NET</h3> <h3 class="title">ZrAdmin.NET管理系统</h3>
<el-form-item prop="username"> <el-form-item prop="username">
<el-input v-model="loginForm.username" type="text" auto-complete="off" placeholder="账号"> <el-input v-model="loginForm.username" type="text" auto-complete="off" placeholder="账号">
<svg-icon slot="prefix" icon-class="user" class="el-input__icon input-icon" /> <svg-icon slot="prefix" icon-class="user" class="el-input__icon input-icon" />
@ -29,9 +29,9 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<!-- 底部 --> <!-- 底部 -->
<!-- <div class="el-login-footer"> <div class="el-login-footer">
<span>Copyright © 2018-2020 ruoyi.vip All Rights Reserved.</span> <span>Copyright ©2021 <a href="https://gitee.com/izory/ZrAdminNetCore" target="_black">ZrAdmin.NET</a> All Rights Reserved.</span>
</div> --> </div>
</div> </div>
</template> </template>