This commit is contained in:
lzw
2021-10-22 16:49:15 +08:00
13 changed files with 355 additions and 433 deletions

View File

@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Yi.Framework.Core.TaskJob
{
class visitJob
{
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 777 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

BIN
Yi.Vue/src/assets/tree.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

View File

@@ -1,5 +1,6 @@
<template> <template>
<div> <div>
<v-divider></v-divider>
<app-btn dark class="ma-4" @click="dialog = true"> 添加新项 </app-btn> <app-btn dark class="ma-4" @click="dialog = true"> 添加新项 </app-btn>
<app-btn dark class="my-4" color="secondary" @click="deleteItem(null)"> <app-btn dark class="my-4" color="secondary" @click="deleteItem(null)">
删除所选 删除所选

View File

@@ -1,5 +1,6 @@
<template> <template>
<v-app> <v-app>
<default-bar /> <default-bar />
<default-drawer /> <default-drawer />

View File

@@ -1,65 +1,38 @@
<template> <template>
<v-app> <v-app>
<v-container fluid class="grey lighten-5" v-bind:style="{ height: allDiv }"> <div class="auth-wrapper auth-v1">
<v-row v-bind:style="{ height: allDiv }">
<!-- -------------------------------公告----------------------------------- -->
<v-col
cols="0"
sm="4"
md="3"
class="white d-none d-sm-flex text-center"
>
<div style="width: 100%">
<h1 class="light-blue--text mt-8">{{title}} <br />维基 百科</h1>
<p class="my-4 title">Angstrong</p>
<p class="my-4 title">欢迎在这里我们无所不谈</p>
<a href="https://beian.miit.gov.cn">工信部备案号赣ICP备20008025号-2</a> <div class="auth-inner">
<v-img <router-view></router-view>
src="../../assets/login.svg" </div>
contain
v-bind:style="{ marginTop: imgDiv }"
style="width: 100%"
></v-img>
</div>
</v-col>
<!-- -------------------------------------------------------------------------- -->
<!-- ------------------------------表单-------------------------------- --> <!-- background triangle shape -->
<v-col cols="12" sm="8" md="9"> <img
<v-container class="text-center align-center" fluid> class="auth-mask-bg"
<div class="mt-15"> height="173"
<router-view></router-view> :src="
</div> require(`@/assets/mask-${$vuetify.theme.dark ? 'dark' : 'light'}.png`)
</v-container> "
</v-col> />
<!-- --------------------------------------------------------------- -->
</v-row> <!-- tree -->
</v-container> <v-img
</v-app> class="auth-tree"
width="247"
height="185"
src="@/assets/tree.png"
></v-img>
<!-- tree -->
<v-img
class="auth-tree-3"
width="377"
height="289"
src="@/assets/tree-3.png"
></v-img>
</div>
</v-app>
</template> </template>
<script> <style lang="scss">
// import settingApi from "@/api/settingApi"; @import "@/styles/auth.scss";
export default { </style>
created() {
this.initialize();
},
methods: {
initialize() {
// settingApi.getTitle().then((resp) => {
// this.title = resp.data;
// });
},
},
data: () => ({
title:"",
allDiv: document.documentElement.clientHeight + "px",
imgDiv: document.documentElement.clientHeight - 540 + "px",
// email: '',
// emailRules: [
// v => !!v || 'E-mail is required',
// v => /.+@.+\..+/.test(v) || 'E-mail must be valid',
// ],
}),
};
</script>

View File

@@ -0,0 +1,55 @@
.auth-wrapper {
display: flex;
min-height: calc(var(--vh, 1vh) * 100);
width: 100%;
flex-basis: 100%;
align-items: center;
background-color: #F4F5FA;
// common style for both v1 and v2
a {
text-decoration: unset;
}
// auth v1
&.auth-v1 {
align-items: center;
justify-content: center;
overflow: hidden;
padding: 1.5rem;
.auth-mask-bg {
position: absolute;
bottom: 0;
width: 100%;
}
.auth-tree,
.auth-tree-3 {
position: absolute;
}
.auth-tree {
bottom: 0;
left: 0;
}
.auth-tree-3 {
bottom: 0;
right: 0;
}
// auth card
.auth-inner {
width: 28rem;
z-index: 1;
.auth-card {
padding: 0.9375rem 0.875rem;
}
}
}
}
@media (max-width: 600px) {
// auth bg and tree hide in sm screen
.auth-v1 {
.auth-tree,
.auth-tree-3,
.auth-mask-bg {
display: none;
}
}
}

View File

@@ -7,10 +7,16 @@
<small class="text-body-1" <small class="text-body-1"
>你可以在这里多角色分配多菜单/选中一个可查看</small >你可以在这里多角色分配多菜单/选中一个可查看</small
> </template > </template
><app-btn class="ma-4" @click="setMenu">确定分配</app-btn >
><app-btn class="my-4" color="secondary" @click="clear">清空选择</app-btn></material-card <v-divider></v-divider>
<app-btn class="ma-4" @click="setMenu">确定分配</app-btn
>
<app-btn class="my-4" color="secondary" @click="clear">清空选择</app-btn></material-card
> >
</v-col> </v-col>
<v-col cols="12" md="4" lg="4"> <v-col cols="12" md="4" lg="4">
<v-card class="mx-auto" width="100%"> <v-card class="mx-auto" width="100%">
<v-treeview <v-treeview

View File

@@ -1,162 +1,133 @@
<template> <template>
<v-card <v-card class="auth-card">
class="px-6 py-4 mx-auto elevation-4 rounded-md" <!-- logo -->
style="height: 600px; width: 500px" <v-card-title class="d-flex align-center justify-center py-7">
> <router-link to="/" class="d-flex align-center">
<div> <v-img
<h1 class="title my-2">Angstrong</h1> :src="require('@/assets/logo.svg')"
<v-subheader>登入你的用户</v-subheader> max-height="30px"
</div> max-width="30px"
alt="logo"
contain
class="me-3"
></v-img>
<h2 class="text-2xl font-weight-semibold">Yi-Framework</h2>
</router-link>
</v-card-title>
<v-form ref="form" v-model="valid" lazy-validation> <!-- title -->
<v-text-field <v-card-text>
v-model="user_name" <p class="text-2xl font-weight-semibold text--primary mb-2">
:rules="user_nameRules" 欢迎来到CCNetCore! 👋🏻
label="用户名" </p>
outlined <p class="mb-2">登入你的用户开始畅游一切</p>
clearable </v-card-text>
required
:counter="20"
></v-text-field>
<v-text-field <!-- login form -->
v-model="password" <v-card-text>
:rules="passwordRules" <v-form>
label="密码" <v-text-field
outlined v-model="form.username"
clearable outlined
required label="用户"
type="password" placeholder="123456789@qq.com"
></v-text-field> counter="20"
<v-row> ></v-text-field>
<v-col cols="6">
<v-checkbox
v-model="checkbox"
:rules="[(v) => !!v || '同意后才可进入']"
label="你同意协议吗?"
required
></v-checkbox
></v-col>
<v-col cols="6" class="text-right pt-8"
><router-link to="/register">前往注册</router-link></v-col
>
</v-row>
</v-form>
<v-btn <v-text-field
class="my-2 light-blue white--text" v-model="form.password"
@click="login" outlined
large :type="isPasswordVisible ? 'text' : 'password'"
style="width: 100%" label="密码"
@keyup.enter="enterSearch" placeholder="············"
:loading="loader" :append-icon="isPasswordVisible ? 'mdi-eye' : 'mdi-eye-off'"
:disabled="btn_dis" @click:append="isPasswordVisible = !isPasswordVisible"
> ></v-text-field>
登入
</v-btn>
<p class="my-2">或使用登录</p>
<v-btn class="my-2 cyan white--text" @click="qqlogin" large style="width: 100%" :loading="loader" :disabled="btn_dis">
<v-icon class="mx-2" > mdi-qqchat </v-icon>
QQ
</v-btn>
<v-btn class="cyan white--text" @click="yklogin" large style="width: 100%" :loading="loader" :disabled="btn_dis"> <div class="d-flex align-center justify-space-between flex-wrap">
<v-icon class="mx-2"> mdi-message-text </v-icon> <v-checkbox label="记住密码" hide-details class="me-3 mt-1">
临时游客 </v-checkbox>
</v-btn>
<!-- forgot link -->
<a href="javascript:void(0)" class="mt-1"> 忘记密码? </a>
</div>
<v-btn block color="primary" @click="login" class="mt-6"> 登录 </v-btn>
</v-form>
</v-card-text>
<!-- create new account -->
<v-card-text class="d-flex align-center justify-center flex-wrap mt-2">
<span class="me-2"> 没有我们的账号? </span>
<router-link :to="{ path: '/register' }"> 注册账号 </router-link>
</v-card-text>
<!-- divider -->
<v-card-text class="d-flex align-center mt-2">
<v-divider></v-divider>
<span class="mx-5">or</span>
<v-divider></v-divider>
</v-card-text>
<!-- social links -->
<v-card-actions class="d-flex justify-center ">
<v-btn v-for="link in socialLink" :key="link.icon" icon class="ms-1">
<v-icon :color="$vuetify.theme.dark ? link.colorInDark : link.color">
{{ link.icon }}
</v-icon>
</v-btn>
</v-card-actions>
</v-card> </v-card>
</template> </template>
<script> <script>
export default { export default {
data: () => ({ data: () => ({
btn_dis:false, socialLink: [
loader: null, {
valid: true, icon: "mdi-qqchat",
user_name: "", color: "#8D5EE0",
user_nameRules: [ colorInDark: "#8D5EE0",
(v) => !!v || "用户名不能为空", },
(v) => (v && v.length <= 20) || "用户名必须小于20个字符", {
icon: "mdi-facebook",
color: "#4267b2",
colorInDark: "#4267b2",
},
{
icon: "mdi-twitter",
color: "#1da1f2",
colorInDark: "#1da1f2",
},
{
icon: "mdi-github",
color: "#272727",
colorInDark: "#fff",
},
{
icon: "mdi-google",
color: "#db4437",
colorInDark: "#db4437",
},
], ],
password: "",
passwordRules: [
(v) => !!v || "密码不能为空",
(v) => (v && v.length <= 120) || "密码必须小于20个字符",
],
select: null,
checkbox: true,
}),
created() {
this.enterSearch();
},
methods: {
enterSearch() {
document.onkeydown = (e) => {
//13表示回车键baseURI是当前页面的地址为了更严谨也可以加别的可以打印e看一下
if (e.keyCode === 13 && e.target.baseURI.match("/")) {
//回车后执行搜索方法
this.login();
}
};
},
qqlogin() { isPasswordVisible: false,
// QC.Login.showPopup(myqq.myqqLogin); form: {
// window.close(); username: "",
}, password: "",
yklogin() {
this.loader = "true";
this.btn_dis=true;
this.$store
.dispatch("Login", {
username: "游客",
password: "",
})
.then((resp) => {
if (resp.status) {
this.$router.push("/");
} else {
this.loader=null;
this.btn_dis=false;
this.$dialog.notify.error(resp.msg, {
position: "top-right",
timeout: 5000,
});
}
});
}, },
}),
methods: {
login() { login() {
if (this.$refs.form.validate()) { this.$store.dispatch("Login", this.form).then((resp) => {
this.loader = "true"; if (resp.status) {
this.btn_dis=true; this.$router.push("/");
this.$store } else {
.dispatch("Login", { this.$dialog.notify.error(resp.msg, {
username: this.user_name, position: "top-right",
password: this.password, timeout: 5000,
})
.then((resp) => {
if (resp.status) {
this.$router.push("/");
} else {
this.loader = null;
this.btn_dis=false;
this.$dialog.notify.error(resp.msg, {
position: "top-right",
timeout: 5000,
});
}
}); });
} else { }
this.$dialog.notify.error("请合理输入数据", { });
position: "top-right",
timeout: 5000,
});
}
},
reset() {
this.$refs.form.reset();
},
resetValidation() {
this.$refs.form.resetValidation();
}, },
}, },
}; };

View File

@@ -1,238 +1,141 @@
<template> <template>
<v-card <v-card class="auth-card">
class="px-6 py-4 mx-auto elevation-4 rounded-md" <!-- logo -->
style=" height: 600px; width: 500px" <v-card-title class="d-flex align-center justify-center py-7">
> <router-link to="/" class="d-flex align-center">
<div> <v-img
<h1 class="title my-2">Angstrong</h1> :src="require('@/assets/logo.svg')"
<v-subheader>注册加入我们</v-subheader> max-height="30px"
</div> max-width="30px"
alt="logo"
contain
class="me-3"
></v-img>
<v-form ref="form" v-model="valid" lazy-validation> <h2 class="text-2xl font-weight-semibold">Yi-Framework</h2>
<v-text-field </router-link>
v-model="user_name" </v-card-title>
:rules="user_nameRules"
label="用户名"
outlined
clearable
required
:counter="20"
></v-text-field>
<v-text-field <!-- title -->
ref="myemail" <v-card-text>
v-model="email" <p class="text-2xl font-weight-semibold text--primary mb-2">
:rules="emailRules" 注册-从这里开始 🚀
label="邮箱" </p>
outlined <p class="mb-2">加入我们获得一个有趣的灵魂</p>
clearable </v-card-text>
required
></v-text-field>
<v-row> <!-- login form -->
<v-col cols="6" md="8"> <v-card-text>
<v-text-field <v-form>
v-model="code" <v-text-field
label="验证码" v-model="form.username"
outlined outlined
clearable label="用户名"
required placeholder="JohnDoe"
:counter="20"
></v-text-field> class="mb-3"
</v-col> counter="20"
<v-col cols="2" md="1"> ></v-text-field>
<v-progress-circular
class="mt-2" <v-text-field
size="40" v-model="form.email"
:rotate="360" outlined
:value="value" label="邮箱"
color="cyan" placeholder="john@example.com"
>
{{ value }} class="mb-3"
</v-progress-circular> ></v-text-field>
</v-col>
<v-col cols="4" md="3"> <v-text-field
<v-btn class="mt-1" large :dark="!dis_mail" color="cyan" @click="sendMail" v-model="form.password"
:disabled="dis_mail" outlined
>发送</v-btn :type="isPasswordVisible ? 'text' : 'password'"
label="密码"
placeholder="············"
:append-icon="
isPasswordVisible ? 'mdi-eye' : 'mdi-eye-off'
"
@click:append="isPasswordVisible = !isPasswordVisible"
></v-text-field>
<v-checkbox hide-details class="mt-1">
<template #label>
<div class="d-flex align-center flex-wrap">
<span class="me-2">我同意</span
><a href="javascript:void(0)">协议 &amp; 策略</a>
</div>
</template>
</v-checkbox>
<v-btn block color="primary" class="mt-6"> 注册 </v-btn>
</v-form>
</v-card-text>
<!-- create new account -->
<v-card-text class="d-flex align-center justify-center flex-wrap mt-2">
<span class="me-2"> 已经存在账号? </span>
<router-link :to="{ path: '/login' }"> 跳转登录 </router-link>
</v-card-text>
<!-- divider -->
<v-card-text class="d-flex align-center mt-2">
<v-divider></v-divider>
<span class="mx-5">or</span>
<v-divider></v-divider>
</v-card-text>
<!-- social link -->
<v-card-actions class="d-flex justify-center">
<v-btn
v-for="link in socialLink"
:key="link.icon"
icon
class="ms-1"
> >
</v-col> <v-icon :color="$vuetify.theme.dark ? link.colorInDark:link.color">
</v-row> {{ link.icon }}
<v-text-field </v-icon>
v-model="password" </v-btn>
:rules="passwordRules" </v-card-actions>
label="密码"
outlined
clearable
required
type="password"
></v-text-field>
<v-row>
<v-col cols="6">
<v-checkbox
v-model="checkbox"
:rules="[(v) => !!v || '同意后才可进入']"
label="你同意协议吗?"
required
></v-checkbox
></v-col>
<v-col cols="6" class="text-right pt-8"
><router-link to="/login">返回</router-link></v-col
>
</v-row>
</v-form>
<v-btn
class="my-2 light-blue white--text"
@click="register"
large
style="width: 100%"
:loading="loader"
:disabled="btn_dis"
>
注册
</v-btn>
<!-- <p>或使用登录</p>
<v-btn dark class="my-2 cyan" @click="login" large style="width: 100%">
<v-icon class="mx-2"> mdi-message-text </v-icon>
QQ
</v-btn>
<v-btn dark class="cyan" @click="login" large style="width: 100%">
<v-icon class="mx-2"> mdi-message-text </v-icon>
微信
</v-btn> -->
</v-card> </v-card>
</template> </template>
<script> <script>
import accountApi from "../api/accountApi.js";
export default { export default {
data: () => ({ data: () => ({
btn_dis:false, socialLink:[
loader: null, {
dis_mail:false, icon: 'mdi-qqchat',
value:100, color: '#8D5EE0',
code: "", colorInDark: '#8D5EE0',
valid: true, },
user_name: "", {
user_nameRules: [ icon: 'mdi-facebook',
(v) => !!v || "用户名不能为空", color: '#4267b2',
(v) => (v && v.length <= 20) || "用户名必须小于20个字符", colorInDark: '#4267b2',
], },
email: "", {
emailRules: [ icon: 'mdi-twitter',
(v) => !!v || "邮箱不能为空", color: '#1da1f2',
(v) => /.+@.+\..+/.test(v) || "", colorInDark: '#1da1f2',
], },
password: "", {
passwordRules: [ icon: 'mdi-github',
(v) => !!v || "密码不能为空", color: '#272727',
(v) => (v && v.length <= 120) || "密码必须小于120个字符", colorInDark: '#fff',
(v) => (v && v.length >= 7) || "密码必须大于等于7个字符", },
], {
select: null, icon: 'mdi-google',
checkbox: true, color: '#db4437',
colorInDark: '#db4437',
},
],
isPasswordVisible: false,
form: {
email: "",
username: "",
password: "",
},
}), }),
created()
{
setInterval(this.addValue,1000)
},
// watch:{
// value(val,old)
// {
// val+=1
// if (val==100)
// {
// this.dis_mail=false
// }
// else
// {
// this.dis_mail=true
// }
// }
// },
methods: {
addValue()
{
if(this.value<=99)
{
this.value+=1
}
if(this.value==100)
{
this.dis_mail=false
}
else
{
this.dis_mail=true
}
},
register() {
if (this.$refs.form.validate()) {
this.loader = "true";
this.btn_dis=true;
this.$store
.dispatch("Register", {
username: this.user_name,
password: this.password,
email: this.email,
code: this.code,
})
.then((resp) => {
if (resp.status) {
this.$dialog.notify.success(resp.msg, {
position: "top-right",
timeout: 5000,
});
this.$router.push("/login");
} else {
this.loader=null;
this.btn_dis=false;
this.$dialog.notify.error(resp.msg, {
position: "top-right",
timeout: 5000,
});
}
});
} else {
this.$dialog.notify.error("请合理输入数据", {
position: "top-right",
timeout: 5000,
});
}
},
reset() {
this.$refs.form.reset();
},
resetValidation() {
this.$refs.form.resetValidation();
},
sendMail() {
if (this.$refs.myemail.validate()) {
this.value=0
this.dis_mail=true
accountApi.email(this.email).then((resp) => {
if (resp.status) {
this.$dialog.notify.success(resp.msg, {
position: "top-right",
timeout: 5000,
});
} else {
this.$dialog.notify.error(resp.msg, {
position: "top-right",
timeout: 5000,
});
}
});
} else {
this.$dialog.notify.error("请合理输入邮箱", {
position: "top-right",
timeout: 5000,
});
}
},
},
}; };
</script> </script>