Commit 3fe59d51 by 冷斌

fix bug

parent 7acf5dd5
...@@ -51,6 +51,27 @@ class ProfitController extends HomebaseController ...@@ -51,6 +51,27 @@ class ProfitController extends HomebaseController
} }
$this->display(); $this->display();
} }
public function info()
{
$uid=I("uid");
$token=I("token");
if( !$uid || !$token || checkToken($uid,$token)==700 ){
echo json_encode(array("ret"=>0,'data'=>array(),'msg'=>'您的登陆状态失效,请重新登陆!'));
exit;
}
$data = [
'a' => 1,
'b' => 1,
];
echo json_encode(array("ret"=>200,'data'=>$data,'msg'=>''));
die;
}
} }
...@@ -13,13 +13,6 @@ ...@@ -13,13 +13,6 @@
</div> </div>
<div></div> <div></div>
<div class="menuBox"> <div class="menuBox">
<!-- <div>
<img src="__PUBLIC__/appapi/img/diamond_32@2x.png" width="16px">
<span style="color: #fff">剩余钻石:</span>
<span @click="rechange">点击去充值页面</span>
<br/>
<span style="color: #fff">1000</span>
</div> -->
<div class="menuItem"> <div class="menuItem">
<div class="menuHd"> <div class="menuHd">
<img src="__PUBLIC__/appapi/pay/img/zhib.png"> <img src="__PUBLIC__/appapi/pay/img/zhib.png">
...@@ -77,16 +70,23 @@ ...@@ -77,16 +70,23 @@
subMit() { subMit() {
}, },
rechange() { info () {
let userInfo = sessionStorage.getItem("user_info"); let userInfo = sessionStorage.getItem("user_info");
let info = JSON.parse(userInfo); if (!userInfo) {
window.location.href = '/index.php?g=Appapi&m=Profit&a=rechange&uid=' + info.id + '&token=' + info.token; window.location.href = '/index.php?g=Appapi&m=Login&a=index';
}
return JSON.parse(userInfo);
},
url (url) {
let info = this.info();
return url + '&uid=' + info.id + '&token=' + info.token;
},
rechange() {
window.location.href = this.url('/index.php?g=Appapi&m=Profit&a=rechange');
}, },
withdraw(type) { withdraw(type) {
let userInfo = sessionStorage.getItem("user_info");
let info = JSON.parse(userInfo);
let url = type ? '/index.php?g=Appapi&m=Profit&a=auth' : '/index.php?g=Appapi&m=Profit&a=withdraw'; let url = type ? '/index.php?g=Appapi&m=Profit&a=auth' : '/index.php?g=Appapi&m=Profit&a=withdraw';
window.location.href = url + '&uid=' + info.id + '&token=' + info.token; window.location.href = this.url(url);
} }
}, },
watch: { watch: {
...@@ -94,6 +94,25 @@ ...@@ -94,6 +94,25 @@
}, },
created: function () { created: function () {
//加载触发函数 //加载触发函数
let _this = this;
let url = _this.url('/index.php?g=Appapi&m=Profit&a=info')
$.ajax({
url:url,
dataType:"json",
type:"POST",
success:function(data){
console.log(data)
if(data.ret==200){
}else{
layer.msg(data.msg);
}
},
error:function(e){
layer.msg(e.msg);
}
})
} }
}); });
</script> </script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment