1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- import {getToken} from "@/api/token";
- import {
- addPointDetailByTaskDict,
- completeGrowthValue,
- } from "@/api/user";
- import {downloadDeductingIntegral} from "../api/user";
- // 加积分
- export function addIntegral(taskDict, point) {
- // let userid = JSON.parse(window.localStorage.getItem("user"));
- // console.log(userid.userId)
- getToken().then((res) => {
- addPointDetailByTaskDict(
- {
- taskDict: taskDict,
- // userId: userid.userId,
- point: point,
- },
- res.data
- )
- .then((res) => {
- })
- .catch((error) => {
- });
- });
- }
- // 加成长值
- export function addGrowth(taskDict, isUserID) {
- // let userid = JSON.parse(window.localStorage.getItem("user"));
- getToken().then((res) => {
- completeGrowthValue(
- {
- taskDict: taskDict,
- // userId: isUserID ? isUserID : userid.userId,
- },
- res.data
- )
- .then((res) => {
- })
- .catch((error) => {
- });
- });
- }
- // 减积分
- export function reductionIntegral(taskDict) {
- getToken().then((res) => {
- let params = taskDict
- downloadDeductingIntegral(params, res.data).then((res) => {
- })
- });
- }
|