Skip to content

Commit a8b21c6

Browse files
committed
修改登录和添加console
1 parent 0275202 commit a8b21c6

File tree

7 files changed

+24
-7
lines changed

7 files changed

+24
-7
lines changed

config/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module.exports = {
77
index: path.resolve(__dirname, '../dist/index.html'),
88
assetsRoot: path.resolve(__dirname, '../dist'),
99
assetsSubDirectory: 'static',
10-
assetsPublicPath: '/',
10+
assetsPublicPath: '',
1111
productionSourceMap: false,
1212
// Gzip off by default as many popular static hosts such as
1313
// Surge or Netlify already gzip all static assets for you.

src/view/articleDetails/index.vue

+1-2
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ export default {
111111
if(res.success){
112112
this.$router.go(0)
113113
}else{
114-
114+
console.log('回复失败!');
115115
}
116116
})
117117
},
@@ -120,7 +120,6 @@ export default {
120120
accesstoken: this.getToken,
121121
topic_id: this.$route.query.id
122122
}
123-
console.log(dataObj)
124123
if(type === 'collect'){
125124
api.topicCollect(dataObj).then(res =>{
126125
if(res.success){

src/view/index/index.vue

+2
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ export default {
5151
api.getTopicsList({page:this.page,tab: this.$route.query.tab}).then(res=>{
5252
if(res.success){
5353
this.listData=res.data;
54+
}else{
55+
console.log('获取数据失败!');
5456
}
5557
})
5658
},

src/view/login/index.vue

+14-4
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,22 @@
2424

2525
<script>
2626
import * as api from "@/api/api";
27-
import { mapMutations } from 'vuex';
27+
import { mapMutations ,mapGetters } from 'vuex';
2828
2929
export default {
3030
data(){
3131
return {
3232
accesstoken:''
3333
}
3434
},
35+
created(){
36+
this.setRightName(this.getLoginUser);
37+
},
38+
computed:{
39+
...mapGetters([
40+
'getLoginUser'
41+
])
42+
},
3543
methods:{
3644
...mapMutations({
3745
userLogin: 'COM_USER_LOGIN',
@@ -50,7 +58,7 @@ export default {
5058
if(!url) url='/';
5159
this.$router.push({ path: url });
5260
}else{
53-
61+
console.log('登录失败');
5462
}
5563
})
5664
}
@@ -60,16 +68,18 @@ export default {
6068

6169
<style lang="less" scoped>
6270
.login-box{
63-
padding: 50px 10px;
71+
padding: 50px 0;
72+
margin: 0 auto;
73+
width: 500px;
6474
.control-group{
6575
padding: 20px 0;
6676
}
6777
.control-label{
6878
color: #999;
69-
width:300px;
7079
padding-right: 30px;
7180
text-align: right;
7281
display: inline-block;
82+
width: 180px;
7383
}
7484
.control-input .input-box{
7585
height: 20px;

src/view/msg/index.vue

+2
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ export default {
4848
api.getMsgData({ "accesstoken":this.getToken }).then(res=>{
4949
if(res.success){
5050
this.msgData = res.data;
51+
}else{
52+
console.log('数据获取失败!');
5153
}
5254
})
5355
}

src/view/newTopic/index.vue

+2
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ export default {
7070
api.createTopic(this.CreateData).then( res =>{
7171
if(res.success){
7272
this.$router.push({path: '/topic',query:{ id: res.topic_id}});
73+
}else{
74+
console.log('创建失败!');
7375
}
7476
})
7577
}

src/view/user/index.vue

+2
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ export default {
5656
if(res.success){
5757
this.UserData = res.data;
5858
this.setRightName(res.data.loginname);
59+
}else{
60+
console.log('数据获取失败!');
5961
}
6062
})
6163
}

0 commit comments

Comments
 (0)