fmode-ng 0.0.36 → 0.0.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/lib/aigc/avatar/comp-avatar-role-video/comp-avatar-role-video.component.mjs +1 -1
- package/esm2022/lib/aigc/chat/chat-header-area/comp-header-area.component.mjs +1 -1
- package/esm2022/lib/aigc/chat/chat-message-card/comp-message-card.component.mjs +1 -1
- package/esm2022/lib/aigc/chat/chat-panel/chat-panel.component.mjs +1 -1
- package/esm2022/lib/aigc/chat/comp-role-prompt/comp-role-prompt.component.mjs +1 -1
- package/esm2022/lib/aigc/service-fmai/service-chat/chat-class.mjs +1 -1
- package/esm2022/lib/aigc/voice/audio.player.mjs +10 -0
- package/esm2022/lib/aigc/voice/index.mjs +1 -1
- package/esm2022/lib/aigc/voice/tts/fmode-tts-class.mjs +1 -1
- package/esm2022/lib/social/wechat/wechat-jssdk.service.mjs +1 -1
- package/esm2022/lib/user/account/account.service.mjs +10 -0
- package/esm2022/lib/user/captcha/captcha.component.mjs +10 -0
- package/esm2022/lib/user/comp-user-avatar/comp-user-avatar.component.mjs +1 -1
- package/esm2022/lib/user/index.mjs +1 -1
- package/esm2022/lib/user/login/auth.guard.mjs +10 -0
- package/esm2022/lib/user/login/auth.service.mjs +10 -0
- package/esm2022/lib/user/login/login.component.mjs +10 -0
- package/esm2022/lib/user/modal-user-login/modal-user-login.component.mjs +10 -0
- package/esm2022/lib/user/profile/auth-profile.guard.mjs +10 -0
- package/esm2022/lib/user/profile/auth-profile.service.mjs +10 -0
- package/esm2022/lib/user/profile/profile-bind/profile-bind.component.mjs +10 -0
- package/esm2022/lib/user/profile/profile.module.mjs +10 -0
- package/esm2022/lib/user/staff/index.mjs +10 -0
- package/esm2022/lib/user/staff/staff.guard.mjs +10 -0
- package/esm2022/lib/user/staff/staff.module.mjs +10 -0
- package/esm2022/lib/user/staff/staff.service.mjs +10 -0
- package/esm2022/lib/user/user-name.pipe.mjs +10 -0
- package/esm2022/lib/user/user.module.mjs +10 -0
- package/esm2022/lib/video/fm-video/fm-video.component.mjs +1 -1
- package/esm2022/public-api.mjs +1 -1
- package/fesm2022/fmode-ng.mjs +1 -1
- package/fesm2022/fmode-ng.mjs.map +1 -1
- package/lib/aigc/avatar/comp-avatar-role-video/comp-avatar-role-video.component.d.ts +8 -2
- package/lib/aigc/chat/chat-panel/chat-panel.component.d.ts +3 -1
- package/lib/aigc/service-fmai/service-chat/chat-class.d.ts +17 -0
- package/lib/aigc/voice/audio.player.d.ts +10 -0
- package/lib/aigc/voice/index.d.ts +1 -0
- package/lib/social/wechat/wechat-jssdk.service.d.ts +1 -1
- package/lib/user/{account.service.d.ts → account/account.service.d.ts} +4 -3
- package/lib/user/captcha/captcha.component.d.ts +21 -0
- package/lib/user/comp-user-avatar/comp-user-avatar.component.d.ts +1 -1
- package/lib/user/index.d.ts +15 -2
- package/lib/user/login/auth.guard.d.ts +13 -0
- package/lib/user/{auth.service.d.ts → login/auth.service.d.ts} +2 -1
- package/lib/user/login/login.component.d.ts +159 -0
- package/lib/user/modal-user-login/modal-user-login.component.d.ts +40 -0
- package/lib/user/profile/auth-profile.guard.d.ts +13 -0
- package/lib/user/profile/auth-profile.service.d.ts +36 -0
- package/lib/user/profile/profile-bind/profile-bind.component.d.ts +32 -0
- package/lib/user/profile/profile.module.d.ts +17 -0
- package/lib/user/staff/index.d.ts +3 -0
- package/lib/user/staff/staff.guard.d.ts +16 -0
- package/lib/user/staff/staff.module.d.ts +7 -0
- package/lib/user/staff/staff.service.d.ts +18 -0
- package/lib/user/user-name.pipe.d.ts +8 -0
- package/lib/user/user.module.d.ts +24 -0
- package/lib/video/fm-video/fm-video.component.d.ts +0 -2
- package/package.json +1 -1
- package/public-api.d.ts +1 -1
- package/esm2022/lib/user/account.service.mjs +0 -10
- package/esm2022/lib/user/auth.service.mjs +0 -10
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* @copyright © 未来飞马 © 未来全栈 www.fmode.cn
|
|
4
|
-
* 版权所有 © 未来飞马 © 江西脑控科技有限公司 Copyright © Fmode Technology Co., Ltd.
|
|
5
|
-
* 保留所有权利 All Rights Reserved.
|
|
6
|
-
* /home/ryan/workspace/nova/nova-admin/dist/fmode-ng/esm2022/lib/user/account.service.mjs
|
|
7
|
-
*/
|
|
8
|
-
import{Injectable}from"@angular/core";import{NovaCloudService}from"../nova-cloud/nova-cloud.service";import Parse from"parse";import{AuthService}from"./auth.service";import{HttpClient}from"@angular/common/http";import*as i0 from"@angular/core";import*as i1 from"../nova-cloud/nova-cloud.service";import*as i2 from"./auth.service";import*as i3 from"@angular/common/http";export class AccountService{constructor(e,t,o){this.ncloud=e,this.authServ=t,this.http=o,this.company="",this.billing={credit:{usedDetail:{}}},this.wxAppId="",this.wxpayEnabled=!1,this.company=this.authServ.company||localStorage.getItem("company"),this.getBilling(),this.getProfile(),this.getUserOpenid()}async getProfile(){let e=Parse.User.current()?.id;if(!e)return;let t=new Parse.Query("Profile");t.equalTo("user",e),t.equalTo("company",this.company),t.notEqualTo("isDeleted",!0);let o=await t.first();o?.id&&(this.profile=o)}async getBilling(){let e;try{e=await this.ncloud.apig("aigc/account",null,"get")}catch(e){}return e?.credit&&(this.billing=e),e}async getUserOpenid(){let e=-1!=navigator.userAgent.toLowerCase().indexOf("micromessenger"),t=this.getQueryStringByName("code"),o=localStorage.getItem("openid");if(!o){if(!Parse.User.current())return;let a=Parse.User.current().get("wechat");o=a?.wxb4193c93ae9aa696?.openid,e&&(t?await this.getwechat(t):this.authWechat())}}authWechat(e="/account/billing"){if(!localStorage.getItem("openid")){let t="https://ai.fmode.cn"+e;return t=encodeURIComponent(t),void(window.location.href="https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxb4193c93ae9aa696&redirect_uri="+t+"&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect")}}getQueryStringByName(e){let t=location.search.match(new RegExp("[?&]"+e+"=([^&]+)","i"));return null==t||t.length<1?"":t[1]}async getwechat(e,t="/account/billing"){return new Promise((async(o,a)=>{this.http.post("https://server.fmode.cn/api/wechat/get_wx",{company:this.company,code:e}).subscribe((async e=>{if(console.log(e),e&&200==e.code&&e.data.openid){let t=e.data.openid;localStorage.setItem("openid",t),localStorage.removeItem("code"),Parse.User.current().set("wechat",{wxb4193c93ae9aa696:{openid:t}}),await Parse.User.current().save(),o(!0)}}),(async e=>{console.log("Error updating items",e),this.authWechat(t),a(!1)}))}))}getWXSignPackageInWechat(){let e={company:this.company,href:encodeURIComponent(location.href.split("?")[0])};this.http.post("https://server.fmode.cn/api/wechat/getconfig",e).subscribe((e=>{const t=e.data;this.wxAppId=t.appid,this.wxpayEnabled=!0,wx.config({debug:!1,appId:t.appid,timestamp:t.timestamp,nonceStr:t.nonceStr,signature:t.signature,jsApiList:["chooseWXPay","onMenuShareTimeline","onMenuShareAppMessage","onMenuShareQQ","onMenuShareQZone","updateAppMessageShareData","updateTimelineShareData"]});let o="https://ai.fmode.cn";location.pathname;Parse.User.current()?.id;let a={title:"飞码AI",desc:"解放创意引领未来|国际前沿的AIGC平台",link:o,type:"link",imgUrl:"https://file-cloud.fmode.cn/E4KpGvTEto/20230822/3mkf41033623275.png",success:function(){console.log("分享成功")},error:function(){console.log("分享失败")},cancel:function(){console.log("取消分享")}};wx.ready((()=>{wx.updateAppMessageShareData(a),wx.updateTimelineShareData(a)})),wx.error((()=>{}))}))}async saveAccountLog(e,t,o,a){return new Promise(((i,r)=>{this.http.post("https://test.fmode.cn/api/apig/saveAccountLog",{company:o,uid:Parse.User.current().id,orderid:t,info:e}).subscribe((e=>{console.log(e),i(!0)}),(e=>{console.warn(e),a&&a.error("请求超时,请稍后再试"),r()}))}))}static{this.ɵfac=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"17.3.12",ngImport:i0,type:AccountService,deps:[{token:i1.NovaCloudService},{token:i2.AuthService},{token:i3.HttpClient}],target:i0.ɵɵFactoryTarget.Injectable})}static{this.ɵprov=i0.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"17.3.12",ngImport:i0,type:AccountService,providedIn:"root"})}}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"17.3.12",ngImport:i0,type:AccountService,decorators:[{type:Injectable,args:[{providedIn:"root"}]}],ctorParameters:()=>[{type:i1.NovaCloudService},{type:i2.AuthService},{type:i3.HttpClient}]});
|
|
9
|
-
var MODULE_PATH_NEED = `6K+l5paH5Lu25piv5pys6aG555uu55qE5LiA6YOo5YiGIFRoaXMgZmlsZSBpcyBwYXJ0IG9mIHRoZSBDb21wb25lbnRzIGluIEZtb2RlIEluYy4KICAgIOeJiOadg+aJgOaciSDCqSDmnKrmnaXpo57pqawgwqkg5rGf6KW/6ISR5o6n56eR5oqA5pyJ6ZmQ5YWs5Y+4IENvcHlyaWdodCDCqSBGbW9kZSBUZWNobm9sb2d5IENvLiwgTHRkLgogICAg5L+d55WZ5omA5pyJ5p2D5YipIEFsbCBSaWdodHMgUmVzZXJ2ZWQuCiAgICDkuKXnpoHlnKjmnKrnu4/mjojmnYPnmoTmg4XlhrXkuIvvvIzpgJrov4fku7vkvZXlqpLku4vlpI3liLbmraTmlofku7YgVW5hdXRob3JpemVkIGNvcHlpbmcgb2YgdGhpcyBmaWxlLCB2aWEgYW55IG1lZGl1bSBpcyBzdHJpY3RseSBwcm9oaWJpdGVkCiAgICDor6Xmlofku7bmmK/kuJPmnInnmoTmnLrlr4bmlofku7YgUHJvcHJpZXRhcnkgYW5kIGNvbmZpZGVudGlhbAogICAKICAgIENvcHlyaWdodCAyMDIxLW5vdyBGbW9kZSBJbmMuIHN1cHBvcnRAZm1vZGUuY24uIDE4NjA3MDA3MDczLgogICAg5L+d55WZ5omA5pyJ5p2D5YipIEFsbCByaWdodHMgcmVzZXJ2ZWQuCgogICAgUEFUSDovaG9tZS9yeWFuL3dvcmtzcGFjZS9ub3ZhL25vdmEtYWRtaW4vZGlzdC9mbW9kZS1uZy9lc20yMDIyL2xpYi91c2VyL2FjY291bnQuc2VydmljZS5tanM=`
|
|
10
|
-
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* @copyright © 未来飞马 © 未来全栈 www.fmode.cn
|
|
4
|
-
* 版权所有 © 未来飞马 © 江西脑控科技有限公司 Copyright © Fmode Technology Co., Ltd.
|
|
5
|
-
* 保留所有权利 All Rights Reserved.
|
|
6
|
-
* /home/ryan/workspace/nova/nova-admin/dist/fmode-ng/esm2022/lib/user/auth.service.mjs
|
|
7
|
-
*/
|
|
8
|
-
import{Injectable}from"@angular/core";import Parse from"parse";import{Router}from"@angular/router";import{NovaCloudService}from"../nova-cloud/";import{HttpClient}from"@angular/common/http";import{catchError}from"rxjs/operators";import*as i0 from"@angular/core";import*as i1 from"@angular/router";import*as i2 from"../nova-cloud/";import*as i3 from"@angular/common/http";Parse.applicationId||(Parse.initialize("ncloudmaster"),Parse.serverURL=(Parse.serverURL?.split("parse")?.[0]||"https://server.fmode.cn/")+"parse");export class AuthService{isGuardLock(e){let t=!0,r=Parse.User.current();return t=!r?.id&&this.guardMap[e],t}get logoUrl(){return localStorage.getItem("LOGO_URL")||this._logoUrl||"https://file-cloud.fmode.cn/E4KpGvTEto/20230822/3mkf41033623275.png"}set logoUrl(e){localStorage.setItem("LOGO_URL",e),this._logoUrl=this._logoUrl}getCompanyId(){let e=localStorage.getItem("company");return e=this.company||e,e}constructor(e,t,r){this.router=e,this.novaCloud=t,this.http=r,this.guardMap={},this.isModalShow=!1,this._logoUrl="https://file-cloud.fmode.cn/E4KpGvTEto/20230822/3mkf41033623275.png",this.isLoggedIn=!1,this.LoginPage="/pcuser/login",this.mobileUserMap={}}init(e){this.company=e.company,this.guardType=e.guardType,this.saveParamsInvite()}checkLoginLock(){let e=Parse.User.current();return!!e?.id||(this.isModalShow=!0,this.isLoggedIn=!1,!1)}checkLogin(e){this.guardMap[e]=!0;let t=Parse.User.current();return console.log("currentUser",t),t&&t.id?(this.setAccount(t),this.isLoggedIn=!0,!0):this.guardType&&"page"!=this.guardType?"modal"==this.guardType?(this.isModalShow=!0,this.isLoggedIn=!1,!0):void 0:(this.redirectUrl=e,this.router.navigate([this.LoginPage]),!1)}async setAccount(e){if(this.account?.id)return;let t=Parse.Object.extend("Account"),r=e?.get("company")||{__type:"Pointer",className:"Company",objectId:this.getCompanyId()}||null,o=new Parse.Query("Account");o.equalTo("user",e.toPointer());let i=await o.first();return i?.id||(i=new t,i.set({user:e.toPointer(),company:r}),i=await i.save()),this.account=i,i}login(e,t){return new Promise(((r,o)=>{Parse.User.logIn(e,t).then((async e=>{if(this.bindInvite(e),this.setCurrentUserLocalStorage(e),"modal"==this.guardType)return await this.refreshPage(),void r(!0);let t=new Parse.Query("Company");t.select("rootPage"),t.equalTo("objectId",e?.get("company")?.id);let o=await t.first(),i=o?.get("rootPage");this.redirectUrl=this.redirectUrl||i||"/project/dashboard";let a=this.redirectUrl;a=decodeURIComponent(a),this.router.navigate([a])})).catch((e=>{console.error(e),o({message:"无此用户信息,请先在小程序登录"})}))}))}refreshPage(){return new Promise((e=>{let t=this.router.url;Parse.User.current()?.id&&(this.isModalShow=!1),this.router.navigateByUrl("/",{skipLocationChange:!0}).then((()=>{this.router.navigateByUrl(t).then((()=>{e(!0)}))}))}))}setCurrentUserLocalStorage(e){e.get("company")?.id&&localStorage.setItem("company",e.get("company")?.id)}logout(e,t){let r=localStorage.getItem("company");localStorage.clear(),localStorage.setItem("company",r),Parse.User.logOut().then((e=>{this.router.navigate([t||"/pcuser/login"])}))}async loginMobilePassword(e,t,r){let o=await this.getMobileUser(e);o?this.login(o,t).then((async e=>{this.isModalShow=!1})).catch((e=>{console.log(e),r.create("error","错误的用户名或密码")})):r.create("error","用户不存在,请尝试其他登录方式")}signMobilePassword(e,t){return new Promise(((r,o)=>{Parse.User.signUp(this.getCompanyId()+"-"+e,t,"").then((async t=>{t.id&&(console.log(t),t.set("company",{__type:"Pointer",className:"Company",objectId:this.getCompanyId()}),t.set("mobile",e),t.set("type","user"),this.bindInvite(t),t=await t.save(),r(t))})).catch((e=>{o(e)}))}))}async getMobileUser(e){let t=this.getCompanyId(),r=t+e;if(this.mobileUserMap[r])return this.mobileUserMap[r];let o=await this.novaCloud.api("/auth/getusername",{company:t,mobile:e});return o?.username&&(this.mobileUserMap[r]=o?.username),this.mobileUserMap[r]}async loginCode(e,t,r){return new Promise(((o,i)=>{if(!t)return r?.create("error","请填写有效验证码"),void i();let a=Parse.serverURL?.split("parse")?.[0]||"https://server.fmode.cn/";this.http.get(a+`api/auth/mobile?company=${this.company}&mobile=${e}&code=${t}`,{}).pipe(catchError((async e=>{console.log(e),r?.create("error","登录失败:"+e.error.mess),i()}))).subscribe((e=>{200==e.code?Parse.User.become(e.data.token).then((async e=>{if(console.log(e),e.id)return this.bindInvite(e),void o(!0);r?.create("error","登录失败"),i()})):(r?.create("error","登录失败"),i())}))}))}saveParamsInvite(){let e=this.novaCloud.searchParse();console.log("saveParamsInvite",e);let t=e?.invite;console.log(t),t&&localStorage.setItem("invite",e?.invite)}bindInvite(e){if(!(e=e||Parse.User.current()))return;if(e?.get("invite")?.id)return;let t=localStorage.getItem("invite");t&&this.novaCloud.api("/auth/invite",{current:e?.id,invite:t,type:"code"})}static{this.ɵfac=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"17.3.12",ngImport:i0,type:AuthService,deps:[{token:i1.Router},{token:i2.NovaCloudService},{token:i3.HttpClient}],target:i0.ɵɵFactoryTarget.Injectable})}static{this.ɵprov=i0.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"17.3.12",ngImport:i0,type:AuthService,providedIn:"root"})}}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"17.3.12",ngImport:i0,type:AuthService,decorators:[{type:Injectable,args:[{providedIn:"root"}]}],ctorParameters:()=>[{type:i1.Router},{type:i2.NovaCloudService},{type:i3.HttpClient}]});
|
|
9
|
-
var MODULE_PATH_NEED = `6K+l5paH5Lu25piv5pys6aG555uu55qE5LiA6YOo5YiGIFRoaXMgZmlsZSBpcyBwYXJ0IG9mIHRoZSBDb21wb25lbnRzIGluIEZtb2RlIEluYy4KICAgIOeJiOadg+aJgOaciSDCqSDmnKrmnaXpo57pqawgwqkg5rGf6KW/6ISR5o6n56eR5oqA5pyJ6ZmQ5YWs5Y+4IENvcHlyaWdodCDCqSBGbW9kZSBUZWNobm9sb2d5IENvLiwgTHRkLgogICAg5L+d55WZ5omA5pyJ5p2D5YipIEFsbCBSaWdodHMgUmVzZXJ2ZWQuCiAgICDkuKXnpoHlnKjmnKrnu4/mjojmnYPnmoTmg4XlhrXkuIvvvIzpgJrov4fku7vkvZXlqpLku4vlpI3liLbmraTmlofku7YgVW5hdXRob3JpemVkIGNvcHlpbmcgb2YgdGhpcyBmaWxlLCB2aWEgYW55IG1lZGl1bSBpcyBzdHJpY3RseSBwcm9oaWJpdGVkCiAgICDor6Xmlofku7bmmK/kuJPmnInnmoTmnLrlr4bmlofku7YgUHJvcHJpZXRhcnkgYW5kIGNvbmZpZGVudGlhbAogICAKICAgIENvcHlyaWdodCAyMDIxLW5vdyBGbW9kZSBJbmMuIHN1cHBvcnRAZm1vZGUuY24uIDE4NjA3MDA3MDczLgogICAg5L+d55WZ5omA5pyJ5p2D5YipIEFsbCByaWdodHMgcmVzZXJ2ZWQuCgogICAgUEFUSDovaG9tZS9yeWFuL3dvcmtzcGFjZS9ub3ZhL25vdmEtYWRtaW4vZGlzdC9mbW9kZS1uZy9lc20yMDIyL2xpYi91c2VyL2F1dGguc2VydmljZS5tanM=`
|
|
10
|
-
|