1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
| <template>
| <!-- 设置 -->
| <view class="container">
| <navigator url="./changePassword" hover-class="none" class="flex justify-between content-row mb-20">
| <text class="font-16">修改登录密码</text>
| <text class="iconfont iconarrow-backimg gray"></text>
| </navigator>
| <button class="blue-btn" @click="loginOut" v-if="isLogin==1">退出登录</button>
| </view>
| </template>
|
| <script>
| export default{
| data(){
| return {
| isLogin: null
| }
| },
| onLoad(options) {
| this.isLogin = options.isLogin;
| },
| methods:{
| loginOut(){
| uni.showModal({
| title: '提示',
| content: '确定要退出登录吗?',
| success: (res) => {
| if (res.confirm) {
| this.$httpUtils.request('/api/user/loginOut').then((res) => {
| if(res.status==200){
| uni.removeStorage({
| key: 'userInfo',
| success: function (res) {
| uni.reLaunch({
| url: '../login/index?isNotLogin=1'
| })
| }
| });
| }
| this.$toast.info(res.info)
| })
| }
| }
| });
| }
| }
| }
| </script>
|
| <style>
| .container{
| padding: 0 15px;
| }
| .content-row{
| padding: 10px 0px;
| border-bottom: 1px solid #EDEAF4;
| }
| </style>
|
|