Feature: Referral-System — User wirbt User
- DB: referral_code (8-stellig, eindeutig) + referred_by zu users Bestehende User erhalten automatisch einen Code - GET /api/auth/referral: Code, Link und Anzahl geworbener User - POST /api/auth/register: ref_code Parameter für Zuordnung - Settings: 'App empfehlen'-Karte mit Link, Teilen-Button und Botschafter-Badges (Botschafter ab 1, Super ab 5, Top ab 10 Einladungen) - app.js: ?ref=CODE aus URL in sessionStorage speichern - APP_VER 222, SW by-v244
This commit is contained in:
parent
82d9e26823
commit
6d757b86c2
6 changed files with 121 additions and 7 deletions
|
|
@ -78,8 +78,10 @@ const API = (() => {
|
|||
login(email, password) {
|
||||
return post('/auth/login', { email, password });
|
||||
},
|
||||
register(email, password, name) {
|
||||
return post('/auth/register', { email, password, name });
|
||||
register(email, password, name, ref_code) {
|
||||
const body = { email, password, name };
|
||||
if (ref_code) body.ref_code = ref_code;
|
||||
return post('/auth/register', body);
|
||||
},
|
||||
logout() {
|
||||
localStorage.removeItem('by_token');
|
||||
|
|
@ -88,6 +90,7 @@ const API = (() => {
|
|||
me() {
|
||||
return get('/auth/me');
|
||||
},
|
||||
referral: () => get('/auth/referral'),
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue