diff --git a/public/components/frame/sso/sso.html b/public/components/frame/sso/sso.html new file mode 100644 index 000000000..1caadbb82 --- /dev/null +++ b/public/components/frame/sso/sso.html @@ -0,0 +1,4 @@ +
{{ssoInfo.errMsg}} + + +
\ No newline at end of file diff --git a/public/components/frame/sso/sso.js b/public/components/frame/sso/sso.js new file mode 100644 index 000000000..5614150fc --- /dev/null +++ b/public/components/frame/sso/sso.js @@ -0,0 +1,58 @@ +/** + 入驻小区 + **/ + (function(vc) { + vc.extends({ + data: { + ssoInfo: { + errMsg:'' + } + }, + _initMethod: function() { + let _hcAccessToken = vc.getParam('hcAccessToken'); + if(!_hcAccessToken){ + $that.ssoInfo.errMsg = '未包含hcAccessToken,请联系系统管理员'; + return; + } + + let _targetUrl = vc.getParam('targetUrl'); + if(!_targetUrl){ + $that.ssoInfo.errMsg = '未包含targetUrl 或者未用 targetUrl 未用encodeURIComponent 编码'; + } + $that._authLogin(_hcAccessToken,_targetUrl); + }, + _initEvent: function() { + + }, + methods: { + _authLogin:function(_hcAccessToken,_targetUrl){ + console.log(_targetUrl) + let _dataObj = { + hcAccessToken: _hcAccessToken, + } + //发送get请求 + vc.http.apiPost('/login.accessTokenLogin', + JSON.stringify(_dataObj), + { + emulateJSON: true + }, + function(json, res) { + let _data = JSON.parse(json); + if (_data.code != 0) { + $that.ssoInfo.errMsg = _data.msg; + return; + } + vc.emit('initData', 'loadCommunityInfo', { + url: decodeURIComponent(_targetUrl) + }); + //vc.jumpToPage(decodeURIComponent(_targetUrl)); + }, + function(errInfo, error) { + console.log(errInfo); + } + ); + }, + + } + }); +})(window.vc); \ No newline at end of file diff --git a/public/sso.html b/public/sso.html new file mode 100644 index 000000000..3dc4a69f4 --- /dev/null +++ b/public/sso.html @@ -0,0 +1,26 @@ + + + + + + + 获取用户权限 + + + + + + + + +
+ +
+ +
+
+ + + + + \ No newline at end of file diff --git a/public/test.html b/public/test.html deleted file mode 100644 index 58b66e1fc..000000000 --- a/public/test.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - Document - - - - - - - - - - \ No newline at end of file diff --git a/public/vcCore/vcFramework.js b/public/vcCore/vcFramework.js index 372946b6d..26e723d1c 100755 --- a/public/vcCore/vcFramework.js +++ b/public/vcCore/vcFramework.js @@ -1056,6 +1056,7 @@ } else { _api = '/callComponent/' + api; } + vcFramework.loading('open'); Vue.http.post(_api, param, options) .then(function(res) {