Browse Source

fix issue

tags/v1.22.2.2^2
zhoupzh 3 years ago
parent
commit
a26a0d6795
3 changed files with 41 additions and 37 deletions
  1. +1
    -1
      templates/repo/wx_autorize.tmpl
  2. +39
    -36
      templates/user/settings/profile.tmpl
  3. +1
    -0
      web_src/js/components/WxAutorize.vue

+ 1
- 1
templates/repo/wx_autorize.tmpl View File

@@ -1,6 +1,6 @@
<!-- 头部导航栏 --> <!-- 头部导航栏 -->
{{template "base/head" .}} {{template "base/head" .}}
<div class="alert"></div>
<div class="alert" style="top: 0;"></div>
<div class="repository release dataset-list view"> <div class="repository release dataset-list view">
{{template "repo/header" .}} {{template "repo/header" .}}
{{template "base/alert" .}} {{template "base/alert" .}}


+ 39
- 36
templates/user/settings/profile.tmpl View File

@@ -1,6 +1,9 @@
{{template "base/head" .}} {{template "base/head" .}}

<div class="user settings profile"> <div class="user settings profile">
{{template "user/settings/navbar" .}} {{template "user/settings/navbar" .}}
<div class="alert" style="top: 0;"></div>
<div class="ui container"> <div class="ui container">
{{template "base/alert" .}} {{template "base/alert" .}}
<h4 class="ui top attached header"> <h4 class="ui top attached header">
@@ -111,44 +114,43 @@
</div> </div>
{{else}} {{else}}
<div> <div>
<table class="ui celled striped table provider titleless">
<thead>
<th class="center aligned">
绑定账号信息
</th>
<th class="center aligned">
详情
</th>
<th class="center aligned">
绑定时间
</th>
<th class="center aligned">
操作
</th>
</thead>
<tbody>
<td class="center aligned">
微信
</td>
<td class="center aligned">
<img class="ui avatar image" width="24" height="24" src="{{.SignedUser.RelAvatarLink}}">{{.SignedUser.Name}}
</td>
<td class="center aligned">
2022-02-23 14:48
</td>
<td class="center aligned">
<div>
<a class="ui inverted orange button " onclick="showcreate(this)" href="javascript: void(0)">解除绑定</a>
</div>
</td>
</tbody>
</table>
</div>
<table class="ui celled striped table provider titleless">
<thead>
<th class="center aligned">
绑定账号信息
</th>
<!-- <th class="center aligned">
详情
</th> -->
<th class="center aligned">
绑定时间
</th>
<th class="center aligned">
操作
</th>
</thead>
<tbody>
<td class="center aligned">
微信
</td>
<!-- <td class="center aligned">
<img class="ui avatar image" width="24" height="24" src="{{.SignedUser.RelAvatarLink}}">{{.SignedUser.Name}}
</td> -->
<td class="center aligned">
{{TimeSinceUnix1 .SignedUser.WechatBindTime}}
<td class="center aligned">
<div>
<a class="ui inverted orange button " onclick="showcreate(this)" href="javascript: void(0)">解除绑定</a>
</div>
</td>
</tbody>
</table>
</div>
{{end}} {{end}}
</div> </div>




<div class="ui mini modal second">
<div class="ui mini modal wx-unbind">
<div class="header">确定要解绑微信?</div> <div class="header">确定要解绑微信?</div>
<div class="content"> <div class="content">
<p>解绑后将无法使用云脑计算资源</p> <p>解绑后将无法使用云脑计算资源</p>
@@ -162,16 +164,17 @@
{{template "base/footer" .}} {{template "base/footer" .}}
<script> <script>
function showcreate(obj){ function showcreate(obj){
console.log({{.SignedUser.WechatBindTime}})
const {csrf} = window.config const {csrf} = window.config
$('.ui.modal.second')
$('.ui.modal.wx-unbind')
.modal({ .modal({
onShow:function(){ onShow:function(){
}, },
onHide:function(){ onHide:function(){
}, },
onApprove:function($element){ onApprove:function($element){
console.log($element)
$.post('/authentication/wechat/unbind',{_csrf:csrf},(data)=>{ $.post('/authentication/wechat/unbind',{_csrf:csrf},(data)=>{
$('.alert').html('解绑成功!').removeClass('alert-danger').addClass('alert-success').show().delay(1500).fadeOut();
window.location.href = '/user/settings' window.location.href = '/user/settings'
}) })
} }


+ 1
- 0
web_src/js/components/WxAutorize.vue View File

@@ -68,6 +68,7 @@ export default {
} else if (this.status === 2) { } else if (this.status === 2) {
//用户登录成功后清除定时器 //用户登录成功后清除定时器
clearInterval(times) clearInterval(times)
$('.alert').html('绑定成功!').removeClass('alert-danger').addClass('alert-success').show().delay(1500).fadeOut();
window.location.href = this.$Cookies.get('redirect_to') window.location.href = this.$Cookies.get('redirect_to')
} }
}, 1000) }, 1000)


Loading…
Cancel
Save