Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
yma16
myblogVue_django
提交
57ee2f06
M
myblogVue_django
项目概览
yma16
/
myblogVue_django
通知
5
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
myblogVue_django
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
57ee2f06
编写于
7月 16, 2022
作者:
yma16
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix:添加超时loading
上级
c437a5f5
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
19 addition
and
5 deletion
+19
-5
src/comment/ArticleComment.vue
src/comment/ArticleComment.vue
+8
-2
src/components/Login.vue
src/components/Login.vue
+5
-2
src/components/Register.vue
src/components/Register.vue
+5
-0
src/components/email/Email.vue
src/components/email/Email.vue
+1
-1
未找到文件。
src/comment/ArticleComment.vue
浏览文件 @
57ee2f06
...
@@ -28,6 +28,7 @@
...
@@ -28,6 +28,7 @@
type=
"primary"
type=
"primary"
style=
"margin-left: 5px"
style=
"margin-left: 5px"
@
click=
"increment(userId, articleId, articleCommit)"
@
click=
"increment(userId, articleId, articleCommit)"
v-loading=
"submitLoading"
>
提交评论
</el-button
>
提交评论
</el-button
>
>
</div>
</div>
...
@@ -43,6 +44,7 @@ export default {
...
@@ -43,6 +44,7 @@ export default {
// props定义则data()无需定义
// props定义则data()无需定义
data
()
{
data
()
{
return
{
return
{
submitLoading
:
false
,
noneMsg
:
"
还没人评论>_<
"
,
noneMsg
:
"
还没人评论>_<
"
,
msg
:
"
评论区
"
,
msg
:
"
评论区
"
,
baseurl
:
"
/api/
"
,
baseurl
:
"
/api/
"
,
...
@@ -58,7 +60,7 @@ export default {
...
@@ -58,7 +60,7 @@ export default {
watch
:
{
watch
:
{
articleId
:
function
(
newData
)
{
articleId
:
function
(
newData
)
{
this
.
childArticleId
=
newData
;
this
.
childArticleId
=
newData
;
return
newData
return
newData
;
},
},
},
},
mounted
()
{
mounted
()
{
...
@@ -100,7 +102,7 @@ export default {
...
@@ -100,7 +102,7 @@ export default {
getComments
(
articleId
)
{
getComments
(
articleId
)
{
let
that
=
this
;
let
that
=
this
;
let
params
=
{
let
params
=
{
articleId
:
articleId
?
articleId
:
that
.
articleId
,
articleId
:
articleId
||
that
.
articleId
,
};
};
axios
axios
.
post
(
that
.
baseurl
+
"
comment/get/
"
,
params
)
.
post
(
that
.
baseurl
+
"
comment/get/
"
,
params
)
...
@@ -138,6 +140,7 @@ export default {
...
@@ -138,6 +140,7 @@ export default {
});
});
return
false
;
return
false
;
}
}
that
.
submitLoading
=
true
;
const
userInfo
=
JSON
.
parse
(
localStorage
.
getItem
(
"
yma16siteUserInfo
"
));
const
userInfo
=
JSON
.
parse
(
localStorage
.
getItem
(
"
yma16siteUserInfo
"
));
that
.
userId
=
userInfo
.
username
;
that
.
userId
=
userInfo
.
username
;
let
params
=
{
let
params
=
{
...
@@ -148,6 +151,7 @@ export default {
...
@@ -148,6 +151,7 @@ export default {
axios
axios
.
post
(
that
.
baseurl
+
"
comment/post/
"
,
params
)
.
post
(
that
.
baseurl
+
"
comment/post/
"
,
params
)
.
then
((
res
)
=>
{
.
then
((
res
)
=>
{
that
.
submitLoading
=
false
;
that
.
articleCommit
=
null
;
that
.
articleCommit
=
null
;
try
{
try
{
let
resData
=
res
.
data
;
let
resData
=
res
.
data
;
...
@@ -156,10 +160,12 @@ export default {
...
@@ -156,10 +160,12 @@ export default {
item
.
date
=
that
.
dateToString
(
item
.
date
);
item
.
date
=
that
.
dateToString
(
item
.
date
);
});
});
}
catch
(
e
)
{
}
catch
(
e
)
{
that
.
submitLoading
=
false
;
throw
Error
(
e
);
throw
Error
(
e
);
}
}
})
})
.
catch
((
r
)
=>
{
.
catch
((
r
)
=>
{
that
.
submitLoading
=
false
;
that
.
$router
that
.
$router
.
push
({
.
push
({
path
:
"
/login
"
,
path
:
"
/login
"
,
...
...
src/components/Login.vue
浏览文件 @
57ee2f06
<
template
>
<
template
>
<div
class=
"login"
style=
"text-align: center"
>
<div
class=
"login"
style=
"text-align: center"
>
<el-card
class=
"box-card"
style=
"text-align: center"
>
<el-card
class=
"box-card"
style=
"text-align: center"
v-loading=
"loading"
>
<el-form
<el-form
:model=
"ruleForm"
:model=
"ruleForm"
status-icon
status-icon
...
@@ -11,7 +11,6 @@
...
@@ -11,7 +11,6 @@
style=
"text-align: center; margin: 0 auto"
style=
"text-align: center; margin: 0 auto"
>
>
<el-form-item><p
style=
"font-size: 30px"
>
登录
</p></el-form-item>
<el-form-item><p
style=
"font-size: 30px"
>
登录
</p></el-form-item>
<el-form-item
label=
"账号"
prop=
"name"
>
<el-form-item
label=
"账号"
prop=
"name"
>
<el-input
v-model=
"ruleForm.name"
></el-input>
<el-input
v-model=
"ruleForm.name"
></el-input>
</el-form-item>
</el-form-item>
...
@@ -83,6 +82,7 @@ export default {
...
@@ -83,6 +82,7 @@ export default {
// }
// }
// };
// };
return
{
return
{
loading
:
false
,
// baseurl:"http://127.0.0.1/user/login/",
// baseurl:"http://127.0.0.1/user/login/",
baseurl
:
"
/api/
"
,
baseurl
:
"
/api/
"
,
// baseurl: 'http://yongma16.xyz/user/login/',
// baseurl: 'http://yongma16.xyz/user/login/',
...
@@ -103,6 +103,7 @@ export default {
...
@@ -103,6 +103,7 @@ export default {
const
that
=
this
;
// this指向
const
that
=
this
;
// this指向
this
.
$refs
[
formName
].
validate
((
valid
)
=>
{
this
.
$refs
[
formName
].
validate
((
valid
)
=>
{
if
(
valid
)
{
if
(
valid
)
{
that
.
loading
=
true
;
// 提交数据
// 提交数据
const
loginUrl
=
that
.
baseurl
+
"
user/login/
"
;
const
loginUrl
=
that
.
baseurl
+
"
user/login/
"
;
const
userInfo
=
{
const
userInfo
=
{
...
@@ -129,8 +130,10 @@ export default {
...
@@ -129,8 +130,10 @@ export default {
// alter("失败!" res.data.msg)
// alter("失败!" res.data.msg)
that
.
$message
.
error
(
"
用户名或密码错误
"
);
that
.
$message
.
error
(
"
用户名或密码错误
"
);
}
}
that
.
loading
=
false
;
})
})
.
catch
((
error
)
=>
{
.
catch
((
error
)
=>
{
that
.
loading
=
false
;
that
.
$message
.
error
(
error
);
that
.
$message
.
error
(
error
);
});
});
}
else
{
}
else
{
...
...
src/components/Register.vue
浏览文件 @
57ee2f06
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
label-width=
"100px"
label-width=
"100px"
class=
"demo-ruleForm"
class=
"demo-ruleForm"
style=
"text-align: center; margin: 0 auto"
style=
"text-align: center; margin: 0 auto"
v-loading=
"loading"
>
>
<el-form-item>
<el-form-item>
<!-- 弹出一个警告框 -->
<!-- 弹出一个警告框 -->
...
@@ -115,6 +116,7 @@ export default {
...
@@ -115,6 +116,7 @@ export default {
}
}
};
};
return
{
return
{
loading
:
false
,
register_success
:
false
,
register_success
:
false
,
register_error
:
false
,
register_error
:
false
,
// baseurl: "http://127.0.0.1/",
// baseurl: "http://127.0.0.1/",
...
@@ -137,6 +139,7 @@ export default {
...
@@ -137,6 +139,7 @@ export default {
this
.
$refs
[
formName
].
validate
((
valid
)
=>
{
this
.
$refs
[
formName
].
validate
((
valid
)
=>
{
const
that
=
this
;
const
that
=
this
;
if
(
valid
)
{
if
(
valid
)
{
that
.
loading
=
false
// 提交数据
// 提交数据
// alert("yes submit!");
// alert("yes submit!");
that
.
register_success
=
false
;
// 初始化register的状态
that
.
register_success
=
false
;
// 初始化register的状态
...
@@ -162,9 +165,11 @@ export default {
...
@@ -162,9 +165,11 @@ export default {
type
:
"
success
"
,
type
:
"
success
"
,
});
});
}
}
that
.
loading
=
false
})
})
.
catch
(
function
(
res
)
{
.
catch
(
function
(
res
)
{
// 获取res中的name
// 获取res中的name
that
.
loading
=
false
that
.
$message
({
that
.
$message
({
message
:
"
注册失败
"
+
that
.
ruleForm
.
name
+
"
!
"
,
message
:
"
注册失败
"
+
that
.
ruleForm
.
name
+
"
!
"
,
type
:
"
error
"
,
type
:
"
error
"
,
...
...
src/components/email/Email.vue
浏览文件 @
57ee2f06
...
@@ -86,7 +86,7 @@ export default {
...
@@ -86,7 +86,7 @@ export default {
{
{
type
:
"
string
"
,
type
:
"
string
"
,
required
:
true
,
required
:
true
,
message
:
"
邮
件
不能为空
"
,
message
:
"
邮
箱
不能为空
"
,
trigger
:
"
blur
"
,
trigger
:
"
blur
"
,
},
},
{
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录