oauth.html 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. {template 'common/header'}
  2. <ul class="we7-page-tab">
  3. <li class="active">
  4. <a href="{php echo url('system/oauth')}">全局借用权限设置</a>
  5. </li>
  6. </ul>
  7. <div id="js-system-oauth" ng-controller="systemOauthCtrl" ng-cloak>
  8. <table class="table we7-table table-hover table-form">
  9. <col width="180px " />
  10. <col />
  11. <col width="100px" />
  12. <tr>
  13. <th class="text-left" colspan="3">全局借用权限设置</th>
  14. </tr>
  15. <tr>
  16. <td class="text-left">
  17. 选择公众号
  18. </td>
  19. <td class="text-left color-gray" ng-bind="oauthtitle"></td>
  20. <td >
  21. <div class="link-group"><a href="javascript:;" data-toggle="modal" data-target="#oauth">修改</a></div>
  22. </td>
  23. </tr>
  24. <tr>
  25. <td class="text-left">
  26. oAuth独立域名
  27. </td>
  28. <td class="text-left color-gray" ng-bind="originalHost"></td>
  29. <td >
  30. <div class="link-group"><a href="javascript:;" data-toggle="modal" data-target="#host">修改</a></div>
  31. </td>
  32. </tr>
  33. </table>
  34. <div class="modal fade" id="oauth" tabindex="-1" role="dialog" aria-hidden="true">
  35. <div class="we7-modal-dialog modal-dialog">
  36. <div class="modal-content">
  37. <div class="modal-header">
  38. <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
  39. <div class="modal-title">选择公众号</div>
  40. </div>
  41. <div class="modal-body">
  42. <div class="form-group">
  43. <select ng-model="oauthAccount" class="we7-select">
  44. <option value="0" ng-selected="oauthAccount == '' || oauthAccount == 0">不借用任何权限</option>
  45. {loop $oauth_accounts $key $account}
  46. <option value="{php echo $key}">{php echo $account}</option>
  47. {/loop}
  48. </select>
  49. <span class="help-block">在微信公众号请求用户网页授权之前,开发者需要先到公众平台网站的【开发者中心】<b>网页服务</b>中配置授权回调域名.</span>
  50. </div>
  51. </div>
  52. <div class="modal-footer">
  53. <button type="button" class="btn btn-primary" data-dismiss="modal" ng-click="saveOauth('oauth')">确定</button>
  54. <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
  55. </div>
  56. </div>
  57. </div>
  58. </div>
  59. <div class="modal fade" id="host" tabindex="-1" role="dialog" aria-hidden="true">
  60. <div class="we7-modal-dialog modal-dialog">
  61. <div class="modal-content">
  62. <div class="modal-header">
  63. <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
  64. <div class="modal-title">oAuth独立域名</div>
  65. </div>
  66. <div class="modal-body">
  67. <div class="form-group we7-form">
  68. <input type="text" name="host" ng-model="oauthHost" class="form-control" placeholder="oAuth独立域名">
  69. <span class="help-block">适用于您的微站或是活动有多个域名的情况下,由此域名做统一的oauth授权用。例如:http://www.baidu.com 注意:结尾没有/ </span>
  70. </div>
  71. </div>
  72. <div class="modal-footer">
  73. <button type="button" class="btn btn-primary" ng-click="saveOauth()">确定</button>
  74. <button type="button" class="btn btn-default" data-dismiss="modal" ng-click="recover()">取消</button>
  75. </div>
  76. </div>
  77. </div>
  78. </div>
  79. </div>
  80. <script type="text/javascript">
  81. angular.module('systemApp').value('config', {
  82. 'oauthAccount' : "{$oauth['oauth']['account']}",
  83. 'oauthHost' : "{$oauth['oauth']['host']}",
  84. 'oauthAccounts' : {php echo json_encode($oauth_accounts)},
  85. 'links': {
  86. 'oauth_link': "{php echo url('system/oauth/save_oauth')}",
  87. },
  88. });
  89. angular.bootstrap($('#js-system-oauth'), ['systemApp']);
  90. </script>
  91. {template 'common/footer'}