master
veypi 9 months ago
parent ad1584b756
commit 7739626284

@ -100,7 +100,6 @@ async fn handle_file(req: &DavRequest, stat: web::Data<AppState>) -> Result<Stri
let mut c = crypto::md5::Md5::new(); let mut c = crypto::md5::Md5::new();
let rs: String = credentials.user_id.chars().rev().collect(); let rs: String = credentials.user_id.chars().rev().collect();
c.input_str(&rs); c.input_str(&rs);
info!("{}|{}|{}", rs, c.result_str(), credentials.password);
if c.result_str() == credentials.password { if c.result_str() == credentials.password {
return Ok(format!("user/{}/", u.id)); return Ok(format!("user/{}/", u.id));
} }

@ -46,8 +46,8 @@
<q-footer style="z-index: 1;" bordered class="bg-grey-8 text-white flex justify-around"> <q-footer style="z-index: 1;" bordered class="bg-grey-8 text-white flex justify-around">
<span class="hover:text-black cursor-pointer" @click="$router.push({ name: 'doc' })">关于OA</span> <span class="hover:text-black cursor-pointer" @click="$router.push({ name: 'doc' })">关于OA</span>
<span class="hover:text-black cursor-pointer" @click="$router.push({ name: 'doc' })">使用须知</span> <span class="hover:text-black cursor-pointer" @click="$router.push({ name: 'doc' })">使用须知</span>
<span class="hover:text-black cursor-pointer" @click="util.goto('https://veypi.com')"> <span class="hover:text-black cursor-pointer">
©2021 veypi @v1.1.2
</span> </span>
</q-footer> </q-footer>

@ -35,7 +35,7 @@ const tmp_router = (title: string, icon: string, path: string, com:
} }
} }
let uniqueLinks: { [key: string]: [MenuLink] } = { let uniqueLinks: { [key: string]: [MenuLink] } = {
[cfg.id]: [tmp_router('系统信息', 'v-data-view', 'oasys', 'oasys')] // [cfg.id]: [tmp_router('系统信息', 'v-data-view', 'oasys', 'oasys')]
} }
const defaultLinks: MenuLink[] = [ const defaultLinks: MenuLink[] = [
@ -45,33 +45,33 @@ const defaultLinks: MenuLink[] = [
icon: 'v-apps', icon: 'v-apps',
to: { name: 'home' } to: { name: 'home' }
}, },
{ // {
title: '文件管理', // title: '文件管理',
caption: '', // caption: '',
icon: 'v-folder', // icon: 'v-folder',
to: { name: 'fs' } // to: { name: 'fs' }
}, // },
{ {
title: '账号设置', title: '账号设置',
icon: 'v-user', icon: 'v-user',
to: { name: 'user' } to: { name: 'user' }
}, },
{ // {
title: '系统监控', // title: '系统监控',
icon: 'v-data-view', // icon: 'v-data-view',
to: { name: 'stats' } // to: { name: 'stats' }
}, // },
{ {
title: '文档中心', title: '文档中心',
icon: 'v-file-exception', icon: 'v-file-exception',
to: { name: 'doc' } to: { name: 'doc' }
}, },
{ // {
title: '设置', // title: '设置',
caption: '', // caption: '',
icon: 'v-setting', // icon: 'v-setting',
to: { name: 'settings' } // to: { name: 'settings' }
}, // },
] ]
const items = ref(defaultLinks) const items = ref(defaultLinks)

@ -31,6 +31,12 @@
</q-popup-edit> </q-popup-edit>
</q-td> </q-td>
</template> </template>
<template #body-cell-action="props">
<q-td :props="props">
<q-btn v-if='cfg.id === app.id' size='sm' color='secondary' @click='reset(props.row.id)'>重置密码</q-btn>
</q-td>
</template>
</q-table> </q-table>
</div> </div>
</template> </template>
@ -41,6 +47,7 @@ import { AUStatus, modelsAppUser, modelsUser, modelsApp } from 'src/models';
import api from 'src/boot/api'; import api from 'src/boot/api';
import msg from '@veypi/msg'; import msg from '@veypi/msg';
import { util } from 'src/libs'; import { util } from 'src/libs';
import cfg from 'src/cfg';
const auOpts: { [index: number]: any } = { const auOpts: { [index: number]: any } = {
[AUStatus.OK]: ['正常', 'positive'], [AUStatus.OK]: ['正常', 'positive'],
@ -83,6 +90,9 @@ const update_status = (id: string, n: number, old: number) => {
console.log([id, n, old]) console.log([id, n, old])
} }
const reset = (id: string) => {
}
const sync = () => { const sync = () => {
if (!app.value.id) { if (!app.value.id) {
return return

@ -18,8 +18,30 @@
</uploader> </uploader>
</div> </div>
</template> </template>
<template #k_pass>
<q-btn @click="prompt = true" size='sm' color='secondary'>修改</q-btn>
</template>
</crud> </crud>
</div> </div>
<q-dialog v-model="prompt" persistent>
<q-card style="min-width: 350px">
<q-card-section>
<div class="text-h6">请输入新密码</div>
</q-card-section>
<q-card-section class="q-pt-none">
<q-input type='password' dense v-model="pass[0]" autofocus @keyup.enter="prompt = false">
</q-input>
<q-input type='password' dense v-model="pass[1]" autofocus @keyup.enter="prompt = false">
</q-input>
</q-card-section>
<q-card-actions align="right" class="text-primary">
<q-btn flat label="取消" v-close-popup />
<q-btn flat label="确定" @click="reset" v-close-popup />
</q-card-actions>
</q-card>
</q-dialog>
<div v-if="newData" class="flex justify-center gap-8 mt-6"> <div v-if="newData" class="flex justify-center gap-8 mt-6">
<q-btn color="brown-5" label="回退" @click="table.reload" /> <q-btn color="brown-5" label="回退" @click="table.reload" />
@ -35,11 +57,13 @@ import crud from 'src/components/crud.vue';
import uploader from 'src/components/uploader'; import uploader from 'src/components/uploader';
import { useUserStore } from 'src/stores/user'; import { useUserStore } from 'src/stores/user';
import { ref } from 'vue'; import { ref } from 'vue';
let prompt = ref(false)
let u = useUserStore() let u = useUserStore()
let table = ref() let table = ref()
const keys = ref<any>([ const keys = ref<any>([
{ name: 'id', label: 'ID', editable: false }, { name: 'id', label: 'ID', editable: false },
{ name: 'username', label: '用户名' }, { name: 'username', label: '用户名' },
{ name: 'pass', label: '密码' },
{ name: 'nickname', label: '昵称' }, { name: 'nickname', label: '昵称' },
{ name: 'icon', label: 'logo' }, { name: 'icon', label: 'logo' },
{ name: 'email', label: '邮箱' }, { name: 'email', label: '邮箱' },
@ -56,6 +80,17 @@ const save = () => {
msg.Warn('更新失败 ' + e) msg.Warn('更新失败 ' + e)
}) })
} }
let pass = ref(['', ''])
const reset = () => {
if (pass.value[0] == '' || pass.value[1] == '') {
msg.Warn('密码不能为空')
return
}
if (pass.value[0] != pass.value[1]) {
msg.Warn('两次密码不一致')
return
}
}
</script> </script>
<style scoped></style> <style scoped></style>

Loading…
Cancel
Save