enc-framework
Version:
enc-framework 核心组件.
31 lines (23 loc) • 981 B
JavaScript
// 爱加密http请求对象
import AjmHttp from '../utils/ajm-http';
import {base64Utils} from '../utils/ajm-utils';
import AjmConfig from '../utils/ajm-config'
// 用户api
function AuthApi(store, options) {
this.options = options || {};
this.store = store || {};
this.baseUrl = this.options.baseUrl || "";
this.contextPath = AjmConfig.get("OAUTH_CONTEXT_PATH") || this.options.contextPath || "";
// $http对象
this.$http = new AjmHttp({baseUrl: this.baseUrl, contextPath: this.contextPath}).getHttpClient();
return this;
}
//修改用户密码
AuthApi.prototype.activateAuth = function (params) {
return this.$http.post('/common/authorization/enableAuthorizationInfo', params).then(resp => resp.data);
}
//加载用户信息
AuthApi.prototype.findAuthorizationVO = function (callback) {
return this.$http.get('/common/authorization/findAuthorizationVO').then(resp => resp.data);
}
export default AuthApi