Skip to content

Commit bd96bec

Browse files
author
myxingke
committed
绑定授权
1 parent 588ab61 commit bd96bec

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

src/libs/api.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@
44
const Api = window.Api || {}
55
/** 主请求域名**/
66
Api.domain = process.env.NODE_ENV == 'production' ? '' : ''
7+
Api.auth_call_back = process.env.NODE_ENV == 'production' ? 'http://api.daimatu.cn' : 'http://xingke.iask.in'
78

89
export default Api

src/module/merchant/merchant.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ import Util from '../../libs/util' // 工具
1010
import Http from '../../libs/http' //请求工具
1111
import Plugin from '../../libs/plugin/formatDate' //插件
1212
import '../../libs/filter' //过滤器
13+
import Api from '../../libs/api'
14+
window.Api = Api
1315

1416
Vue.use(Plugin)
1517
Vue.use(Toast)

src/module/merchant/pages/public/bind.vue

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<span style="padding-left: 10px;">我已阅读上述绑定说明</span>
2626
</div>
2727
<div class="button">
28-
<Button :type="type" size="large" style="width: 200px;" @click="bind">一键绑定授权</Button>
28+
<Button :type="type" size="large" style="width: 200px;" :loading="loading" @click="bind">一键绑定授权</Button>
2929
</div>
3030
</div>
3131

@@ -39,7 +39,8 @@
3939
data () {
4040
return {
4141
isSwitch: false,
42-
type: 'default'
42+
type: 'default',
43+
loading: false,
4344
}
4445
},
4546
methods: {
@@ -55,14 +56,13 @@
5556
this.$Message.info('请先同意授权说明');
5657
return false;
5758
}
58-
this.request('MerchantPublicBind', {}, '跳转中...').then((res) => {
59-
if (res.status) {
60-
window.open(res.data.url);
61-
this.$Message.success("请在打开的新页面中授权");
62-
} else {
63-
this.$Message.error(res.msg)
64-
}
65-
})
59+
//临时域名
60+
window.open(Api.auth_call_back + "/merchants/public_signal/bind");
61+
this.$Message.success("请注意是否有打开新的授权页面");
62+
this.loading = true
63+
setTimeout(() => {
64+
this.loading = false
65+
}, 5000);
6666
}
6767
},
6868
components:{

0 commit comments

Comments
 (0)