人人商城

platform.html 7.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. {template 'common/header-gw'}
  2. <ul class="nav nav-tabs">
  3. <li class="active"><a href="{php echo url('system/site');}">微信开放平台信息</a></li>
  4. </ul>
  5. <form class="form-horizontal form" id="form1" action="" method="post" enctype="multipart/form-data">
  6. <div class="clearfix">
  7. <h5 class="page-header">微信开放平台开发信息</h5>
  8. <div class="alert alert-info">开发信息需开放平台审核通过后才可以看到,填写完后才可以使用授权登录功能</div>
  9. <div class="form-group">
  10. <label class="col-xs-12 col-sm-3 col-md-2 control-label"><span class="require"> </span>是否启用微信公众号登录授权</label>
  11. <div class="col-sm-9 col-xs-12">
  12. <label class="radio-inline"><input type="radio" name="authstate" value="1" {if $_W['setting']['platform']['authstate']} checked{/if} > 是</label>
  13. <label class="radio-inline"><input type="radio" name="authstate" value="0" {if !$_W['setting']['platform']['authstate']} checked{/if} > 否</label>
  14. </div>
  15. </div>
  16. <div class="form-group">
  17. <label class="col-xs-12 col-sm-3 col-md-2 control-label"><span class="require"> </span>测试登陆授权</label>
  18. <div class="col-sm-9 col-xs-12">
  19. <a id="auth" href="{$authurl}"><img src="https://open.weixin.qq.com/zh_CN/htmledition/res/assets/res-design-download/icon_button3_2.png" /></a>
  20. </div>
  21. </div>
  22. <div class="form-group">
  23. <label class="col-xs-12 col-sm-3 col-md-2 control-label"><span class="require"> </span>AppID</label>
  24. <div class="col-sm-9 col-xs-12">
  25. <input type="text" name="appid" value="{$_W['setting']['platform']['appid']}" class="form-control">
  26. <div class="help-block">在微信开放平台注册且审核通过后可以获取到AppId</div>
  27. </div>
  28. </div>
  29. <div class="form-group">
  30. <label class="col-xs-12 col-sm-3 col-md-2 control-label"><span class="require"> </span>AppSecret</label>
  31. <div class="col-sm-9 col-xs-12">
  32. <input type="text" name="appsecret" value="{$_W['setting']['platform']['appsecret']}" class="form-control">
  33. <div class="help-block">在微信开放平台注册且审核通过后可以获取到AppSecret</div>
  34. </div>
  35. </div>
  36. <h5 class="page-header">微信开放平台接入配置项</h5>
  37. <div class="form-group">
  38. <label class="col-xs-12 col-sm-3 col-md-2 control-label"><span class="require"> </span>登录授权的发起页域名</label>
  39. <div class="col-sm-9 col-xs-12">
  40. <div class="input-group">
  41. <input type="text" readonly name="" value="{$url['host']}" class="form-control">
  42. <span class="input-group-addon js-clip" style="cursor:pointer">复制</span>
  43. </div>
  44. </div>
  45. </div>
  46. <div class="form-group">
  47. <label class="col-xs-12 col-sm-3 col-md-2 control-label"><span class="require"> </span>发起授权页的体验URL</label>
  48. <div class="col-sm-9 col-xs-12">
  49. <div class="input-group">
  50. <input type="text" readonly name="" value="{$url['host']}{$url['path']}web/index.php?c=account&a=auth&do=test" class="form-control">
  51. <span class="input-group-addon js-clip" style="cursor:pointer">复制</span>
  52. </div>
  53. </div>
  54. </div>
  55. <div class="form-group">
  56. <label class="col-xs-12 col-sm-3 col-md-2 control-label"><span class="require"> </span>授权事件接受URL</label>
  57. <div class="col-sm-9 col-xs-12">
  58. <div class="input-group">
  59. <input type="text" readonly name="" value="{$url['host']}{$url['path']}web/index.php?c=account&a=auth&do=ticket" class="form-control">
  60. <span class="input-group-addon js-clip" style="cursor:pointer">复制</span>
  61. </div>
  62. </div>
  63. </div>
  64. <div class="form-group">
  65. <label class="col-xs-12 col-sm-3 col-md-2 control-label" style="color:red">公众号消息校验Token</label>
  66. <div class="col-sm-9 col-xs-12">
  67. <div class="input-group">
  68. <input type="text" name="platform_token" class="form-control" value="{$_W['setting']['platform']['token']}" />
  69. <span class="input-group-addon js-clip" style="cursor:pointer">复制</span>
  70. <span class="input-group-addon" style="cursor:pointer" onclick="tokenGen();">生成新的</span>
  71. </div>
  72. <div class="help-block">与公众平台接入设置值一致,必须为英文或者数字,长度为3到32个字符. 请妥善保管, Token 泄露将可能被窃取或篡改平台的操作数据.</div>
  73. </div>
  74. </div>
  75. <div class="form-group">
  76. <label class="col-xs-12 col-sm-3 col-md-2 control-label" style="color:red">公众号消息加解密Key</label>
  77. <div class="col-sm-9 col-xs-12">
  78. <div class="input-group">
  79. <input type="text" name="encodingaeskey" class="form-control" value="{$_W['setting']['platform']['encodingaeskey']}" />
  80. <span class="input-group-addon js-clip" style="cursor:pointer">复制</span>
  81. <span class="input-group-addon" style="cursor:pointer" onclick="EncodingAESKeyGen();">生成新的</span>
  82. </div>
  83. <div class="help-block">与公众平台接入设置值一致,必须为英文或者数字,长度为43个字符. 请妥善保管, EncodingAESKey 泄露将可能被窃取或篡改平台的操作数据.</div>
  84. </div>
  85. </div>
  86. <div class="form-group">
  87. <label class="col-xs-12 col-sm-3 col-md-2 control-label"><span class="require"> </span>公众号消息与事件接受URL</label>
  88. <div class="col-sm-9 col-xs-12">
  89. <div class="input-group">
  90. <input type="text" readonly name="" value="{$url['host']}{$url['path']}api.php?appid=/$APPID$" class="form-control">
  91. <span class="input-group-addon js-clip" style="cursor:pointer">复制</span>
  92. </div>
  93. </div>
  94. </div>
  95. <div class="form-group">
  96. <label class="col-xs-12 col-sm-3 col-md-2 control-label"><span class="require"> </span>网页开发域名</label>
  97. <div class="col-sm-9 col-xs-12">
  98. <div class="input-group">
  99. <input type="text" readonly name="" value="{$url['host']}" class="form-control">
  100. <span class="input-group-addon js-clip" style="cursor:pointer">复制</span>
  101. </div>
  102. </div>
  103. </div>
  104. <div class="form-group col-sm-12">
  105. <input name="submit" id="submit" type="submit" value="提交" class="btn btn-primary col-lg-1">
  106. <input name="token" type="hidden" value="{$_W['token']}">
  107. </div>
  108. </div>
  109. </form>
  110. <script type="text/javascript">
  111. function tokenGen() {
  112. var letters = 'abcdefghijklmnopqrstuvwxyz0123456789';
  113. var token = '';
  114. for(var i = 0; i < 32; i++) {
  115. var j = parseInt(Math.random() * (31 + 1));
  116. token += letters[j];
  117. }
  118. $(':text[name="platform_token"]').val(token);
  119. }
  120. function EncodingAESKeyGen() {
  121. var letters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
  122. var token = '';
  123. for(var i = 0; i < 43; i++) {
  124. var j = parseInt(Math.random() * 61 + 1);
  125. token += letters[j];
  126. }
  127. $(':text[name="encodingaeskey"]').val(token);
  128. }
  129. require(['jquery.zclip'], function(){
  130. $('.js-clip').each(function(){
  131. var copy_button = this;
  132. $(copy_button).zclip({
  133. path: './resource/components/zclip/ZeroClipboard.swf',
  134. copy: $(copy_button).prev().val(),
  135. afterCopy: function(){
  136. $(copy_button).text('复制成功');
  137. setTimeout(function(){
  138. $(copy_button).text('复制');
  139. }, 2000);
  140. }
  141. });
  142. });
  143. });
  144. $('#form1').submit(function() {
  145. var AppId = $.trim($(':text[name="AppId"]').val());
  146. var platform_token = $.trim($(':text[name="platform_token"]').val());
  147. if(!platform_token) {
  148. util.message('platform_token');
  149. return false;
  150. }
  151. var encodingaeskey = $.trim($(':text[name="encodingaeskey"]').val());
  152. if(!encodingaeskey) {
  153. util.message('请填写encodingaeskey');
  154. return false;
  155. }
  156. });
  157. </script>
  158. {template 'common/footer-gw'}