从后台获取openid即可
This commit is contained in:
parent
13d11e2239
commit
814fde878e
|
@ -212,7 +212,7 @@ class WechatsController < ActionController::Base
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
render file: File.join(Rails.root, "public/assets/wechat/app.html"), layout: nil
|
render 'wechats/user_activities', layout: nil
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
|
@ -0,0 +1,30 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html ng-app="wechat">
|
||||||
|
<head>
|
||||||
|
<title>最新动态</title>
|
||||||
|
<meta charset='utf-8' />
|
||||||
|
<meta name="keywords" content="" />
|
||||||
|
<meta name="description" content="" />
|
||||||
|
<meta name="apple-mobile-web-app-capable" content="no">
|
||||||
|
<meta content='True' name='HandheldFriendly' />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
|
||||||
|
|
||||||
|
<link type="text/css" rel="stylesheet" href="/stylesheets/weui/weixin.css" />
|
||||||
|
<script type="text/javascript">
|
||||||
|
window.g_openid = '<%= @wechat_user.openid %>';
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div ng-view>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<script src="/javascripts/wechat/angular.js"></script>
|
||||||
|
<script src="/javascripts/wechat/angular-route.js"></script>
|
||||||
|
<script src="/javascripts/wechat/angular-sanitize.min.js"></script>
|
||||||
|
<script src="/javascripts/wechat/angular-cookies.js"></script>
|
||||||
|
<script src="/javascripts/jquery-1.3.2.js"></script>
|
||||||
|
<script src="/javascripts/wechat/app.js"></script>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
|
@ -2,7 +2,7 @@ button:
|
||||||
-
|
-
|
||||||
type: "view"
|
type: "view"
|
||||||
name: "最新动态"
|
name: "最新动态"
|
||||||
url: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxc09454f171153c2d&redirect_uri=http://wechat.trustie.net/wechat/user_activities&response_type=code&scope=snsapi_base&state=123#wechat_redirect"
|
url: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxf694495398c7d470&redirect_uri=http://wechat.trustie.net/wechat/user_activities&response_type=code&scope=snsapi_base&state=123#wechat_redirect"
|
||||||
-
|
-
|
||||||
type: "click"
|
type: "click"
|
||||||
name: "意见反馈"
|
name: "意见反馈"
|
||||||
|
|
|
@ -10,6 +10,10 @@ if(debug===true){
|
||||||
app.factory('auth', function($http,$routeParams, $cookies, $q){
|
app.factory('auth', function($http,$routeParams, $cookies, $q){
|
||||||
var _openid = '';
|
var _openid = '';
|
||||||
|
|
||||||
|
if(typeof g_openid !== 'undefined'){
|
||||||
|
_openid = g_openid;
|
||||||
|
}
|
||||||
|
|
||||||
if(debug===true){
|
if(debug===true){
|
||||||
_openid = "1";
|
_openid = "1";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue